diff --git a/stable/kube2iam/Chart.yaml b/stable/kube2iam/Chart.yaml index bdba9e52b8..9aa645606d 100644 --- a/stable/kube2iam/Chart.yaml +++ b/stable/kube2iam/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v1 name: kube2iam -version: 2.0.2 +version: 2.0.3 appVersion: 0.10.7 description: Provide IAM credentials to pods based on annotations. keywords: diff --git a/stable/kube2iam/README.md b/stable/kube2iam/README.md index 748ae4b541..d940e2efc2 100644 --- a/stable/kube2iam/README.md +++ b/stable/kube2iam/README.md @@ -51,6 +51,7 @@ Parameter | Description | Default `image.repository` | Image | `jtblin/kube2iam` `image.tag` | Image tag | `0.10.7` `image.pullPolicy` | Image pull policy | `IfNotPresent` +`image.pullSecrets` | Image pull secrets | `[]` `nodeSelector` | node labels for pod assignment | `{}` `podAnnotations` | annotations to be added to pods | `{}` `priorityClassName` | priorityClassName to be added to pods | `{}` diff --git a/stable/kube2iam/templates/_helpers.tpl b/stable/kube2iam/templates/_helpers.tpl index d8de027bc8..e5e084ce90 100644 --- a/stable/kube2iam/templates/_helpers.tpl +++ b/stable/kube2iam/templates/_helpers.tpl @@ -25,3 +25,32 @@ Create chart name and version as used by the chart label. {{- define "kube2iam.chart" -}} {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} {{- end -}} + +{{/* +Return the proper Docker Image Registry Secret Names +*/}} +{{- define "kube2iam.imagePullSecrets" -}} +{{/* +Helm 2.11 supports the assignment of a value to a variable defined in a different scope, +but Helm 2.9 and 2.10 does not support it, so we need to implement this if-else logic. +Also, we can not use a single if because lazy evaluation is not an option +*/}} +{{- if .Values.global }} +{{- if .Values.global.imagePullSecrets }} +imagePullSecrets: +{{- range .Values.global.imagePullSecrets }} + - name: {{ . }} +{{- end }} +{{- else if .Values.image.pullSecrets }} +imagePullSecrets: +{{- range .Values.image.pullSecrets }} + - name: {{ . }} +{{- end }} +{{- end -}} +{{- else if .Values.image.pullSecrets }} +imagePullSecrets: +{{- range .Values.image.pullSecrets }} + - name: {{ . }} +{{- end }} +{{- end -}} +{{- end -}} \ No newline at end of file diff --git a/stable/kube2iam/templates/daemonset.yaml b/stable/kube2iam/templates/daemonset.yaml index 996266353b..ef5194435c 100644 --- a/stable/kube2iam/templates/daemonset.yaml +++ b/stable/kube2iam/templates/daemonset.yaml @@ -21,6 +21,7 @@ spec: {{ toYaml .Values.podLabels | indent 8 }} {{- end }} spec: +{{- include "kube2iam.imagePullSecrets" . | indent 6 }} containers: - name: kube2iam image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" diff --git a/stable/kube2iam/values.yaml b/stable/kube2iam/values.yaml index 8814964f03..c5d48c3889 100644 --- a/stable/kube2iam/values.yaml +++ b/stable/kube2iam/values.yaml @@ -37,6 +37,12 @@ image: repository: jtblin/kube2iam tag: 0.10.7 pullPolicy: IfNotPresent + ## Optionally specify an array of imagePullSecrets. + ## Secrets must be manually created in the namespace. + ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ + ## + # pullSecrets: + # - myRegistryKeySecretName # AWS Access keys to inject as environment variables aws: