Skip to content

Commit

Permalink
feat(chart): option to not create clusterRoles; (datainfrahq#172)
Browse files Browse the repository at this point in the history
Co-authored-by: Marius Kimmina <[email protected]>
  • Loading branch information
2 people authored and ahmed.g committed Dec 10, 2024
1 parent aa879ec commit d6ddc80
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 1 deletion.
4 changes: 4 additions & 0 deletions chart/templates/rbac_manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ rules:
{{- end }}

---
{{- if .Values.global.createClusterRole }}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
Expand Down Expand Up @@ -357,6 +358,7 @@ rules:
- get
- list
- watch
{{- end }}

{{- $operatorName := (include "druid-operator.fullname" .) -}}
{{- if and ($env.WATCH_NAMESPACE) (ne $env.WATCH_NAMESPACE "default") }}
Expand All @@ -382,6 +384,7 @@ roleRef:
{{- end }}
{{- end }}
---
{{- if .Values.global.createClusterRole }}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
Expand All @@ -399,3 +402,4 @@ subjects:
- kind: ServiceAccount
name: {{ include "druid-operator.fullname" . }}
namespace: {{ .Release.Namespace }}
{{- end }}
2 changes: 2 additions & 0 deletions chart/templates/rbac_metrics.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
{{- if .Values.global.createClusterRole }}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
Expand All @@ -13,3 +14,4 @@ rules:
- /metrics
verbs:
- get
{{- end }}
2 changes: 2 additions & 0 deletions chart/templates/rbac_proxy.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
{{- if .Values.global.createClusterRole }}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
Expand Down Expand Up @@ -39,3 +40,4 @@ subjects:
- kind: ServiceAccount
name: {{ include "druid-operator.fullname" . }}
namespace: {{ .Release.Namespace }}
{{- end }}
4 changes: 3 additions & 1 deletion chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.

global:
createClusterRole: true

env:
DENY_LIST: "default,kube-system" # Comma-separated list of namespaces to ignore
RECONCILE_WAIT: "10s" # Reconciliation delay
Expand All @@ -22,7 +25,6 @@ kube_rbac_proxy:
pullPolicy: IfNotPresent
tag: "v0.13.1"


imagePullSecrets: []
nameOverride: ""
fullnameOverride: ""
Expand Down

0 comments on commit d6ddc80

Please sign in to comment.