Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add atlas-operator chart flag for creating Role and RoleBinding #331

Merged
merged 2 commits into from
Jul 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions charts/atlas-operator/templates/roles.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{{- $operatorNamespaceManaged := has .Release.Namespace .Values.watchNamespaces -}}

{{- /* so far we support only a single namespace but otherwise should iterate over the watchNamespaces */}}
{{- if .Values.watchNamespaces }}
{{- if and (.Values.watchNamespaces) (.Values.crossNamespaceRoles) }}
{{- range $namespace := .Values.watchNamespaces }}
---
apiVersion: rbac.authorization.k8s.io/v1
Expand Down Expand Up @@ -36,7 +36,7 @@ subjects:
{{- end }}

{{- /* If operator namespace is not in the managed namespaces list, we need to give the same permissions to it in adition to above */}}
{{- if not $operatorNamespaceManaged }}
{{- if or (not $operatorNamespaceManaged) (not .Values.crossNamespaceRoles) }}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
Expand Down
5 changes: 5 additions & 0 deletions charts/atlas-operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ globalConnectionSecret:
publicApiKey: ""
privateApiKey: ""

# Determines whether RBAC resources should be created across namespaces.
# If set to true, RBAC resources will be created across all namespaces specified in watchNamespaces.
# If set to false, RBAC resources will be created only within the namespace of the release.
crossNamespaceRoles: true

# watchNamespaces is the set of namespaces that are watched by the Operator.
#
# The only possible values are:
Expand Down
Loading