Remove bind verb and explain privileges

Closes #256
This commit is contained in:
Felix Kunde 2019-12-16 14:41:35 +01:00 committed by GitHub
parent 97e0d6d388
commit 1d3decb149
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 19 additions and 9 deletions

View File

@ -10,6 +10,7 @@ kind: ClusterRole
metadata: metadata:
name: zalando-postgres-operator name: zalando-postgres-operator
rules: rules:
# all verbs allowed for custom operator resources
- apiGroups: - apiGroups:
- acid.zalan.do - acid.zalan.do
resources: resources:
@ -18,6 +19,7 @@ rules:
- operatorconfigurations - operatorconfigurations
verbs: verbs:
- "*" - "*"
# to create or get/update CRDs when starting up
- apiGroups: - apiGroups:
- apiextensions.k8s.io - apiextensions.k8s.io
resources: resources:
@ -27,12 +29,14 @@ rules:
- get - get
- patch - patch
- update - update
# to read configuration from ConfigMaps
- apiGroups: - apiGroups:
- "" - ""
resources: resources:
- configmaps - configmaps
verbs: verbs:
- get - get
# to manage endpoints which are also used by Patroni
- apiGroups: - apiGroups:
- "" - ""
resources: resources:
@ -45,6 +49,7 @@ rules:
- list - list
- patch - patch
- watch # needed if zalando-postgres-operator account is used for pods as well - watch # needed if zalando-postgres-operator account is used for pods as well
# to CRUD secrets for database access
- apiGroups: - apiGroups:
- "" - ""
resources: resources:
@ -54,6 +59,7 @@ rules:
- update - update
- delete - delete
- get - get
# to check nodes for node readiness label
- apiGroups: - apiGroups:
- "" - ""
resources: resources:
@ -62,6 +68,7 @@ rules:
- get - get
- list - list
- watch - watch
# to read or delete existing PVCs. Creation via StatefulSet
- apiGroups: - apiGroups:
- "" - ""
resources: resources:
@ -70,6 +77,7 @@ rules:
- delete - delete
- get - get
- list - list
# to read existing PVs. Creation should be done via dynamic provisioning
- apiGroups: - apiGroups:
- "" - ""
resources: resources:
@ -78,6 +86,7 @@ rules:
- get - get
- list - list
- update # only for resizing AWS volumes - update # only for resizing AWS volumes
# to watch Spilo pods and do rolling updates. Creation via StatefulSet
- apiGroups: - apiGroups:
- "" - ""
resources: resources:
@ -88,12 +97,14 @@ rules:
- list - list
- watch - watch
- patch - patch
# to resize the filesystem in Spilo pods when increasing volume size
- apiGroups: - apiGroups:
- "" - ""
resources: resources:
- pods/exec - pods/exec
verbs: verbs:
- create - create
# to CRUD services to point to Postgres cluster instances
- apiGroups: - apiGroups:
- "" - ""
resources: resources:
@ -103,6 +114,7 @@ rules:
- delete - delete
- get - get
- patch - patch
# to CRUD the StatefulSet which controls the Postgres cluster instances
- apiGroups: - apiGroups:
- apps - apps
resources: resources:
@ -113,12 +125,14 @@ rules:
- get - get
- list - list
- patch - patch
# to get namespaces operator resources can run in
- apiGroups: - apiGroups:
- "" - ""
resources: resources:
- namespaces - namespaces
verbs: verbs:
- get - get
# to define PDBs. Update happens via delete/create
- apiGroups: - apiGroups:
- policy - policy
resources: resources:
@ -127,6 +141,7 @@ rules:
- create - create
- delete - delete
- get - get
# to create ServiceAccounts in each namespace the operator watches
- apiGroups: - apiGroups:
- "" - ""
resources: resources:
@ -134,6 +149,7 @@ rules:
verbs: verbs:
- get - get
- create - create
# to create role bindings to the operator service account
- apiGroups: - apiGroups:
- "rbac.authorization.k8s.io" - "rbac.authorization.k8s.io"
resources: resources:
@ -141,18 +157,11 @@ rules:
verbs: verbs:
- get - get
- create - create
- apiGroups: # to CRUD cron jobs for logical backups
- "rbac.authorization.k8s.io"
resources:
- clusterroles
verbs:
- bind
resourceNames:
- zalando-postgres-operator
- apiGroups: - apiGroups:
- batch - batch
resources: resources:
- cronjobs # enables logical backups - cronjobs
verbs: verbs:
- create - create
- delete - delete
@ -160,6 +169,7 @@ rules:
- list - list
- patch - patch
- update - update
--- ---
apiVersion: rbac.authorization.k8s.io/v1 apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding kind: ClusterRoleBinding