This repository has been archived by the owner on Feb 22, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 16.8k
/
job-createSecret.yaml
65 lines (65 loc) · 3.03 KB
/
job-createSecret.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
{{- if and .Values.prometheusOperator.admissionWebhooks.enabled .Values.prometheusOperator.admissionWebhooks.patch.enabled }}
apiVersion: batch/v1
kind: Job
metadata:
name: {{ template "prometheus-operator.fullname" . }}-admission-create
namespace: {{ template "prometheus-operator.namespace" . }}
annotations:
"helm.sh/hook": pre-install,pre-upgrade
"helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded
labels:
app: {{ template "prometheus-operator.name" $ }}-admission-create
{{- include "prometheus-operator.labels" $ | indent 4 }}
spec:
{{- if .Capabilities.APIVersions.Has "batch/v1alpha1" }}
# Alpha feature since k8s 1.12
ttlSecondsAfterFinished: 0
{{- end }}
template:
metadata:
name: {{ template "prometheus-operator.fullname" . }}-admission-create
{{- with .Values.prometheusOperator.admissionWebhooks.patch.podAnnotations }}
annotations:
{{ toYaml . | indent 8 }}
{{- end }}
labels:
app: {{ template "prometheus-operator.name" $ }}-admission-create
{{- include "prometheus-operator.labels" $ | indent 8 }}
spec:
{{- if .Values.prometheusOperator.admissionWebhooks.patch.priorityClassName }}
priorityClassName: {{ .Values.prometheusOperator.admissionWebhooks.patch.priorityClassName }}
{{- end }}
containers:
- name: create
{{- if .Values.prometheusOperator.admissionWebhooks.patch.image.sha }}
image: {{ .Values.prometheusOperator.admissionWebhooks.patch.image.repository }}:{{ .Values.prometheusOperator.admissionWebhooks.patch.image.tag }}@sha256:{{ .Values.prometheusOperator.admissionWebhooks.patch.image.sha }}
{{- else }}
image: {{ .Values.prometheusOperator.admissionWebhooks.patch.image.repository }}:{{ .Values.prometheusOperator.admissionWebhooks.patch.image.tag }}
{{- end }}
imagePullPolicy: {{ .Values.prometheusOperator.admissionWebhooks.patch.image.pullPolicy }}
args:
- create
- --host={{ template "prometheus-operator.operator.fullname" . }},{{ template "prometheus-operator.operator.fullname" . }}.{{ template "prometheus-operator.namespace" . }}.svc
- --namespace={{ template "prometheus-operator.namespace" . }}
- --secret-name={{ template "prometheus-operator.fullname" . }}-admission
resources:
{{ toYaml .Values.prometheusOperator.admissionWebhooks.patch.resources | indent 12 }}
restartPolicy: OnFailure
serviceAccountName: {{ template "prometheus-operator.fullname" . }}-admission
{{- with .Values.prometheusOperator.admissionWebhooks.patch.nodeSelector }}
nodeSelector:
{{ toYaml . | indent 8 }}
{{- end }}
{{- with .Values.prometheusOperator.admissionWebhooks.patch.affinity }}
affinity:
{{ toYaml . | indent 8 }}
{{- end }}
{{- with .Values.prometheusOperator.admissionWebhooks.patch.tolerations }}
tolerations:
{{ toYaml . | indent 8 }}
{{- end }}
securityContext:
runAsGroup: 2000
runAsNonRoot: true
runAsUser: 2000
{{- end }}