helm-chart: allow configmaps instead of endpoints for leader elections… (#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>
This commit is contained in:
Enno Boland 2020-12-16 10:44:25 +01:00 committed by GitHub
parent fbd04896c2
commit 4b90809ade
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 27 additions and 1 deletions

View File

@ -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:
@ -23,6 +44,7 @@ rules:
- patch
- update
- watch
{{- end }}
# Patroni needs to watch pods
- apiGroups:
- ""

View File

@ -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