fix: Helm bug with subcharts and alias

This commit is contained in:
Carlos Juan Gómez Peñalver 2020-03-29 15:14:30 +01:00
parent 13a6e76068
commit 90c2eeb76a
10 changed files with 44 additions and 38 deletions

View file

@ -263,8 +263,8 @@ Helm v3 has removed the `install-crds` hook so CRDs are now populated by files i
When Redis is completely disabled from the chart (`redis.enabled=false`) and
an external Redis instance wants to be used or
when Redis HA subcart is enabled (`redis.enabled=true and redis.ha.enabled=true`)
but HA proxy is disabled `redis.ha.haproxy.enabled=false` Redis flags need to be specified
when Redis HA subcart is enabled (`redis.enabled=true and redis-ha.enabled=true`)
but HA proxy is disabled `redis-ha.haproxy.enabled=false` Redis flags need to be specified
through `xxx.extraArgs`
| Key | Default | Description |
@ -284,12 +284,12 @@ through `xxx.extraArgs`
| redis.resources | Resource limits and requests for redis | `{}` |
| redis.servicePort | Redis service port | `6379` |
| redis.tolerations | Tolerations for use with node taints https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/ | `[]` |
| redis.ha | Configures Redis HA subchart https://github.com/helm/charts/tree/master/stable/redis-ha | | |
| redis.ha.enabled | Enables the Redis HA subchart and disabled the custom Redis single node deployment| `false` |
| redis.ha.exporter.enabled | If `true`, the prometheus exporter sidecar is enabled | `true` |
| redis.ha.persistentVolume.enabled | Configures persistency on Redis nodes | `false`
| redis.ha.redis.masterGroupName | Redis convention for naming the cluster group: must match `^[\\w-\\.]+$` and can be templated | `argocd`
| redis.ha.redis.config | Any valid redis config options in this section will be applied to each server (see `redis-ha` chart) | `` |
| redis.ha.redis.config.save | Will save the DB if both the given number of seconds and the given number of write operations against the DB occurred. `""` is disabled | `""` |
| redis.ha.haproxy.enabled | Enabled HAProxy LoadBalancing/Proxy | `true` |
| redis.ha.haproxy.metrics.enabled | HAProxy enable prometheus metric scraping | `true` |
| redis-ha | Configures Redis HA subchart https://github.com/helm/charts/tree/master/stable/redis-ha | | |
| redis-ha.enabled | Enables the Redis HA subchart and disables the custom Redis single node deployment| `false` |
| redis-ha.exporter.enabled | If `true`, the prometheus exporter sidecar is enabled | `true` |
| redis-ha.persistentVolume.enabled | Configures persistency on Redis nodes | `false`
| redis-ha.redis.masterGroupName | Redis convention for naming the cluster group: must match `^[\\w-\\.]+$` and can be templated | `argocd`
| redis-ha.redis.config | Any valid redis config options in this section will be applied to each server (see `redis-ha` chart) | `` |
| redis-ha.redis.config.save | Will save the DB if both the given number of seconds and the given number of write operations against the DB occurred. `""` is disabled | `""` |
| redis-ha.haproxy.enabled | Enabled HAProxy LoadBalancing/Proxy | `true` |
| redis-ha.haproxy.metrics.enabled | HAProxy enable prometheus metric scraping | `true` |

View file

@ -2,5 +2,5 @@ dependencies:
- name: redis-ha
repository: https://kubernetes-charts.storage.googleapis.com
version: 4.4.2
digest: sha256:d3b7b8ec4c09eeeae44a64352f983cd1619cf98d80d0e49780a016aedb477a6c
generated: "2020-03-18T22:24:39.082009894Z"
digest: sha256:70fdd035c3aa3b7185882f12a73143c58ab32f04262dda2cf34a2b1a52116d96
generated: "2020-03-29T14:37:59.349371452+01:00"

View file

@ -1,6 +1,5 @@
dependencies:
- name: redis-ha
alias: redis.ha
version: 4.4.2
repository: https://kubernetes-charts.storage.googleapis.com
condition: redis.ha.enabled
condition: redis-ha.enabled

View file

@ -42,8 +42,11 @@ Create dex name and version as used by the chart label.
Create redis name and version as used by the chart label.
*/}}
{{- define "argo-cd.redis.fullname" -}}
{{- if and .Values.redis.ha.enabled .Values.redis.ha.haproxy.enabled -}}
{{- printf "%s-redis-ha-haproxy" .Release.Name | trunc 63 | trimSuffix "-" -}}
{{ $redisHa := (index .Values "redis-ha") }}
{{- if and $redisHa.enabled -}}
{{- if $redisHa.haproxy.enabled -}}
{{- printf "%s-redis-ha-haproxy" .Release.Name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{- else -}}
{{- printf "%s-%s" (include "argo-cd.fullname" .) .Values.redis.name | trunc 63 | trimSuffix "-" -}}
{{- end -}}

View file

@ -1,4 +1,4 @@
{{- $redisHa := (index .Values "redis-ha") -}}
apiVersion: apps/v1
kind: Deployment
metadata:
@ -56,7 +56,7 @@ spec:
- {{ template "argo-cd.repoServer.fullname" . }}:{{ .Values.repoServer.service.port }}
- --loglevel
- {{ .Values.controller.logLevel }}
{{- if and .Values.redis.enabled .Values.redis.ha.enabled .Values.redis.ha.haproxy.enabled }}
{{- if or (and .Values.redis.enabled (not $redisHa.enabled)) (and $redisHa.enabled $redisHa.haproxy.enabled) }}
- --redis
- {{ template "argo-cd.redis.fullname" . }}:{{ .Values.redis.servicePort }}
{{- end }}

View file

@ -1,3 +1,4 @@
{{- $redisHa := (index .Values "redis-ha") -}}
apiVersion: apps/v1
kind: Deployment
metadata:
@ -52,7 +53,7 @@ spec:
imagePullPolicy: {{ default .Values.global.image.imagePullPolicy .Values.repoServer.image.imagePullPolicy }}
command:
- argocd-repo-server
{{- if and .Values.redis.enabled .Values.redis.ha.enabled .Values.redis.ha.haproxy.enabled }}
{{- if or (and .Values.redis.enabled (not $redisHa.enabled)) (and $redisHa.enabled $redisHa.haproxy.enabled) }}
- --redis
- {{ template "argo-cd.redis.fullname" . }}:{{ .Values.redis.servicePort }}
{{- end }}

View file

@ -1,3 +1,4 @@
{{- $redisHa := (index .Values "redis-ha") -}}
apiVersion: apps/v1
kind: Deployment
metadata:
@ -62,7 +63,7 @@ spec:
{{- end }}
- --loglevel
- {{ .Values.server.logLevel }}
{{- if and .Values.redis.enabled .Values.redis.ha.enabled .Values.redis.ha.haproxy.enabled }}
{{- if or (and .Values.redis.enabled (not $redisHa.enabled)) (and $redisHa.enabled $redisHa.haproxy.enabled) }}
- --redis
- {{ template "argo-cd.redis.fullname" . }}:{{ .Values.redis.servicePort }}
{{- end }}

View file

@ -1,4 +1,5 @@
{{- if and .Values.redis.enabled (not .Values.redis.ha.enabled) }}
{{- $redisHa := (index .Values "redis-ha") -}}
{{- if and .Values.redis.enabled (not $redisHa.enabled) -}}
apiVersion: apps/v1
kind: Deployment
metadata:

View file

@ -1,4 +1,5 @@
{{- if and .Values.redis.enabled (not .Values.redis.ha.enabled) }}
{{- $redisHa := (index .Values "redis-ha") -}}
{{- if and .Values.redis.enabled (not $redisHa.enabled) -}}
apiVersion: v1
kind: Service
metadata:

View file

@ -282,9 +282,9 @@ redis:
volumeMounts: []
volumes: []
# This key configures Redis-HA subchart and when enabled (redis.ha.enabled=true)
# the custom redis deployment is omitted
ha:
# This key configures Redis-HA subchart and when enabled (redis-ha.enabled=true)
# the custom redis deployment is omitted
redis-ha:
enabled: false
# Check the redis-ha chart for more properties
exporter: