[stable/kubewatch] Add global registry option (#8468)

* [stable/kubewatch] Add global registry option

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

* Fix trailing space

Signed-off-by: Carlos Rodriguez Hernandez <crhernandez@bitnami.com>
This commit is contained in:
Carlos Rodríguez Hernández
2018-10-15 09:50:35 -07:00
committed by k8s-ci-robot
parent 5eb01aa04d
commit 847ffe738e
5 changed files with 34 additions and 6 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
name: kubewatch
version: 0.4.2
version: 0.5.0
apiVersion: v1
appVersion: v0.0.4
home: https://github.com/bitnami-labs/kubewatch
+2 -1
View File
@@ -39,6 +39,7 @@ The following table lists the configurable parameters of the kubewatch chart and
| Parameter | Description | Default |
| ---------------------------------------- | ------------------------------------ | --------------------------------- |
| `global.imageRegistry` | Global Docker image registry | `nil` |
| `affinity` | node/pod affinities | None |
| `image.registry` | Image registry | `docker.io` |
| `image.repository` | Image repository | `bitnami/kubewatch` |
@@ -50,7 +51,7 @@ The following table lists the configurable parameters of the kubewatch chart and
| `replicaCount` | desired number of pods | `1` |
| `rbac.create` | If true, create & use RBAC resources | `true` |
| `serviceAccount.create` | If true, create a serviceAccount | `true` |
| `serviceAccount.name` | existing ServiceAccount to use (ignored if rbac.create=true) | `` |
| `serviceAccount.name` | existing ServiceAccount to use (ignored if rbac.create=true) | `` |
| `resources` | pod resource requests & limits | `{}` |
| `slack.channel` | Slack channel to notify | `""` |
| `slack.token` | Slack API token | `""` |
+24 -2
View File
@@ -31,7 +31,6 @@ Create chart name and version as used by the chart label.
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{/*
Create the name of the service account to use
*/}}
@@ -41,4 +40,27 @@ Create the name of the service account to use
{{- else -}}
{{ default "default" .Values.serviceAccount.name }}
{{- end -}}
{{- end -}}
{{- end -}}
{{/*
Return the proper Kubewatch image name
*/}}
{{- define "kubewatch.image" -}}
{{- $registryName := .Values.image.registry -}}
{{- $repositoryName := .Values.image.repository -}}
{{- $tag := .Values.image.tag | toString -}}
{{/*
Helm 2.11 supports the assignment of a value to a variable defined in a different scope,
but Helm 2.9 and 2.10 doesn't support it, so we need to implement this if-else logic.
Also, we can't use a single if because lazy evaluation is not an option
*/}}
{{- if .Values.global }}
{{- if .Values.global.imageRegistry }}
{{- printf "%s/%s:%s" .Values.global.imageRegistry $repositoryName $tag -}}
{{- else -}}
{{- printf "%s/%s:%s" $registryName $repositoryName $tag -}}
{{- end -}}
{{- else -}}
{{- printf "%s/%s:%s" $registryName $repositoryName $tag -}}
{{- end -}}
{{- end -}}
+1 -2
View File
@@ -29,7 +29,7 @@ spec:
spec:
containers:
- name: {{ template "kubewatch.name" . }}
image: {{ .Values.image.registry }}/{{ .Values.image.repository }}:{{ .Values.image.tag }}
image: {{ template "kubewatch.image" . }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
volumeMounts:
- name: {{ template "kubewatch.name" . }}-config-map
@@ -53,4 +53,3 @@ spec:
- name: {{ template "kubewatch.name" . }}-config-map
configMap:
name: {{ template "kubewatch.fullname" . }}-config
+6
View File
@@ -1,3 +1,9 @@
## 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:
# imageRegistry:
slack:
# Slack channel to notify
channel: "XXXX"