Skip to content

Commit

Permalink
make ClusterRole opt-in
Browse files Browse the repository at this point in the history
Signed-off-by: Willem Monsuwe <[email protected]>
  • Loading branch information
Willem Monsuwe committed Sep 2, 2024
1 parent 306bd65 commit 14cfec7
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
3 changes: 3 additions & 0 deletions tinkerbell/hegel/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ spec:
- args:
- --backend=kubernetes
- --http-addr=:{{ .Values.deployment.port }}
{{- if not .Values.allNamespaces }}
- --kubernetes-namespace={{ .Release.Namespace }}
{{- end }}
{{- range .Values.args }}
- {{ . }}
{{- end }}
Expand Down
3 changes: 2 additions & 1 deletion tinkerbell/hegel/templates/role.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{{- if .Values.deploy }}
{{- $roleKind := .Values.allNamespaces | ternary "ClusterRole" "Role" }}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
kind: {{ $roleKind }}
metadata:
name: {{ .Values.roleName }}
rules:
Expand Down
5 changes: 3 additions & 2 deletions tinkerbell/hegel/templates/rolebinding.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
{{- if .Values.deploy }}
{{- $roleKind := .Values.allNamespaces | ternary "ClusterRole" "Role" }}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
kind: {{ $roleKind }}Binding
metadata:
name: {{ .Values.roleBindingName }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
kind: {{ $roleKind }}
name: {{ .Values.roleName }}
subjects:
- kind: ServiceAccount
Expand Down
2 changes: 2 additions & 0 deletions tinkerbell/hegel/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,5 @@ trustedProxies: []
singleNodeClusterConfig:
controlPlaneTolerationsEnabled: false
nodeAffinityWeight: 1

allNamespaces: false

0 comments on commit 14cfec7

Please sign in to comment.