Skip to content

Commit

Permalink
feat(chart): add rbac
Browse files Browse the repository at this point in the history
  • Loading branch information
simonostendorf committed Jun 25, 2024
1 parent aa60244 commit c642909
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
19 changes: 19 additions & 0 deletions deploy/helm-chart/templates/clusterrolebinding.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{{- if and .Values.rbac.enabled (not (eq .Values.rbac.name "")) }}
apiVersion: rbac.authorization.k8s.io/v1
kind: {{ .Values.rbac.type }}Binding
metadata:
labels:
{{- include "exporter.labels" . | nindent 4 }}
name: {{ include "exporter.fullname" . }}
{{- if eq .Values.rbac.type "Role" }}
namespace: {{ .Release.Namespace }}
{{- end }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: {{ .Values.rbac.type }}
name: {{ .Values.rbac.name }}
subjects:
- kind: ServiceAccount
name: {{ include "exporter.serviceAccountName" . }}
namespace: {{ .Release.Namespace }}
{{- end }}
5 changes: 5 additions & 0 deletions deploy/helm-chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ serviceAccount:
# If not set and create is true, a name is generated using the fullname template
name: ""

rbac:
enabled: false
type: ClusterRole # ClusterRole or Role
name: "" # example: system:auth-delegator

podAnnotations:
prometheus.io/scrape: 'true'
prometheus.io/port: '8000'
Expand Down

0 comments on commit c642909

Please sign in to comment.