blob: c83104d06ae3386edf3b10a6182746a1d05e51ef [file] [log] [blame]
Mohammed Naser2144b342022-05-23 10:25:31 -04001# 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
Mohammed Naser2144b342022-05-23 10:25:31 -040016 kubernetes.core.k8s:
17 state: present
18 definition:
Mohammed Naserc8e1a452022-08-11 16:16:13 -040019 - apiVersion: v1
20 kind: ConfigMap
21 metadata:
22 name: ipmi-exporter
23 namespace: monitoring
24 labels:
Mohammed Naser2144b342022-05-23 10:25:31 -040025 application: ipmi-exporter
Mohammed Naserc8e1a452022-08-11 16:16:13 -040026 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 Naser2144b342022-05-23 10:25:31 -040039 application: ipmi-exporter
Mohammed Naserc8e1a452022-08-11 16:16:13 -040040 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 Naser31171f42023-03-19 00:10:46 +000050 image: "{{ atmosphere_images['prometheus_ipmi_exporter'] | vexxhost.kubernetes.docker_image('ref') }}"
Mohammed Naserc8e1a452022-08-11 16:16:13 -040051 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"]