Add in imagePullSecrets config for kube2iam chart (#18815)

Signed-off-by: Benjamin Farley <benalfarley@gmail.com>
This commit is contained in:
Benjamin Farley
2019-12-01 04:07:03 -08:00
committed by Kubernetes Prow Robot
parent 4055b4c48b
commit ef59e24b7f
5 changed files with 38 additions and 1 deletions
+1 -1
View File
@@ -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:
+1
View File
@@ -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 | `{}`
+29
View File
@@ -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 -}}
+1
View File
@@ -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 }}"
+6
View File
@@ -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: