diff --git a/charts/atlas-operator/rbac.yaml b/charts/atlas-operator/rbac.yaml new file mode 100644 index 00000000..c39a3262 --- /dev/null +++ b/charts/atlas-operator/rbac.yaml @@ -0,0 +1,265 @@ +- apiGroups: + - "" + resources: + - events + verbs: + - create + - patch +- apiGroups: + - "" + resources: + - secrets + verbs: + - create + - delete + - get + - list + - patch + - update + - watch +- apiGroups: + - atlas.mongodb.com + resources: + - atlasdeployments + verbs: + - create + - delete + - get + - list + - patch + - update + - watch +- apiGroups: + - atlas.mongodb.com + resources: + - atlasdeployments/status + verbs: + - get + - patch + - update +- apiGroups: + - atlas.mongodb.com + resources: + - atlasdatabaseusers + verbs: + - create + - delete + - get + - list + - patch + - update + - watch +- apiGroups: + - atlas.mongodb.com + resources: + - atlasdatabaseusers/status + verbs: + - get + - patch + - update +- apiGroups: + - atlas.mongodb.com + resources: + - atlasprojects + verbs: + - create + - delete + - get + - list + - patch + - update + - watch +- apiGroups: + - atlas.mongodb.com + resources: + - atlasprojects/finalizers + verbs: + - get + - patch + - update +- apiGroups: + - atlas.mongodb.com + resources: + - atlasprojects/status + verbs: + - get + - patch + - update +- apiGroups: + - atlas.mongodb.com + resources: + - atlasbackuppolicies + verbs: + - create + - delete + - get + - list + - patch + - update + - watch +- apiGroups: + - atlas.mongodb.com + resources: + - atlasbackuppolicies/status + verbs: + - get + - patch + - update +- apiGroups: + - atlas.mongodb.com + resources: + - atlasbackupschedules + verbs: + - create + - delete + - get + - list + - patch + - update + - watch +- apiGroups: + - atlas.mongodb.com + resources: + - atlasbackupschedules/status + verbs: + - get + - patch + - update +- apiGroups: + - atlas.mongodb.com + resources: + - atlasteams + verbs: + - create + - delete + - get + - list + - patch + - update + - watch +- apiGroups: + - atlas.mongodb.com + resources: + - atlasteams/status + verbs: + - get + - patch + - update +- apiGroups: + - atlas.mongodb.com + resources: + - atlasdatafederations + verbs: + - create + - delete + - get + - list + - patch + - update + - watch +- apiGroups: + - atlas.mongodb.com + resources: + - atlasdatafederations/status + verbs: + - get + - patch + - update +- apiGroups: + - atlas.mongodb.com + resources: + - atlasfederatedauths + verbs: + - create + - delete + - get + - list + - patch + - update + - watch +- apiGroups: + - atlas.mongodb.com + resources: + - atlasfederatedauths/status + verbs: + - get +- apiGroups: + - atlas.mongodb.com + resources: + - atlasstreamconnections + verbs: + - create + - delete + - get + - list + - patch + - update + - watch +- apiGroups: + - atlas.mongodb.com + resources: + - atlasstreamconnections/status + verbs: + - get + - patch + - update +- apiGroups: + - atlas.mongodb.com + resources: + - atlasstreaminstances + verbs: + - create + - delete + - get + - list + - patch + - update + - watch +- apiGroups: + - atlas.mongodb.com + resources: + - atlasstreaminstances/status + verbs: + - get + - patch + - update +- apiGroups: + - atlas.mongodb.com + resources: + - atlassearchindexconfigs + verbs: + - create + - delete + - get + - list + - patch + - update + - watch +- apiGroups: + - atlas.mongodb.com + resources: + - atlassearchindexconfigs/status + verbs: + - get + - patch + - update +- apiGroups: + - atlas.mongodb.com + resources: + - atlasbackupcompliancepolicies + verbs: + - create + - delete + - get + - list + - patch + - update + - watch +- apiGroups: + - atlas.mongodb.com + resources: + - atlasbackupcompliancepolicies/status + verbs: + - get + - patch + - update \ No newline at end of file diff --git a/charts/atlas-operator/templates/_helpers.tpl b/charts/atlas-operator/templates/_helpers.tpl index 32c3db58..a1ab7a73 100644 --- a/charts/atlas-operator/templates/_helpers.tpl +++ b/charts/atlas-operator/templates/_helpers.tpl @@ -63,274 +63,3 @@ Create the name of the service account to use {{- default "default" .Values.serviceAccount.name }} {{- end }} {{- end }} - -{{/* -RBAC permissions -*/}} -{{- define "mongodb-atlas-operator.rbacRules" -}} -- apiGroups: - - "" - resources: - - events - verbs: - - create - - patch -- apiGroups: - - "" - resources: - - secrets - verbs: - - create - - delete - - get - - list - - patch - - update - - watch -- apiGroups: - - atlas.mongodb.com - resources: - - atlasdeployments - verbs: - - create - - delete - - get - - list - - patch - - update - - watch -- apiGroups: - - atlas.mongodb.com - resources: - - atlasdeployments/status - verbs: - - get - - patch - - update -- apiGroups: - - atlas.mongodb.com - resources: - - atlasdatabaseusers - verbs: - - create - - delete - - get - - list - - patch - - update - - watch -- apiGroups: - - atlas.mongodb.com - resources: - - atlasdatabaseusers/status - verbs: - - get - - patch - - update -- apiGroups: - - atlas.mongodb.com - resources: - - atlasprojects - verbs: - - create - - delete - - get - - list - - patch - - update - - watch -- apiGroups: - - atlas.mongodb.com - resources: - - atlasprojects/finalizers - verbs: - - get - - patch - - update -- apiGroups: - - atlas.mongodb.com - resources: - - atlasprojects/status - verbs: - - get - - patch - - update -- apiGroups: - - atlas.mongodb.com - resources: - - atlasbackuppolicies - verbs: - - create - - delete - - get - - list - - patch - - update - - watch -- apiGroups: - - atlas.mongodb.com - resources: - - atlasbackuppolicies/status - verbs: - - get - - patch - - update -- apiGroups: - - atlas.mongodb.com - resources: - - atlasbackupschedules - verbs: - - create - - delete - - get - - list - - patch - - update - - watch -- apiGroups: - - atlas.mongodb.com - resources: - - atlasbackupschedules/status - verbs: - - get - - patch - - update -- apiGroups: - - atlas.mongodb.com - resources: - - atlasteams - verbs: - - create - - delete - - get - - list - - patch - - update - - watch -- apiGroups: - - atlas.mongodb.com - resources: - - atlasteams/status - verbs: - - get - - patch - - update -- apiGroups: - - atlas.mongodb.com - resources: - - atlasdatafederations - verbs: - - create - - delete - - get - - list - - patch - - update - - watch -- apiGroups: - - atlas.mongodb.com - resources: - - atlasdatafederations/status - verbs: - - get - - patch - - update -- apiGroups: - - atlas.mongodb.com - resources: - - atlasfederatedauths - verbs: - - create - - delete - - get - - list - - patch - - update - - watch -- apiGroups: - - atlas.mongodb.com - resources: - - atlasfederatedauths/status - verbs: - - get -- apiGroups: - - atlas.mongodb.com - resources: - - atlasstreamconnections - verbs: - - create - - delete - - get - - list - - patch - - update - - watch -- apiGroups: - - atlas.mongodb.com - resources: - - atlasstreamconnections/status - verbs: - - get - - patch - - update -- apiGroups: - - atlas.mongodb.com - resources: - - atlasstreaminstances - verbs: - - create - - delete - - get - - list - - patch - - update - - watch -- apiGroups: - - atlas.mongodb.com - resources: - - atlasstreaminstances/status - verbs: - - get - - patch - - update -- apiGroups: - - atlas.mongodb.com - resources: - - atlassearchindexconfigs - verbs: - - create - - delete - - get - - list - - patch - - update - - watch -- apiGroups: - - atlas.mongodb.com - resources: - - atlassearchindexconfigs/status - verbs: - - get - - patch - - update -- apiGroups: - - atlas.mongodb.com - resources: - - atlasbackupcompliancepolicies - verbs: - - create - - delete - - get - - list - - patch - - update - - watch -- apiGroups: - - atlas.mongodb.com - resources: - - atlasbackupcompliancepolicies/status - verbs: - - get - - patch - - update -{{- end -}} diff --git a/charts/atlas-operator/templates/cluster-roles.yaml b/charts/atlas-operator/templates/cluster-roles.yaml index 535ddfa0..c74ba035 100644 --- a/charts/atlas-operator/templates/cluster-roles.yaml +++ b/charts/atlas-operator/templates/cluster-roles.yaml @@ -9,7 +9,9 @@ metadata: labels: {{- include "mongodb-atlas-operator.labels" $ | nindent 4 }} rules: -{{ template "mongodb-atlas-operator.rbacRules" $ | toYaml | indent 2 }} +{{- range (.Files.Lines "rbac.yaml") }} + {{ . -}} +{{- end }} --- apiVersion: rbac.authorization.k8s.io/v1 diff --git a/charts/atlas-operator/templates/roles.yaml b/charts/atlas-operator/templates/roles.yaml index 87224171..954f42a2 100644 --- a/charts/atlas-operator/templates/roles.yaml +++ b/charts/atlas-operator/templates/roles.yaml @@ -14,7 +14,9 @@ metadata: labels: {{- include "mongodb-atlas-operator.labels" $ | nindent 4 }} rules: -{{ template "mongodb-atlas-operator.rbacRules" $ | toYaml | indent 2 }} +{{- range (.Files.Lines "rbac.yaml") }} + {{ . -}} +{{- end }} --- apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding @@ -45,7 +47,9 @@ metadata: labels: {{- include "mongodb-atlas-operator.labels" $ | nindent 4 }} rules: -{{ template "mongodb-atlas-operator.rbacRules" $ | toYaml | indent 2 }} +{{- range (.Files.Lines "rbac.yaml") }} + {{ . -}} +{{- end }} --- apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding