veldtech / patroni-selfheal

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

patroni self heal

Checks patroni status and if state is "start failed" deletes the pod so it can recover on restart.

Needed as postgres-operator does no support liveness probe.

The sidecar needs the following additional rbac config (serviceaccount should already exist):

apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
  name: postgres-pod-delete
  namespace: your-namespace
subjects:
  - kind: ServiceAccount
    name: postgres-pod
roleRef:
  kind: Role
  name: postgres-pod-delete
  apiGroup: rbac.authorization.k8s.io
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
  name: postgres-pod-delete
  namespace: your-namespace
rules:
  - apiGroups: [""]
    resources: ["pods"]
    verbs: ["delete"]

About

License:GNU Affero General Public License v3.0


Languages

Language:Shell 89.0%Language:Dockerfile 11.0%