Skip to content

Commit

Permalink
Add global imagePullSecrets to overwrite any other existing one (#989)
Browse files Browse the repository at this point in the history
  • Loading branch information
carrodher authored and andresmgot committed Mar 12, 2019
1 parent a8d1bbc commit 0dc038c
Show file tree
Hide file tree
Showing 10 changed files with 33 additions and 5 deletions.
2 changes: 1 addition & 1 deletion chart/kubeapps/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v1
name: kubeapps
version: 1.5.4
version: 1.6.0
appVersion: DEVEL
description: Kubeapps is a dashboard for your Kubernetes cluster that makes it easy to deploy and manage applications in your cluster using Helm
icon: https://raw.githubusercontent.com/kubeapps/kubeapps/master/docs/img/logo.png
Expand Down
17 changes: 17 additions & 0 deletions chart/kubeapps/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -160,3 +160,20 @@ Frontend service port number
8080
{{- end -}}
{{- end -}}

{{/*
Return the proper Docker Image Registry Secret Names
*/}}
{{- define "kubeapps.imagePullSecrets" -}}
{{/*
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 }}
{{- end -}}
{{- end -}}
{{- end -}}
1 change: 1 addition & 0 deletions chart/kubeapps/templates/apprepository-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ spec:
release: {{ .Release.Name }}
spec:
serviceAccountName: {{ template "kubeapps.apprepository.fullname" . }}
{{- include "kubeapps.imagePullSecrets" . | indent 6 }}
containers:
- name: controller
image: {{ template "kubeapps.image" (list .Values.apprepository.image .Values.global) }}
Expand Down
1 change: 1 addition & 0 deletions chart/kubeapps/templates/apprepository-jobs-cleanup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ spec:
app: {{ template "kubeapps.apprepository-jobs-cleanup.fullname" . }}
release: {{ .Release.Name }}
spec:
{{- include "kubeapps.imagePullSecrets" . | indent 6 }}
containers:
- name: kubectl
image: {{ template "kubeapps.image" (list .Values.hooks.image .Values.global) }}
Expand Down
1 change: 1 addition & 0 deletions chart/kubeapps/templates/chartsvc-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ spec:
app: {{ template "kubeapps.chartsvc.fullname" . }}
release: {{ .Release.Name }}
spec:
{{- include "kubeapps.imagePullSecrets" . | indent 6 }}
containers:
- name: chartsvc
image: {{ template "kubeapps.image" (list .Values.chartsvc.image .Values.global) }}
Expand Down
1 change: 1 addition & 0 deletions chart/kubeapps/templates/dashboard-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ spec:
app: {{ template "kubeapps.dashboard.fullname" . }}
release: {{ .Release.Name }}
spec:
{{- include "kubeapps.imagePullSecrets" . | indent 6 }}
containers:
- name: dashboard
image: {{ template "kubeapps.image" (list .Values.dashboard.image .Values.global) }}
Expand Down
1 change: 1 addition & 0 deletions chart/kubeapps/templates/kubeapps-frontend-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ spec:
app: {{ template "kubeapps.fullname" . }}
release: {{ .Release.Name }}
spec:
{{- include "kubeapps.imagePullSecrets" . | indent 6 }}
containers:
- name: nginx
image: {{ template "kubeapps.image" (list .Values.frontend.image .Values.global) }}
Expand Down
1 change: 1 addition & 0 deletions chart/kubeapps/templates/mongodb-jobs-cleanup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ spec:
app: {{ template "kubeapps.mongodb-jobs-cleanup.fullname" . }}
release: {{ .Release.Name }}
spec:
{{- include "kubeapps.imagePullSecrets" . | indent 6 }}
containers:
- name: kubectl
image: {{ template "kubeapps.image" (list .Values.hooks.image .Values.global) }}
Expand Down
1 change: 1 addition & 0 deletions chart/kubeapps/templates/tiller-proxy-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ spec:
# Increase termination timeout to let remaining operations to finish before killing the pods
# This is because new releases/upgrades/deletions are synchronous operations
terminationGracePeriodSeconds: 300
{{- include "kubeapps.imagePullSecrets" . | indent 6 }}
containers:
- name: proxy
image: {{ template "kubeapps.image" (list .Values.tillerProxy.image .Values.global) }}
Expand Down
12 changes: 8 additions & 4 deletions chart/kubeapps/values.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
## Global Docker image registry
## Please, note that this will override the image registry for all the images, including dependencies, configured to use the global value
## Global Docker image parameters
## Please, note that this will override the image parameters, including dependencies, configured to use the global value
## Current available global Docker image parameters: imageRegistry and imagePullSecrets
##
# global:
# imageRegistry:
# imageRegistry: myRegistryName
# imagePullSecrets:
# - myRegistryKeySecretName

# The frontend service is the main reverse proxy used to access the Kubeapps UI
# To expose Kubeapps externally either configure the ingress object below or
Expand All @@ -25,7 +29,7 @@ ingress:
# Keep the connection open with the API server even if idle (the default is 60 seconds)
# Setting it to 10 minutes which should be enough for our current use case of deploying/upgrading/deleting apps
nginx.ingress.kubernetes.io/proxy-read-timeout: "600"

# The list of hostnames to be covered with this ingress record.
# Most likely this will be just one host, but in the event more hosts are needed, this is an array
hosts:
Expand Down

0 comments on commit 0dc038c

Please sign in to comment.