Skip to content

Commit 68bdf9d

Browse files
authored
[helm] Add volume management, custom labels, environment variables and custom existing secret (#108)
1 parent 576ce50 commit 68bdf9d

File tree

4 files changed

+47
-1
lines changed

4 files changed

+47
-1
lines changed

charts/ext-postgres-operator/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ type: application
77
# This is the chart version. This version number should be incremented each time you make changes
88
# to the chart and its templates, including the app version.
99
# Versions are expected to follow Semantic Versioning (https://semver.org/)
10-
version: 1.2.1
10+
version: 1.2.2
1111

1212
# This is the version number of the application being deployed. This version number should be
1313
# incremented each time you make changes to the application. Versions are not expected to

charts/ext-postgres-operator/templates/operator.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ spec:
1818
{{- end }}
1919
labels:
2020
{{- include "chart.selectorLabels" . | nindent 8 }}
21+
{{- with .Values.podLabels }}
22+
{{- toYaml . | nindent 8 }}
23+
{{- end }}
2124
spec:
2225
serviceAccountName: {{ include "chart.serviceAccountName" . }}
2326
securityContext:
@@ -32,7 +35,11 @@ spec:
3235
imagePullPolicy: {{ .Values.image.pullPolicy }}
3336
envFrom:
3437
- secretRef:
38+
{{- if .Values.existingSecret }}
39+
name: {{ .Values.existingSecret }}
40+
{{- else }}
3541
name: {{ include "chart.fullname" . }}
42+
{{- end }}
3643
env:
3744
- name: WATCH_NAMESPACE
3845
value: {{ .Values.watchNamespace | default "" }}
@@ -42,3 +49,19 @@ spec:
4249
fieldPath: metadata.name
4350
- name: OPERATOR_NAME
4451
value: {{ include "chart.fullname" . }}
52+
{{- range $key, $value := .Values.env }}
53+
- name: {{ $key }}
54+
value: {{ $value }}
55+
{{- end }}
56+
{{- if .Values.volumeMounts }}
57+
volumeMounts:
58+
{{- toYaml .Values.volumeMounts | nindent 12 }}
59+
{{- end }}
60+
{{- if .Values.volumes }}
61+
volumes:
62+
{{- toYaml .Values.volumes | nindent 8 }}
63+
{{- end }}
64+
nodeSelector:
65+
{{- toYaml .Values.nodeSelector | nindent 8 }}
66+
tolerations:
67+
{{- toYaml .Values.tolerations | nindent 8 }}

charts/ext-postgres-operator/templates/secret.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
{{- if (not .Values.existingSecret) }}
2+
---
13
apiVersion: v1
24
kind: Secret
35
metadata:
@@ -15,3 +17,4 @@ data:
1517
POSTGRES_URI_ARGS: {{ .Values.postgres.uri_args | b64enc | quote }}
1618
POSTGRES_CLOUD_PROVIDER: {{ .Values.postgres.cloud_provider | b64enc | quote }}
1719
POSTGRES_DEFAULT_DATABASE: {{ .Values.postgres.default_database | b64enc | quote }}
20+
{{- end }}

charts/ext-postgres-operator/values.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ serviceAccount:
2424

2525
podAnnotations: {}
2626

27+
# Additionnal labels to add to the pod.
28+
podLabels: {}
29+
2730
podSecurityContext: {}
2831
# fsGroup: 2000
2932

@@ -55,3 +58,20 @@ postgres:
5558
cloud_provider: ""
5659
# default database to use
5760
default_database: "postgres"
61+
62+
# Volumes to add to the pod.
63+
volumes: []
64+
65+
# Volumes to mount onto the pod.
66+
volumeMounts: []
67+
68+
# Existing secret where values to connect to Postgres are defined.
69+
# If not set a new secret will be created, filled with information under the postgres key above.
70+
existingSecret: ""
71+
72+
# Additionnal environment variables to add to the pod (map of key / value)
73+
env: {}
74+
75+
nodeSelector: {}
76+
77+
tolerations: []

0 commit comments

Comments
 (0)