kind: ServiceAccount
apiVersion: v1
metadata:
  name: replica-operator
---
kind: Role
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  name: replica-operator
rules:
  - apiGroups: ["apps"]
    resources: ["statefulsets"]
    verbs: ["get","list","watch","create","update","patch","delete"]
  - apiGroups: ["apps"]
    resources: ["statefulsets/scale"]
    verbs: ["get","list","watch","create","update","patch"]
  - apiGroups: [""]
    resources: ["pods"]
    verbs: ["get", "list", "exec"]
---
kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  name: replica-operator
roleRef:
  apiGroup: ""
  name: replica-operator
  kind: Role
subjects:
  - apiGroup: ""
    kind: ServiceAccount
    name: replica-operator