blob: 0b38ef4d8b7de1db4f6d0f9860250685c6abfde6 [file] [log] [blame]
guilhermesteinmuller86a88b62022-05-27 16:45:49 +00001# Copyright (c) 2022 VEXXHOST, Inc.
2#
3# Licensed under the Apache License, Version 2.0 (the "License"); you may
4# not use this file except in compliance with the License. You may obtain
5# a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12# License for the specific language governing permissions and limitations
13# under the License.
14
15- name: Create keystone user
16 openstack.cloud.identity_user:
17 cloud: atmosphere
18 state: present
19 name: openstack-exporter-{{ openstack_helm_endpoints_region_name }}
20 password: "{{ openstack_helm_endpoints_openstack_exporter_keystone_password }}"
21 domain: service
22 default_project: service
23
24- name: Assign admin role to service user
25 openstack.cloud.role_assignment:
26 cloud: atmosphere
27 user: openstack-exporter-{{ openstack_helm_endpoints_region_name }}
28 role: admin
29 project: service
30 domain: service
31
Mohammed Naserc8e1a452022-08-11 16:16:13 -040032- name: Deploy service
guilhermesteinmuller86a88b62022-05-27 16:45:49 +000033 kubernetes.core.k8s:
34 state: present
35 definition:
Mohammed Naserc8e1a452022-08-11 16:16:13 -040036 - apiVersion: v1
37 kind: Secret
38 metadata:
39 name: openstack-config
40 namespace: monitoring
41 type: Opaque
42 stringData:
43 clouds.yaml: |
44 clouds:
45 openstack:
46 auth:
47 auth_url: http://keystone-api.openstack.svc.cluster.local:5000
48 project_domain_name: service
49 project_name: service
50 user_domain_name: service
51 username: openstack-exporter-{{ openstack_helm_endpoints_region_name }}
52 password: {{ openstack_helm_endpoints_openstack_exporter_keystone_password }}
53 region_name: {{ openstack_helm_endpoints_region_name }}
54 interface: internal
55 identity_api_version: 3
56 identity_interface: internal
guilhermesteinmuller86a88b62022-05-27 16:45:49 +000057
Mohammed Naserc8e1a452022-08-11 16:16:13 -040058 - apiVersion: apps/v1
59 kind: Deployment
60 metadata:
61 name: openstack-exporter
62 namespace: monitoring
63 labels:
guilhermesteinmuller86a88b62022-05-27 16:45:49 +000064 application: openstack-exporter
Mohammed Naserc8e1a452022-08-11 16:16:13 -040065 spec:
66 replicas: 1
67 selector:
68 matchLabels:
guilhermesteinmuller86a88b62022-05-27 16:45:49 +000069 application: openstack-exporter
Mohammed Naserc8e1a452022-08-11 16:16:13 -040070 template:
71 metadata:
72 labels:
73 application: openstack-exporter
74 spec:
75 nodeSelector:
76 openstack-control-plane: enabled
77 containers:
78 - name: openstack-exporter
Mohammed Naser6e24e872022-09-08 12:49:37 -040079 image: "{{ openstack_exporter_image_repository }}/openstack-exporter:{{ openstack_exporter_image_tag }}"
Mohammed Naserc8e1a452022-08-11 16:16:13 -040080 args:
81 - --endpoint-type
82 - internal
83 - default
84 - --collect-metric-time
85 - --disable-service.identity
86 - --disable-service.image
87 - --disable-metric=cinder-limits_volume_max_gb
88 - --disable-metric=cinder-limits_volume_used_gb
89 - --disable-metric=cinder-volumes
90 - --disable-metric=cinder-volume_status
91 - --disable-metric=neutron-floating_ips
92 - --disable-metric=neutron-networks
93 - --disable-metric=neutron-security_groups
94 - --disable-metric=neutron-subnets
95 - --disable-metric=neutron-routers
96 - --disable-metric=nova-flavors
97 - --disable-metric=nova-availability_zones
98 - --disable-metric=nova-security_groups
99 - --disable-metric=nova-limits_vcpus_max
100 - --disable-metric=nova-limits_vcpus_used
101 - --disable-metric=nova-limits_memory_max
102 - --disable-metric=nova-limits_memory_used
103 port:
104 name: metrics
105 containerPort: 9180
106 volumeMounts:
107 - name: openstack-config
108 mountPath: "/etc/openstack"
109 volumes:
110 - name: openstack-config
111 secret:
112 secretName: openstack-config
guilhermesteinmuller86a88b62022-05-27 16:45:49 +0000113
Mohammed Naserc8e1a452022-08-11 16:16:13 -0400114 - apiVersion: v1
115 kind: Service
116 metadata:
117 name: openstack-exporter
118 namespace: monitoring
119 labels:
120 application: openstack-exporter
121 spec:
122 clusterIP: None
123 ports:
124 - name: metrics
125 port: 9180
126 targetPort: metrics
127 selector:
guilhermesteinmuller86a88b62022-05-27 16:45:49 +0000128 application: openstack-exporter
Mohammed Naserc8e1a452022-08-11 16:16:13 -0400129 # NOTE(mnaser): Since we haven't moved to the operator pattern yet, we need to
130 # keep retrying a few times as the CRDs might not be installed
131 # yet.
132 retries: 60
133 delay: 5
134 register: _result
135 until: _result is not failed