{{- if and .Values.deploy.restapi }} apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: labels: api.stackgres.io/auth: user name: stackgres-restapi-admin rules: - apiGroups: ["", "batch"] resources: - pods/exec - configmaps - secrets - jobs verbs: - create - apiGroups: [""] resources: - pods/exec verbs: - get - apiGroups: ["", "batch"] resources: - configmaps - secrets - jobs verbs: - delete - apiGroups: [""] resources: - configmaps - secrets verbs: - patch - update - apiGroups: ["", "batch", "storage.k8s.io"] resources: - namespaces - storageclasses - pods - services - configmaps - secrets - persistentvolumes - persistentvolumeclaims - events - jobs verbs: - get - list - watch - apiGroups: ["stackgres.io"] resources: - sgclusters - sgpgconfigs - sginstanceprofiles - sgpoolconfigs - sgbackupconfigs - sgbackups - sgdistributedlogs - sgdbops - sgobjectstorages - sgscripts - sgshardedclusters verbs: - create - watch - list - get - update - patch - delete - apiGroups: ["stackgres.io"] resources: - sgconfigs verbs: - watch - list - get - update - patch - apiGroups: ["apiextensions.k8s.io"] resources: - customresourcedefinitions resourceNames: - sgconfigs.stackgres.io - sgclusters.stackgres.io - sginstanceprofiles.stackgres.io - sgpgconfigs.stackgres.io - sgpoolconfigs.stackgres.io - sgbackups.stackgres.io - sgbackupconfigs.stackgres.io - sgobjectstorages.stackgres.io - sgdbops.stackgres.io - sgdistributedlogs.stackgres.io - sgshardedclusters.stackgres.io - sgscripts.stackgres.io verbs: - get - apiGroups: ["apiextensions.k8s.io"] resources: - customresourcedefinitions verbs: - list - apiGroups: ["rbac.authorization.k8s.io"] resources: - roles - rolebindings - clusterroles - clusterrolebindings verbs: - get - list - watch - create - update - patch - delete {{- end }}