Add support for prometheus
[ric-plt/ric-dep.git] / helm / infrastructure / subcharts / prometheus / charts / kube-state-metrics / templates / deployment.yaml
1 apiVersion: apps/v1
2 {{- if .Values.autosharding.enabled }}
3 kind: StatefulSet
4 {{- else }}
5 kind: Deployment
6 {{- end }}
7 metadata:
8   name: {{ template "kube-state-metrics.fullname" . }}
9   namespace: {{ template "kube-state-metrics.namespace" . }}
10   labels:
11     app.kubernetes.io/name: {{ template "kube-state-metrics.name" . }}
12     helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
13     app.kubernetes.io/instance: "{{ .Release.Name }}"
14     app.kubernetes.io/managed-by: "{{ .Release.Service }}"
15 {{- if .Values.customLabels }}
16 {{ toYaml .Values.customLabels | indent 4 }}
17 {{- end }}
18 spec:
19   selector:
20     matchLabels:
21       app.kubernetes.io/name: {{ template "kube-state-metrics.name" . }}
22   replicas: {{ .Values.replicas }}
23 {{- if .Values.autosharding.enabled }}
24   serviceName: {{ template "kube-state-metrics.fullname" . }}
25   volumeClaimTemplates: []
26 {{- end }}
27   template:
28     metadata:
29       labels:
30         app.kubernetes.io/name: {{ template "kube-state-metrics.name" . }}
31         app.kubernetes.io/instance: "{{ .Release.Name }}"
32 {{- if .Values.customLabels }}
33 {{ toYaml .Values.customLabels | indent 8 }}
34 {{- end }}
35 {{- if .Values.podAnnotations }}
36       annotations:
37 {{ toYaml .Values.podAnnotations | indent 8 }}
38 {{- end }}
39     spec:
40       hostNetwork: {{ .Values.hostNetwork }}
41       serviceAccountName: {{ template "kube-state-metrics.serviceAccountName" . }}
42       {{- if .Values.securityContext.enabled }}
43       securityContext:
44         fsGroup: {{ .Values.securityContext.fsGroup }}
45         runAsUser: {{ .Values.securityContext.runAsUser }}
46       {{- end }}
47     {{- if .Values.priorityClassName }}
48       priorityClassName: {{ .Values.priorityClassName }}
49     {{- end }}
50       containers:
51       - name: {{ .Chart.Name }}
52 {{- if .Values.autosharding.enabled }}
53         env:
54         - name: POD_NAME
55           valueFrom:
56             fieldRef:
57               fieldPath: metadata.name
58         - name: POD_NAMESPACE
59           valueFrom:
60             fieldRef:
61               fieldPath: metadata.namespace
62 {{- end }}
63         args:
64 {{  if .Values.collectors.certificatesigningrequests  }}
65         - --collectors=certificatesigningrequests
66 {{  end  }}
67 {{  if .Values.collectors.configmaps  }}
68         - --collectors=configmaps
69 {{  end  }}
70 {{  if .Values.collectors.cronjobs  }}
71         - --collectors=cronjobs
72 {{  end  }}
73 {{ if .Values.collectors.daemonsets  }}
74         - --collectors=daemonsets
75 {{  end  }}
76 {{  if .Values.collectors.deployments  }}
77         - --collectors=deployments
78 {{  end  }}
79 {{  if .Values.collectors.endpoints  }}
80         - --collectors=endpoints
81 {{  end  }}
82 {{  if .Values.collectors.horizontalpodautoscalers  }}
83         - --collectors=horizontalpodautoscalers
84 {{  end  }}
85 {{  if .Values.collectors.ingresses  }}
86         - --collectors=ingresses
87 {{  end  }}
88 {{  if .Values.collectors.jobs  }}
89         - --collectors=jobs
90 {{  end  }}
91 {{  if .Values.collectors.limitranges  }}
92         - --collectors=limitranges
93 {{  end  }}
94 {{  if .Values.collectors.mutatingwebhookconfigurations  }}
95         - --collectors=mutatingwebhookconfigurations
96 {{  end  }}
97 {{  if .Values.collectors.namespaces  }}
98         - --collectors=namespaces
99 {{  end  }}
100 {{  if .Values.collectors.networkpolicies  }}
101         - --collectors=networkpolicies
102 {{  end  }}
103 {{  if .Values.collectors.nodes  }}
104         - --collectors=nodes
105 {{  end  }}
106 {{  if .Values.collectors.persistentvolumeclaims  }}
107         - --collectors=persistentvolumeclaims
108 {{  end  }}
109 {{  if .Values.collectors.persistentvolumes  }}
110         - --collectors=persistentvolumes
111 {{  end  }}
112 {{  if .Values.collectors.poddisruptionbudgets  }}
113         - --collectors=poddisruptionbudgets
114 {{  end  }}
115 {{  if .Values.collectors.pods  }}
116         - --collectors=pods
117 {{  end  }}
118 {{  if .Values.collectors.replicasets  }}
119         - --collectors=replicasets
120 {{  end  }}
121 {{  if .Values.collectors.replicationcontrollers  }}
122         - --collectors=replicationcontrollers
123 {{  end  }}
124 {{  if .Values.collectors.resourcequotas  }}
125         - --collectors=resourcequotas
126 {{  end  }}
127 {{  if .Values.collectors.secrets  }}
128         - --collectors=secrets
129 {{  end  }}
130 {{  if .Values.collectors.services  }}
131         - --collectors=services
132 {{  end  }}
133 {{  if .Values.collectors.statefulsets  }}
134         - --collectors=statefulsets
135 {{  end  }}
136 {{  if .Values.collectors.storageclasses  }}
137         - --collectors=storageclasses
138 {{  end  }}
139 {{  if .Values.collectors.validatingwebhookconfigurations  }}
140         - --collectors=validatingwebhookconfigurations
141 {{  end  }}
142 {{  if .Values.collectors.verticalpodautoscalers  }}
143         - --collectors=verticalpodautoscalers
144 {{  end  }}
145 {{  if .Values.collectors.volumeattachments  }}
146         - --collectors=volumeattachments
147 {{  end  }}
148 {{ if .Values.namespace }}
149         - --namespace={{ .Values.namespace }}
150 {{ end }}
151 {{ if .Values.autosharding.enabled }}
152         - --pod=$(POD_NAME)
153         - --pod-namespace=$(POD_NAMESPACE)
154 {{ end }}
155         imagePullPolicy: {{ .Values.image.pullPolicy }}
156         image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
157         ports:
158         - containerPort: 8080
159         livenessProbe:
160           httpGet:
161             path: /healthz
162             port: 8080
163           initialDelaySeconds: 5
164           timeoutSeconds: 5
165         readinessProbe:
166           httpGet:
167             path: /
168             port: 8080
169           initialDelaySeconds: 5
170           timeoutSeconds: 5
171 {{- if .Values.resources }}
172         resources:
173 {{ toYaml .Values.resources | indent 10 }}
174 {{- end }}
175 {{- if .Values.affinity }}
176       affinity:
177 {{ toYaml .Values.affinity | indent 8 }}
178 {{- end }}
179 {{- if .Values.nodeSelector }}
180       nodeSelector:
181 {{ toYaml .Values.nodeSelector | indent 8 }}
182 {{- end }}
183 {{- if .Values.tolerations }}
184       tolerations:
185 {{ toYaml .Values.tolerations | indent 8 }}
186 {{- end }}