Skip to content

Commit

Permalink
expose admin clusterrole
Browse files Browse the repository at this point in the history
  • Loading branch information
padraigmc committed Nov 12, 2024
1 parent 087bd10 commit c062b0f
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 2 deletions.
11 changes: 10 additions & 1 deletion chart/templates/gotk/rbac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -261,8 +261,17 @@ metadata:
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: cluster-admin
name: {{ .Values.gotk.rbac.adminClusterRole.name }}
subjects:
- kind: ServiceAccount
name: fluxcd
namespace: "{{ .Release.Namespace }}"
{{ if .Values.gotk.rbac.adminClusterRole.rules }}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: {{ .Values.gotk.rbac.adminClusterRole.name }}
rules:
{{ .Values.gotk.rbac.adminClusterRole.rules | toYaml }}
{{- end }}
11 changes: 10 additions & 1 deletion chart/templates/kraan/rbac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,18 @@ metadata:
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: cluster-admin
name: {{ .Values.kraan.rbac.adminClusterRole.name }}
subjects:
- kind: ServiceAccount
name: kraan
namespace: {{.Release.Namespace}}
{{ if .Values.kraan.rbac.adminClusterRole.rules }}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: {{ .Values.kraan.rbac.adminClusterRole.name }}
rules:
{{ .Values.kraan.rbac.adminClusterRole.rules | toYaml }}
{{- end }}
{{- end }}
12 changes: 12 additions & 0 deletions chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ kraan:
enabled: true
rbac:
enabled: true
adminClusterRole:
# admin ClusterRole to be used by the controller, default is cluster-admin
name: "cluster-admin"
# specify rules to create a ClusterRole
# https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.31/#policyrule-v1-rbac-authorization-k8s-io
# rules: []
netpolicy:
enabled: true
kraanController:
Expand Down Expand Up @@ -79,6 +85,12 @@ kraan:
gotk:
rbac:
enabled: true
adminClusterRole:
# admin ClusterRole to be used by the controller, default is cluster-admin
name: "cluster-admin"
# specify rules to create a ClusterRole
# https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.31/#policyrule-v1-rbac-authorization-k8s-io
# rules: []
netpolicy:
enabled: true

Expand Down

0 comments on commit c062b0f

Please sign in to comment.