Skip to content

Commit

Permalink
Add pod annotations and allow to disable rbac (#30)
Browse files Browse the repository at this point in the history
Enable pod annoations and flag to disable rbac
  • Loading branch information
uncycler authored Apr 3, 2020
1 parent caba5d5 commit edccd85
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 1 deletion.
6 changes: 5 additions & 1 deletion helm/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ spec:
metadata:
labels:
{{- include "helm-exporter.selectorLabels" . | nindent 8 }}
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
Expand All @@ -31,7 +35,7 @@ spec:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
{{- if .Values.tillerNamespaces }}
{{- if .Values.namespaces }}
args: ["-namespaces", {{ .Values.namespaces | quote }}]
{{- end }}
ports:
Expand Down
2 changes: 2 additions & 0 deletions helm/templates/role.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.rbac.create -}}
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
Expand All @@ -14,3 +15,4 @@ rules:
- get
- watch
- list
{{- end -}}
2 changes: 2 additions & 0 deletions helm/templates/role_binding.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.rbac.create -}}
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
Expand All @@ -12,3 +13,4 @@ roleRef:
kind: ClusterRole
name: {{ include "helm-exporter.fullname" . }}
apiGroup: rbac.authorization.k8s.io
{{- end -}}
5 changes: 5 additions & 0 deletions helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ imagePullSecrets: []
nameOverride: ""
fullnameOverride: ""

rbac:
create: true

serviceAccount:
# Specifies whether a service account should be created
create: true
Expand All @@ -29,6 +32,8 @@ serviceAccount:
podSecurityContext: {}
# fsGroup: 2000

podAnnotations: {}

securityContext: {}
# capabilities:
# drop:
Expand Down

0 comments on commit edccd85

Please sign in to comment.