diff --git a/stable/kubewatch/Chart.yaml b/stable/kubewatch/Chart.yaml index 17562d0e76..8ae870ec5f 100644 --- a/stable/kubewatch/Chart.yaml +++ b/stable/kubewatch/Chart.yaml @@ -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 diff --git a/stable/kubewatch/README.md b/stable/kubewatch/README.md index 97900db148..e454eee408 100644 --- a/stable/kubewatch/README.md +++ b/stable/kubewatch/README.md @@ -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 | `""` | diff --git a/stable/kubewatch/templates/_helpers.tpl b/stable/kubewatch/templates/_helpers.tpl index 3e3d9656f0..baf5c90e4d 100644 --- a/stable/kubewatch/templates/_helpers.tpl +++ b/stable/kubewatch/templates/_helpers.tpl @@ -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 -}} \ No newline at end of file +{{- 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 -}} diff --git a/stable/kubewatch/templates/deployment.yaml b/stable/kubewatch/templates/deployment.yaml index 35db9cc7f5..e7f9ebef21 100644 --- a/stable/kubewatch/templates/deployment.yaml +++ b/stable/kubewatch/templates/deployment.yaml @@ -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 - diff --git a/stable/kubewatch/values.yaml b/stable/kubewatch/values.yaml index 2b0de1953f..157125ee07 100644 --- a/stable/kubewatch/values.yaml +++ b/stable/kubewatch/values.yaml @@ -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"