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.
3131{ { default (include " postgres-operator.fullname" .) .Values.serviceAccount.name } }
3232{ {- end -} }
3333
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+
3448{ {/*
3549Create chart name and version as used by the chart label.
3650*/} }
Original file line number Diff line number Diff line change 22apiVersion : rbac.authorization.k8s.io/v1
33kind : ClusterRole
44metadata :
5- name : postgres-pod
5+ name : {{ include " postgres-pod.serviceAccountName" . }}
66 labels :
77 app.kubernetes.io/name : {{ template "postgres-operator.name" . }}
88 helm.sh/chart : {{ template "postgres-operator.chart" . }}
Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ metadata:
99 app.kubernetes.io/managed-by : {{ .Release.Service }}
1010 app.kubernetes.io/instance : {{ .Release.Name }}
1111data :
12+ pod_service_account_name : {{ include "postgres-pod.serviceAccountName" . }}
1213{{ toYaml .Values.configGeneral | indent 2 }}
1314{{ toYaml .Values.configUsers | indent 2 }}
1415{{ toYaml .Values.configKubernetes | indent 2 }}
Original file line number Diff line number Diff line change 4343 {{- else }}
4444 - name : POSTGRES_OPERATOR_CONFIGURATION_OBJECT
4545 value : {{ template "postgres-operator.fullname" . }}
46+ {{- end }}
47+ {{- if .Values.controllerID.create }}
48+ - name : CONTROLLER_ID
49+ value : {{ template "postgres-operator.controllerID" . }}
4650 {{- end }}
4751 resources :
4852{{ toYaml .Values.resources | indent 10 }}
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ configuration:
1313 users :
1414{{ toYaml .Values.configUsers | indent 4 }}
1515 kubernetes :
16+ pod_service_account_name : {{ include "postgres-pod.serviceAccountName" . }}
1617 oauth_token_secret_name : {{ template "postgres-operator.fullname" . }}
1718{{ toYaml .Values.configKubernetes | indent 4 }}
1819 postgres_pod_resources :
Original file line number Diff line number Diff line change @@ -103,8 +103,6 @@ configKubernetes:
103103 # service account definition as JSON/YAML string to be used by postgres cluster pods
104104 # pod_service_account_definition: ""
105105
106- # name of service account to be used by postgres cluster pods
107- pod_service_account_name : " postgres-pod"
108106 # role binding definition as JSON/YAML string to be used by pod service account
109107 # pod_service_account_role_binding_definition: ""
110108
@@ -284,6 +282,11 @@ serviceAccount:
284282 # If not set and create is true, a name is generated using the fullname template
285283 name :
286284
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+
287290priorityClassName : " "
288291
289292resources :
@@ -305,3 +308,12 @@ tolerations: []
305308# Node labels for pod assignment
306309# Ref: https://kubernetes.io/docs/user-guide/node-selection/
307310nodeSelector : {}
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:
9696 # service account definition as JSON/YAML string to be used by postgres cluster pods
9797 # pod_service_account_definition: ""
9898
99- # name of service account to be used by postgres cluster pods
100- pod_service_account_name : " postgres-pod"
10199 # role binding definition as JSON/YAML string to be used by pod service account
102100 # pod_service_account_role_binding_definition: ""
103101
@@ -260,6 +258,11 @@ serviceAccount:
260258 # If not set and create is true, a name is generated using the fullname template
261259 name :
262260
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+
263266priorityClassName : " "
264267
265268resources :
@@ -281,3 +284,12 @@ tolerations: []
281284# Node labels for pod assignment
282285# Ref: https://kubernetes.io/docs/user-guide/node-selection/
283286nodeSelector : {}
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