diff --git a/stable/stackdriver-exporter/Chart.yaml b/stable/stackdriver-exporter/Chart.yaml index 66d4ef34b4..3434d7d24f 100644 --- a/stable/stackdriver-exporter/Chart.yaml +++ b/stable/stackdriver-exporter/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v1 description: Stackdriver exporter for Prometheus name: stackdriver-exporter -version: 1.1.0 +version: 1.1.1 appVersion: 0.6.0 home: https://www.stackdriver.com/ sources: diff --git a/stable/stackdriver-exporter/README.md b/stable/stackdriver-exporter/README.md index a2c4de6c7c..5400151c42 100644 --- a/stable/stackdriver-exporter/README.md +++ b/stable/stackdriver-exporter/README.md @@ -64,6 +64,8 @@ Parameter | Description `image.tag` | Container image tag | `v0.6.0` `image.pullPolicy` | Container image pull policy | `IfNotPresent` `resources` | Resource requests & limits | `{}` +`serviceAccount.name` | Name of Kubernetes service account to use | `""` (defaults to `default`) +`serviceAccount.create` | Toggle for service account creation | `false` `service.type` | Type of service to create | `ClusterIP` `service.httpPort` | Port for the http service | `9255` `stackdriver.projectId` | GCP Project ID | `` diff --git a/stable/stackdriver-exporter/templates/_helpers.tpl b/stable/stackdriver-exporter/templates/_helpers.tpl index 704a8d25a3..9f62ffe15f 100644 --- a/stable/stackdriver-exporter/templates/_helpers.tpl +++ b/stable/stackdriver-exporter/templates/_helpers.tpl @@ -30,3 +30,14 @@ Create chart name and version as used by the chart label. {{- define "stackdriver-exporter.chart" -}} {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} {{- end -}} + +{{/* +Create the name of the service account to use +*/}} +{{- define "stackdriver-exporter.serviceAccountName" -}} +{{- if .Values.serviceAccount.create -}} + {{ default (include "stackdriver-exporter.fullname" .) .Values.serviceAccount.name }} +{{- else -}} + {{ default "default" .Values.serviceAccount.name }} +{{- end -}} +{{- end -}} diff --git a/stable/stackdriver-exporter/templates/deployment.yaml b/stable/stackdriver-exporter/templates/deployment.yaml index 4194751b93..e75f470688 100644 --- a/stable/stackdriver-exporter/templates/deployment.yaml +++ b/stable/stackdriver-exporter/templates/deployment.yaml @@ -32,6 +32,7 @@ spec: affinity: {{ toYaml .Values.affinity | indent 8 }} {{- end }} + serviceAccount: {{ template "stackdriver-exporter.serviceAccountName" . }} restartPolicy: {{ .Values.restartPolicy }} volumes: {{- if .Values.stackdriver.serviceAccountSecret }} diff --git a/stable/stackdriver-exporter/templates/serviceaccount.yaml b/stable/stackdriver-exporter/templates/serviceaccount.yaml new file mode 100644 index 0000000000..567a69aefb --- /dev/null +++ b/stable/stackdriver-exporter/templates/serviceaccount.yaml @@ -0,0 +1,11 @@ +{{- if .Values.serviceAccount.create }} +apiVersion: v1 +kind: ServiceAccount +metadata: + labels: + chart: {{ template "stackdriver-exporter.chart" . }} + app: {{ template "stackdriver-exporter.name" . }} + release: "{{ .Release.Name }}" + heritage: "{{ .Release.Service }}" + name: {{ template "stackdriver-exporter.serviceAccountName" . }} +{{- end -}} diff --git a/stable/stackdriver-exporter/values.yaml b/stable/stackdriver-exporter/values.yaml index ec3b8d9a47..cb91ccf803 100644 --- a/stable/stackdriver-exporter/values.yaml +++ b/stable/stackdriver-exporter/values.yaml @@ -72,3 +72,14 @@ tolerations: [] # operator: "Equal|Exists" # value: "value" # effect: "NoSchedule|PreferNoSchedule|NoExecute(1.6 only)" + + +## Service Account +## +serviceAccount: + # Specifies whether a ServiceAccount should be created + create: false + # The name of the ServiceAccount to use. + # If not set and create is false, 'default' is used + # If not set and create is true, a name is generated using the fullname template + name: