[stable/owncloud] Add global 'imagePullSecrets' to overwrite any other existing one (#12078)

* [stable/owncloud] Add global 'imagePullSecrets' to overwrite any other existing one

Signed-off-by: Carlos Rodriguez Hernandez <crhernandez@bitnami.com>

* Fix typo and add var to the README

Signed-off-by: Carlos Rodriguez Hernandez <crhernandez@bitnami.com>

* Fix typo in helpers

Signed-off-by: Carlos Rodriguez Hernandez <crhernandez@bitnami.com>
This commit is contained in:
Carlos Rodríguez Hernández
2019-03-12 02:39:12 -07:00
committed by Kubernetes Prow Robot
parent 8eeaccb03c
commit 54b6db7bd5
5 changed files with 46 additions and 12 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
apiVersion: v1
name: owncloud
version: 4.0.4
version: 4.1.0
appVersion: 10.1.0
description: A file sharing server that puts the control and security of your own data back into your hands.
keywords:
+1
View File
@@ -50,6 +50,7 @@ The following table lists the configurable parameters of the ownCloud chart and
| Parameter | Description | Default |
|-------------------------------------|--------------------------------------------|-------------------------------------------------------- |
| `global.imageRegistry` | Global Docker image registry | `nil` |
| `global.imagePullSecrets` | Global Docker registry secret names as an array | `[]` (does not add image pull secrets to deployed pods) |
| `image.registry` | ownCloud image registry | `docker.io` |
| `image.repository` | ownCloud Image name | `bitnami/owncloud` |
| `image.tag` | ownCloud Image tag | `{VERSION}` |
+35
View File
@@ -83,3 +83,38 @@ Return the proper image name (for the metrics image)
{{- $tag := .Values.metrics.image.tag | toString -}}
{{- printf "%s/%s:%s" $registryName $repositoryName $tag -}}
{{- end -}}
{{/*
Return the proper Docker Image Registry Secret Names
*/}}
{{- define "owncloud.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 or .Values.image.pullSecrets .Values.metrics.image.pullSecrets }}
imagePullSecrets:
{{- range .Values.image.pullSecrets }}
- name: {{ . }}
{{- end }}
{{- range .Values.metrics.image.pullSecrets }}
- name: {{ . }}
{{- end }}
{{- end -}}
{{- else if or .Values.image.pullSecrets .Values.metrics.image.pullSecrets }}
imagePullSecrets:
{{- range .Values.image.pullSecrets }}
- name: {{ . }}
{{- end }}
{{- range .Values.metrics.image.pullSecrets }}
- name: {{ . }}
{{- end }}
{{- end -}}
{{- end -}}
+1 -6
View File
@@ -30,12 +30,7 @@ spec:
{{- end }}
{{- end }}
spec:
{{- if .Values.image.pullSecrets }}
imagePullSecrets:
{{- range .Values.image.pullSecrets }}
- name: {{ . }}
{{- end}}
{{- end }}
{{- include "owncloud.imagePullSecrets" . | indent 6 }}
hostAliases:
- ip: "127.0.0.1"
hostnames:
+8 -5
View File
@@ -1,8 +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
## Bitnami ownCloud image version
## ref: https://hub.docker.com/r/bitnami/owncloud/tags/
@@ -21,7 +24,7 @@ image:
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/
##
# pullSecrets:
# - myRegistrKeySecretName
# - myRegistryKeySecretName
## For Kubernetes v1.4, v1.5 and v1.6, use 'extensions/v1beta1'
## For Kubernetes v1.7, use 'networking.k8s.io/v1'
@@ -249,7 +252,7 @@ metrics:
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/
##
# pullSecrets:
# - myRegistrKeySecretName
# - myRegistryKeySecretName
## Metrics exporter pod Annotation and Labels
podAnnotations:
prometheus.io/scrape: "true"