File tree Expand file tree Collapse file tree 7 files changed +49
-5
lines changed Expand file tree Collapse file tree 7 files changed +49
-5
lines changed Original file line number Diff line number Diff line change @@ -31,6 +31,20 @@ Create a service account name.
31
31
{ { default (include " postgres-operator.fullname" .) .Values.serviceAccount.name } }
32
32
{ {- end -} }
33
33
34
+ { {/*
35
+ Create a pod service account name.
36
+ */} }
37
+ { {- define " postgres-pod.serviceAccountName" -} }
38
+ { { default (printf " %s-%v" (include " postgres-operator.fullname" .) " pod" ) .Values.podServiceAccount.name } }
39
+ { {- end -} }
40
+
41
+ { {/*
42
+ Create a controller ID.
43
+ */} }
44
+ { {- define " postgres-operator.controllerID" -} }
45
+ { { default (include " postgres-operator.fullname" .) .Values.controllerID.name } }
46
+ { {- end -} }
47
+
34
48
{ {/*
35
49
Create chart name and version as used by the chart label.
36
50
*/} }
Original file line number Diff line number Diff line change 2
2
apiVersion : rbac.authorization.k8s.io/v1
3
3
kind : ClusterRole
4
4
metadata :
5
- name : postgres-pod
5
+ name : {{ include " postgres-pod.serviceAccountName" . }}
6
6
labels :
7
7
app.kubernetes.io/name : {{ template "postgres-operator.name" . }}
8
8
helm.sh/chart : {{ template "postgres-operator.chart" . }}
Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ metadata:
9
9
app.kubernetes.io/managed-by : {{ .Release.Service }}
10
10
app.kubernetes.io/instance : {{ .Release.Name }}
11
11
data :
12
+ pod_service_account_name : {{ include "postgres-pod.serviceAccountName" . }}
12
13
{{ toYaml .Values.configGeneral | indent 2 }}
13
14
{{ toYaml .Values.configUsers | indent 2 }}
14
15
{{ toYaml .Values.configKubernetes | indent 2 }}
Original file line number Diff line number Diff line change 43
43
{{- else }}
44
44
- name : POSTGRES_OPERATOR_CONFIGURATION_OBJECT
45
45
value : {{ template "postgres-operator.fullname" . }}
46
+ {{- end }}
47
+ {{- if .Values.controllerID.create }}
48
+ - name : CONTROLLER_ID
49
+ value : {{ template "postgres-operator.controllerID" . }}
46
50
{{- end }}
47
51
resources :
48
52
{{ toYaml .Values.resources | indent 10 }}
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ configuration:
13
13
users :
14
14
{{ toYaml .Values.configUsers | indent 4 }}
15
15
kubernetes :
16
+ pod_service_account_name : {{ include "postgres-pod.serviceAccountName" . }}
16
17
oauth_token_secret_name : {{ template "postgres-operator.fullname" . }}
17
18
{{ toYaml .Values.configKubernetes | indent 4 }}
18
19
postgres_pod_resources :
Original file line number Diff line number Diff line change @@ -103,8 +103,6 @@ configKubernetes:
103
103
# service account definition as JSON/YAML string to be used by postgres cluster pods
104
104
# pod_service_account_definition: ""
105
105
106
- # name of service account to be used by postgres cluster pods
107
- pod_service_account_name : " postgres-pod"
108
106
# role binding definition as JSON/YAML string to be used by pod service account
109
107
# pod_service_account_role_binding_definition: ""
110
108
@@ -284,6 +282,11 @@ serviceAccount:
284
282
# If not set and create is true, a name is generated using the fullname template
285
283
name :
286
284
285
+ podServiceAccount :
286
+ # The name of the ServiceAccount to be used by postgres cluster pods
287
+ # If not set a name is generated using the fullname template and "-pod" suffix
288
+ name : " postgres-pod"
289
+
287
290
priorityClassName : " "
288
291
289
292
resources :
@@ -305,3 +308,12 @@ tolerations: []
305
308
# Node labels for pod assignment
306
309
# Ref: https://kubernetes.io/docs/user-guide/node-selection/
307
310
nodeSelector : {}
311
+
312
+ controllerID :
313
+ # Specifies whether a controller ID should be defined for the operator
314
+ # Note, all postgres manifest must then contain the following annotation to be found by this operator
315
+ # "acid.zalan.do/controller": <controller-ID-of-the-operator>
316
+ create : false
317
+ # The name of the controller ID to use.
318
+ # If not set and create is true, a name is generated using the fullname template
319
+ name :
Original file line number Diff line number Diff line change @@ -96,8 +96,6 @@ configKubernetes:
96
96
# service account definition as JSON/YAML string to be used by postgres cluster pods
97
97
# pod_service_account_definition: ""
98
98
99
- # name of service account to be used by postgres cluster pods
100
- pod_service_account_name : " postgres-pod"
101
99
# role binding definition as JSON/YAML string to be used by pod service account
102
100
# pod_service_account_role_binding_definition: ""
103
101
@@ -260,6 +258,11 @@ serviceAccount:
260
258
# If not set and create is true, a name is generated using the fullname template
261
259
name :
262
260
261
+ podServiceAccount :
262
+ # The name of the ServiceAccount to be used by postgres cluster pods
263
+ # If not set a name is generated using the fullname template and "-pod" suffix
264
+ name : " postgres-pod"
265
+
263
266
priorityClassName : " "
264
267
265
268
resources :
@@ -281,3 +284,12 @@ tolerations: []
281
284
# Node labels for pod assignment
282
285
# Ref: https://kubernetes.io/docs/user-guide/node-selection/
283
286
nodeSelector : {}
287
+
288
+ controllerID :
289
+ # Specifies whether a controller ID should be defined for the operator
290
+ # Note, all postgres manifest must then contain the following annotation to be found by this operator
291
+ # "acid.zalan.do/controller": <controller-ID-of-the-operator>
292
+ create : false
293
+ # The name of the controller ID to use.
294
+ # If not set and create is true, a name is generated using the fullname template
295
+ name :
You can’t perform that action at this time.
0 commit comments