blob: 8de76880743503bcab975f34663d568cc56d7ea4 [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
Mohammed Naserc8e1a452022-08-11 16:16:13 -040015- name: Deploy service
guilhermesteinmuller86a88b62022-05-27 16:45:49 +000016 kubernetes.core.k8s:
17 state: present
18 definition:
Mohammed Naserc8e1a452022-08-11 16:16:13 -040019 - apiVersion: apps/v1
20 kind: Deployment
21 metadata:
22 name: openstack-exporter
Mohammed Naserb77cea12022-11-28 22:27:10 +000023 namespace: openstack
Mohammed Naserc8e1a452022-08-11 16:16:13 -040024 labels:
guilhermesteinmuller86a88b62022-05-27 16:45:49 +000025 application: openstack-exporter
Mohammed Naserc8e1a452022-08-11 16:16:13 -040026 spec:
27 replicas: 1
28 selector:
29 matchLabels:
guilhermesteinmuller86a88b62022-05-27 16:45:49 +000030 application: openstack-exporter
Mohammed Naserc8e1a452022-08-11 16:16:13 -040031 template:
32 metadata:
33 labels:
34 application: openstack-exporter
35 spec:
36 nodeSelector:
37 openstack-control-plane: enabled
Mohammed Naserb77cea12022-11-28 22:27:10 +000038 initContainers:
39 - name: build-config
Mohammed Naser31171f42023-03-19 00:10:46 +000040 image: "{{ atmosphere_images['bootstrap'] | vexxhost.kubernetes.docker_image('ref') }}"
Mohammed Naserb77cea12022-11-28 22:27:10 +000041 command: ["bash", "-ec"]
42 args:
43 - |
44 cat <<EOF > /etc/openstack/clouds.yaml
45 ---
46 clouds:
47 default:
48 auth:
49 auth_url: "$(OS_AUTH_URL)"
50 project_domain_name: "$(OS_PROJECT_DOMAIN_NAME)"
51 project_name: "$(OS_PROJECT_NAME)"
52 user_domain_name: "$(OS_USER_DOMAIN_NAME)"
53 username: "$(OS_USERNAME)"
54 password: "$(OS_PASSWORD)"
55 region_name: "$(OS_REGION_NAME)"
56 interface: "$(OS_INTERFACE)"
57 identity_api_version: 3
58 identity_interface: "$(OS_INTERFACE)"
59 EOF
60 envFrom:
61 - secretRef:
62 name: keystone-keystone-admin
63 volumeMounts:
64 - name: openstack-config
65 mountPath: /etc/openstack
Mohammed Naserc8e1a452022-08-11 16:16:13 -040066 containers:
67 - name: openstack-exporter
Mohammed Naser31171f42023-03-19 00:10:46 +000068 image: "{{ atmosphere_images['prometheus_openstack_exporter'] | vexxhost.kubernetes.docker_image('ref') }}"
Mohammed Naserc8e1a452022-08-11 16:16:13 -040069 args:
70 - --endpoint-type
71 - internal
72 - default
73 - --collect-metric-time
74 - --disable-service.identity
75 - --disable-service.image
76 - --disable-metric=cinder-limits_volume_max_gb
77 - --disable-metric=cinder-limits_volume_used_gb
78 - --disable-metric=cinder-volumes
79 - --disable-metric=cinder-volume_status
80 - --disable-metric=neutron-floating_ips
81 - --disable-metric=neutron-networks
82 - --disable-metric=neutron-security_groups
83 - --disable-metric=neutron-subnets
84 - --disable-metric=neutron-routers
85 - --disable-metric=nova-flavors
86 - --disable-metric=nova-availability_zones
87 - --disable-metric=nova-security_groups
88 - --disable-metric=nova-limits_vcpus_max
89 - --disable-metric=nova-limits_vcpus_used
90 - --disable-metric=nova-limits_memory_max
91 - --disable-metric=nova-limits_memory_used
Mohammed Naserc90235e2022-11-29 02:03:52 +000092 ports:
93 - name: metrics
94 containerPort: 9180
Rico Lin17b64112023-08-24 03:13:27 +080095 env:
96 - name: OS_COMPUTE_API_VERSION
97 value: "2.87"
Mohammed Naserc8e1a452022-08-11 16:16:13 -040098 volumeMounts:
99 - name: openstack-config
Mohammed Naserb77cea12022-11-28 22:27:10 +0000100 mountPath: /etc/openstack
101 readinessProbe:
102 failureThreshold: 3
103 httpGet:
104 path: /
105 port: 9180
106 scheme: HTTP
107 livenessProbe:
108 failureThreshold: 3
109 httpGet:
110 path: /
111 port: 9180
112 scheme: HTTP
113 periodSeconds: 10
114 successThreshold: 1
115 timeoutSeconds: 1
Mohammed Naserc8e1a452022-08-11 16:16:13 -0400116 volumes:
117 - name: openstack-config
Mohammed Naserb77cea12022-11-28 22:27:10 +0000118 emptyDir: {}
guilhermesteinmuller86a88b62022-05-27 16:45:49 +0000119
Mohammed Naserc8e1a452022-08-11 16:16:13 -0400120 - apiVersion: v1
121 kind: Service
122 metadata:
123 name: openstack-exporter
Mohammed Naserb77cea12022-11-28 22:27:10 +0000124 namespace: openstack
Mohammed Naserc8e1a452022-08-11 16:16:13 -0400125 labels:
126 application: openstack-exporter
127 spec:
128 clusterIP: None
129 ports:
130 - name: metrics
131 port: 9180
132 targetPort: metrics
133 selector:
guilhermesteinmuller86a88b62022-05-27 16:45:49 +0000134 application: openstack-exporter