Skip to content

Commit

Permalink
helm-chart: allow configmaps instead of endpoints for leader election…
Browse files Browse the repository at this point in the history
…s… (#1037)

* helm-chart: allow configmaps instead of endpoints if leader elections uses the configmaps method

* helm-chart: allow endpoints get even if config maps are used

* helm-chart: allow configmaps instead of endpoints on the operator role too.

Co-authored-by: Enno Boland <mail@eboland.de>
  • Loading branch information
Gottox and Enno Boland authored Dec 16, 2020
1 parent fbd0489 commit 4b90809
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
22 changes: 22 additions & 0 deletions charts/postgres-operator/templates/clusterrole-postgres-pod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,27 @@ metadata:
app.kubernetes.io/instance: {{ .Release.Name }}
rules:
# Patroni needs to watch and manage endpoints
{{- if toString .Values.configGeneral.kubernetes_use_configmaps | eq "true" }}
- apiGroups:
- ""
resources:
- configmaps
verbs:
- create
- delete
- deletecollection
- get
- list
- patch
- update
- watch
- apiGroups:
- ""
resources:
- endpoints
verbs:
- get
{{- else }}
- apiGroups:
- ""
resources:
Expand All @@ -23,6 +44,7 @@ rules:
- patch
- update
- watch
{{- end }}
# Patroni needs to watch pods
- apiGroups:
- ""
Expand Down
6 changes: 5 additions & 1 deletion charts/postgres-operator/templates/clusterrole.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,15 @@ rules:
- patch
- update
- watch
# to manage endpoints which are also used by Patroni
# to manage endpoints/configmaps which are also used by Patroni
- apiGroups:
- ""
resources:
{{- if toString .Values.configGeneral.kubernetes_use_configmaps | eq "true" }}
- configmaps
{{- else }}
- endpoints
{{- end }}
verbs:
- create
- delete
Expand Down

0 comments on commit 4b90809

Please sign in to comment.