This repository has been archived by the owner on Feb 22, 2022. It is now read-only.
/
deployment.yaml
142 lines (142 loc) · 6.49 KB
/
deployment.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
{{- $namespace := printf "%s" (include "prometheus-operator.namespace" .) }}
{{- if .Values.prometheusOperator.enabled }}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ template "prometheus-operator.fullname" . }}-operator
namespace: {{ template "prometheus-operator.namespace" . }}
labels:
app: {{ template "prometheus-operator.name" . }}-operator
{{ include "prometheus-operator.labels" . | indent 4 }}
spec:
replicas: 1
selector:
matchLabels:
app: {{ template "prometheus-operator.name" . }}-operator
release: {{ $.Release.Name | quote }}
template:
metadata:
labels:
app: {{ template "prometheus-operator.name" . }}-operator
{{ include "prometheus-operator.labels" . | indent 8 }}
{{- if .Values.prometheusOperator.podLabels }}
{{ toYaml .Values.prometheusOperator.podLabels | indent 8 }}
{{- end }}
{{- if .Values.prometheusOperator.podAnnotations }}
annotations:
{{ toYaml .Values.prometheusOperator.podAnnotations | indent 8 }}
{{- end }}
spec:
{{- if .Values.prometheusOperator.priorityClassName }}
priorityClassName: {{ .Values.prometheusOperator.priorityClassName }}
{{- end }}
containers:
- name: {{ template "prometheus-operator.name" . }}
{{- if .Values.prometheusOperator.image.sha }}
image: "{{ .Values.prometheusOperator.image.repository }}:{{ .Values.prometheusOperator.image.tag }}@sha256:{{ .Values.prometheusOperator.image.sha }}"
{{- else }}
image: "{{ .Values.prometheusOperator.image.repository }}:{{ .Values.prometheusOperator.image.tag }}"
{{- end }}
imagePullPolicy: "{{ .Values.prometheusOperator.image.pullPolicy }}"
args:
{{- if semverCompare "< v0.39.0" .Values.prometheusOperator.image.tag }}
- --manage-crds={{ .Values.prometheusOperator.manageCrds }}
{{- end }}
{{- if .Values.prometheusOperator.kubeletService.enabled }}
- --kubelet-service={{ .Values.prometheusOperator.kubeletService.namespace }}/{{ template "prometheus-operator.fullname" . }}-kubelet
{{- end }}
{{- if .Values.prometheusOperator.logFormat }}
- --log-format={{ .Values.prometheusOperator.logFormat }}
{{- end }}
{{- if .Values.prometheusOperator.logLevel }}
- --log-level={{ .Values.prometheusOperator.logLevel }}
{{- end }}
{{- if .Values.prometheusOperator.denyNamespaces }}
- --deny-namespaces={{ .Values.prometheusOperator.denyNamespaces | join "," }}
{{- end }}
{{- with $.Values.prometheusOperator.namespaces }}
{{ $ns := .additional }}
{{- if .releaseNamespace }}
{{- $ns = append $ns $namespace }}
{{- end }}
- --namespaces={{ $ns | join "," }}
{{- end }}
- --logtostderr=true
- --localhost=127.0.0.1
{{- if .Values.prometheusOperator.prometheusConfigReloaderImage.sha }}
- --prometheus-config-reloader={{ .Values.prometheusOperator.prometheusConfigReloaderImage.repository }}:{{ .Values.prometheusOperator.prometheusConfigReloaderImage.tag }}@sha256:{{ .Values.prometheusOperator.prometheusConfigReloaderImage.sha }}
{{- else }}
- --prometheus-config-reloader={{ .Values.prometheusOperator.prometheusConfigReloaderImage.repository }}:{{ .Values.prometheusOperator.prometheusConfigReloaderImage.tag }}
{{- end }}
{{- if .Values.prometheusOperator.configmapReloadImage.sha }}
- --config-reloader-image={{ .Values.prometheusOperator.configmapReloadImage.repository }}:{{ .Values.prometheusOperator.configmapReloadImage.tag }}@sha256:{{ .Values.prometheusOperator.configmapReloadImage.sha }}
{{- else }}
- --config-reloader-image={{ .Values.prometheusOperator.configmapReloadImage.repository }}:{{ .Values.prometheusOperator.configmapReloadImage.tag }}
{{- end }}
- --config-reloader-cpu={{ .Values.prometheusOperator.configReloaderCpu }}
- --config-reloader-memory={{ .Values.prometheusOperator.configReloaderMemory }}
ports:
- containerPort: 8080
name: http
resources:
{{ toYaml .Values.prometheusOperator.resources | indent 12 }}
securityContext:
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
{{- if .Values.prometheusOperator.tlsProxy.enabled }}
- name: tls-proxy
{{- if .Values.prometheusOperator.tlsProxy.image.sha }}
image: {{ .Values.prometheusOperator.tlsProxy.image.repository }}:{{ .Values.prometheusOperator.tlsProxy.image.tag }}@sha256:{{ .Values.prometheusOperator.tlsProxy.image.sha }}
{{- else }}
image: {{ .Values.prometheusOperator.tlsProxy.image.repository }}:{{ .Values.prometheusOperator.tlsProxy.image.tag }}
{{- end }}
imagePullPolicy: {{ .Values.prometheusOperator.tlsProxy.image.pullPolicy }}
args:
- server
- --listen=:8443
- --target=127.0.0.1:8080
- --key=cert/key
- --cert=cert/cert
- --disable-authentication
resources:
{{ toYaml .Values.prometheusOperator.tlsProxy.resources | indent 12 }}
volumeMounts:
- name: tls-proxy-secret
mountPath: /cert
readOnly: true
ports:
- containerPort: 8443
name: https
securityContext:
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
{{- end }}
{{- if .Values.prometheusOperator.tlsProxy.enabled }}
volumes:
- name: tls-proxy-secret
secret:
defaultMode: 420
secretName: {{ template "prometheus-operator.fullname" . }}-admission
{{- end }}
{{- if .Values.prometheusOperator.securityContext }}
securityContext:
{{ toYaml .Values.prometheusOperator.securityContext | indent 8 }}
{{- end }}
serviceAccountName: {{ template "prometheus-operator.operator.serviceAccountName" . }}
{{- if .Values.prometheusOperator.hostNetwork }}
hostNetwork: true
dnsPolicy: ClusterFirstWithHostNet
{{- end }}
{{- with .Values.prometheusOperator.nodeSelector }}
nodeSelector:
{{ toYaml . | indent 8 }}
{{- end }}
{{- with .Values.prometheusOperator.affinity }}
affinity:
{{ toYaml . | indent 8 }}
{{- end }}
{{- with .Values.prometheusOperator.tolerations }}
tolerations:
{{ toYaml . | indent 8 }}
{{- end }}
{{- end }}