54 lines
811 B
YAML
54 lines
811 B
YAML
apiVersion: v1
|
|
kind: ServiceAccount
|
|
metadata:
|
|
name: postgres-pod
|
|
namespace: default
|
|
|
|
---
|
|
apiVersion: rbac.authorization.k8s.io/v1
|
|
kind: ClusterRole
|
|
metadata:
|
|
name: postgres-pod
|
|
rules:
|
|
# Patroni needs to watch and manage endpoints
|
|
- apiGroups:
|
|
- ""
|
|
resources:
|
|
- endpoints
|
|
verbs:
|
|
- create
|
|
- delete
|
|
- deletecollection
|
|
- get
|
|
- list
|
|
- patch
|
|
- update
|
|
- watch
|
|
# Patroni needs to watch pods
|
|
- apiGroups:
|
|
- ""
|
|
resources:
|
|
- pods
|
|
verbs:
|
|
- get
|
|
- list
|
|
- patch
|
|
- update
|
|
- watch
|
|
# to let Patroni create a headless service
|
|
- apiGroups:
|
|
- ""
|
|
resources:
|
|
- services
|
|
verbs:
|
|
- create
|
|
# to grant privilege to run privileged pods (not needed by default)
|
|
#- apiGroups:
|
|
# - extensions
|
|
# resources:
|
|
# - podsecuritypolicies
|
|
# resourceNames:
|
|
# - privileged
|
|
# verbs:
|
|
# - use
|