Mohammed Naser | 2144b34 | 2022-05-23 10:25:31 -0400 | [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 |
Mohammed Naser | 2144b34 | 2022-05-23 10:25:31 -0400 | [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: v1 |
| 20 | kind: ConfigMap |
| 21 | metadata: |
| 22 | name: ipmi-exporter |
| 23 | namespace: monitoring |
| 24 | labels: |
Mohammed Naser | 2144b34 | 2022-05-23 10:25:31 -0400 | [diff] [blame] | 25 | application: ipmi-exporter |
Mohammed Naser | c8e1a45 | 2022-08-11 16:16:13 -0400 | [diff] [blame] | 26 | data: |
| 27 | config.yml: "{{ ipmi_exporter_config | to_yaml }}" |
| 28 | |
| 29 | - apiVersion: apps/v1 |
| 30 | kind: DaemonSet |
| 31 | metadata: |
| 32 | name: ipmi-exporter |
| 33 | namespace: monitoring |
| 34 | labels: |
| 35 | application: ipmi-exporter |
| 36 | spec: |
| 37 | selector: |
| 38 | matchLabels: |
Mohammed Naser | 2144b34 | 2022-05-23 10:25:31 -0400 | [diff] [blame] | 39 | application: ipmi-exporter |
Mohammed Naser | c8e1a45 | 2022-08-11 16:16:13 -0400 | [diff] [blame] | 40 | template: |
| 41 | metadata: |
| 42 | annotations: |
| 43 | config-hash: "{{ ipmi_exporter_config | to_yaml | hash('md5') }}" |
| 44 | labels: |
| 45 | application: ipmi-exporter |
| 46 | job: ipmi |
| 47 | spec: |
| 48 | containers: |
| 49 | - name: exporter |
Mohammed Naser | 31171f4 | 2023-03-19 00:10:46 +0000 | [diff] [blame] | 50 | image: "{{ atmosphere_images['prometheus_ipmi_exporter'] | vexxhost.kubernetes.docker_image('ref') }}" |
Mohammed Naser | c8e1a45 | 2022-08-11 16:16:13 -0400 | [diff] [blame] | 51 | ports: |
| 52 | - name: metrics |
| 53 | containerPort: 9290 |
| 54 | securityContext: |
| 55 | privileged: true |
| 56 | volumeMounts: |
| 57 | - name: dev-ipmi0 |
| 58 | mountPath: /dev/ipmi0 |
| 59 | - name: ipmi-exporter |
| 60 | mountPath: /config.yml |
| 61 | subPath: config.yml |
| 62 | volumes: |
| 63 | - name: dev-ipmi0 |
| 64 | hostPath: |
| 65 | path: /dev/ipmi0 |
| 66 | - name: ipmi-exporter |
| 67 | configMap: |
| 68 | name: ipmi-exporter |
| 69 | affinity: |
| 70 | nodeAffinity: |
| 71 | requiredDuringSchedulingIgnoredDuringExecution: |
| 72 | nodeSelectorTerms: |
| 73 | - matchExpressions: |
| 74 | - key: feature.node.kubernetes.io/cpu-cpuid.HYPERVISOR |
| 75 | operator: NotIn |
| 76 | values: ["true"] |