guilhermesteinmuller | 86a88b6 | 2022-05-27 16:45:49 +0000 | [diff] [blame] | 1 | # 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 Naser | c8e1a45 | 2022-08-11 16:16:13 -0400 | [diff] [blame] | 15 | - name: Deploy service |
guilhermesteinmuller | 86a88b6 | 2022-05-27 16:45:49 +0000 | [diff] [blame] | 16 | kubernetes.core.k8s: |
| 17 | state: present |
| 18 | definition: |
Mohammed Naser | c8e1a45 | 2022-08-11 16:16:13 -0400 | [diff] [blame] | 19 | - apiVersion: apps/v1 |
| 20 | kind: Deployment |
| 21 | metadata: |
| 22 | name: openstack-exporter |
Mohammed Naser | b77cea1 | 2022-11-28 22:27:10 +0000 | [diff] [blame] | 23 | namespace: openstack |
Mohammed Naser | c8e1a45 | 2022-08-11 16:16:13 -0400 | [diff] [blame] | 24 | labels: |
guilhermesteinmuller | 86a88b6 | 2022-05-27 16:45:49 +0000 | [diff] [blame] | 25 | application: openstack-exporter |
Mohammed Naser | c8e1a45 | 2022-08-11 16:16:13 -0400 | [diff] [blame] | 26 | spec: |
| 27 | replicas: 1 |
| 28 | selector: |
| 29 | matchLabels: |
guilhermesteinmuller | 86a88b6 | 2022-05-27 16:45:49 +0000 | [diff] [blame] | 30 | application: openstack-exporter |
Mohammed Naser | c8e1a45 | 2022-08-11 16:16:13 -0400 | [diff] [blame] | 31 | template: |
| 32 | metadata: |
| 33 | labels: |
| 34 | application: openstack-exporter |
| 35 | spec: |
| 36 | nodeSelector: |
| 37 | openstack-control-plane: enabled |
Mohammed Naser | b77cea1 | 2022-11-28 22:27:10 +0000 | [diff] [blame] | 38 | initContainers: |
| 39 | - name: build-config |
Mohammed Naser | 31171f4 | 2023-03-19 00:10:46 +0000 | [diff] [blame] | 40 | image: "{{ atmosphere_images['bootstrap'] | vexxhost.kubernetes.docker_image('ref') }}" |
Mohammed Naser | b77cea1 | 2022-11-28 22:27:10 +0000 | [diff] [blame] | 41 | 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 Naser | c8e1a45 | 2022-08-11 16:16:13 -0400 | [diff] [blame] | 66 | containers: |
| 67 | - name: openstack-exporter |
Mohammed Naser | 31171f4 | 2023-03-19 00:10:46 +0000 | [diff] [blame] | 68 | image: "{{ atmosphere_images['prometheus_openstack_exporter'] | vexxhost.kubernetes.docker_image('ref') }}" |
Mohammed Naser | c8e1a45 | 2022-08-11 16:16:13 -0400 | [diff] [blame] | 69 | args: |
| 70 | - --endpoint-type |
| 71 | - internal |
| 72 | - default |
| 73 | - --collect-metric-time |
Mohammed Naser | c90235e | 2022-11-29 02:03:52 +0000 | [diff] [blame] | 74 | ports: |
| 75 | - name: metrics |
| 76 | containerPort: 9180 |
Rico Lin | 17b6411 | 2023-08-24 03:13:27 +0800 | [diff] [blame] | 77 | env: |
| 78 | - name: OS_COMPUTE_API_VERSION |
| 79 | value: "2.87" |
Mohammed Naser | c8e1a45 | 2022-08-11 16:16:13 -0400 | [diff] [blame] | 80 | volumeMounts: |
| 81 | - name: openstack-config |
Mohammed Naser | b77cea1 | 2022-11-28 22:27:10 +0000 | [diff] [blame] | 82 | mountPath: /etc/openstack |
| 83 | readinessProbe: |
| 84 | failureThreshold: 3 |
| 85 | httpGet: |
| 86 | path: / |
| 87 | port: 9180 |
| 88 | scheme: HTTP |
| 89 | livenessProbe: |
| 90 | failureThreshold: 3 |
| 91 | httpGet: |
| 92 | path: / |
| 93 | port: 9180 |
| 94 | scheme: HTTP |
| 95 | periodSeconds: 10 |
| 96 | successThreshold: 1 |
| 97 | timeoutSeconds: 1 |
Mohammed Naser | c8e1a45 | 2022-08-11 16:16:13 -0400 | [diff] [blame] | 98 | volumes: |
| 99 | - name: openstack-config |
Mohammed Naser | b77cea1 | 2022-11-28 22:27:10 +0000 | [diff] [blame] | 100 | emptyDir: {} |
guilhermesteinmuller | 86a88b6 | 2022-05-27 16:45:49 +0000 | [diff] [blame] | 101 | |
Mohammed Naser | c8e1a45 | 2022-08-11 16:16:13 -0400 | [diff] [blame] | 102 | - apiVersion: v1 |
| 103 | kind: Service |
| 104 | metadata: |
| 105 | name: openstack-exporter |
Mohammed Naser | b77cea1 | 2022-11-28 22:27:10 +0000 | [diff] [blame] | 106 | namespace: openstack |
Mohammed Naser | c8e1a45 | 2022-08-11 16:16:13 -0400 | [diff] [blame] | 107 | labels: |
| 108 | application: openstack-exporter |
| 109 | spec: |
| 110 | clusterIP: None |
| 111 | ports: |
| 112 | - name: metrics |
| 113 | port: 9180 |
| 114 | targetPort: metrics |
| 115 | selector: |
guilhermesteinmuller | 86a88b6 | 2022-05-27 16:45:49 +0000 | [diff] [blame] | 116 | application: openstack-exporter |