-
-
Notifications
You must be signed in to change notification settings - Fork 63
/
Copy pathoperator.yaml
77 lines (77 loc) · 2.72 KB
/
operator.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
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "chart.fullname" . }}
labels:
{{- include "chart.labels" . | nindent 4 }}
namespace: {{ .Release.Namespace }}
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
{{- include "chart.selectorLabels" . | nindent 6 }}
template:
metadata:
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "chart.selectorLabels" . | nindent 8 }}
{{- with .Values.podLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
serviceAccountName: {{ include "chart.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:
- name: {{ .Chart.Name }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
command:
- postgres-operator
imagePullPolicy: {{ .Values.image.pullPolicy }}
envFrom:
- secretRef:
{{- if .Values.existingSecret }}
name: {{ .Values.existingSecret }}
{{- else }}
name: {{ include "chart.fullname" . }}
{{- end }}
env:
- name: WATCH_NAMESPACE
value: {{ .Values.watchNamespace | default "" }}
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: POSTGRES_USER
valueFrom:
secretKeyRef:
name: {{ .Values.postgresCredsExistingSecrets.username.secretName }}
key: {{ .Values.postgresCredsExistingSecrets.username.secretKey }}
- name: POSTGRES_PASS
valueFrom:
secretKeyRef:
name: {{ .Values.postgresCredsExistingSecrets.password.secretName }}
key: {{ .Values.postgresCredsExistingSecrets.password.secretKey }}
- name: OPERATOR_NAME
value: {{ include "chart.fullname" . }}
{{- range $key, $value := .Values.env }}
- name: {{ $key }}
value: {{ $value }}
{{- end }}
{{- if .Values.volumeMounts }}
volumeMounts:
{{- toYaml .Values.volumeMounts | nindent 12 }}
{{- end }}
{{- if .Values.volumes }}
volumes:
{{- toYaml .Values.volumes | nindent 8 }}
{{- end }}
nodeSelector:
{{- toYaml .Values.nodeSelector | nindent 8 }}
tolerations:
{{- toYaml .Values.tolerations | nindent 8 }}