[bitnami/redis-cluster] Remove Jobs (#6160)

* [bitnami/redis-cluster] Remove Jobs

Signed-off-by: Miguel A. Cabrera Minagorri <macabrera@bitnami.com>

* [bitnami/redis-cluster] Update components versions

Signed-off-by: Bitnami Containers <containers@bitnami.com>

Co-authored-by: Bitnami Containers <containers@bitnami.com>
This commit is contained in:
Miguel Ángel Cabrera Miñagorri
2021-04-23 11:02:01 +02:00
committed by GitHub
co-authored by Bitnami Containers
parent 570e5b8b66
commit d1e367b6c1
5 changed files with 28 additions and 358 deletions
+2 -1
View File
@@ -23,4 +23,5 @@ name: redis-cluster
sources:
- https://github.com/bitnami/bitnami-docker-redis
- http://redis.io/
version: 5.0.2
version: 6.0.0
+6 -28
View File
@@ -190,34 +190,6 @@ The following table lists the configurable parameters of the Redis<sup>TM</sup>
| `redis.sidecars` | Attach additional containers to the pod (evaluated as a template) | `nil` |
| `redis.resources` | Redis<sup>TM</sup> CPU/Memory resource requests/limits | `{Memory: "256Mi", CPU: "100m"}` |
#### Cluster initialization job parameters
| Parameter | Description | Default |
|-------------------------------------|------------------------------------------------------------------------------------------------------------|--------------------------------|
| `initJob.activeDeadlineSeconds` | Maximum time (in seconds) to wait for the cluster initialization job to succeed | `600` |
| `initJob.command` | Entrypoint string. | `nil` |
| `initJob.args` | Arguments for the provided command if needed | `nil` |
| `initJob.annotations` | Job annotations | `nil` |
| `initJob.hostAliases` | Add deployment host aliases | `[]` |
| `initJob.podAnnotations` | Job pod annotations | `nil` |
| `initJob.extraEnvVars` | Array containing extra env vars to be added to all pods (evaluated as a template) | `[]` |
| `initJob.extraEnvVarsCM` | ConfigMap containing extra env vars to be added to all pods (evaluated as a template) | `nil` |
| `initJob.extraEnvVarsSecret` | Secret containing extra env vars to be added to all pods (evaluated as a template) | `nil` |
| `initJob.initContainers` | Init containers to add to the cronjob container | `{}` |
| `initJob.extraVolumes` | Array of extra volumes to be added to all pods (evaluated as a template) | `[]` |
| `initJob.extraVolumeMounts` | Array of extra volume mounts to be added to all pods (evaluated as a template) | `[]` |
| `initJob.podLabels` | Additional labels | `{}` |
| `initJob.podAffinityPreset` | Init job pod affinity preset. Ignored if `initJob.affinity` is set. Allowed values: `soft` or `hard` | `""` |
| `initJob.podAntiAffinityPreset` | Init job pod anti-affinity preset. Ignored if `initJob.affinity` is set. Allowed values: `soft` or `hard` | `soft` |
| `initJob.nodeAffinityPreset.type` | Init job node affinity preset type. Ignored if `initJob.affinity` is set. Allowed values: `soft` or `hard` | `""` |
| `initJob.nodeAffinityPreset.key` | Init job node label key to match Ignored if `initJob.affinity` is set. | `""` |
| `initJob.nodeAffinityPreset.values` | Init job node label values to match. Ignored if `initJob.affinity` is set. | `[]` |
| `initJob.affinity` | Affinity for init job pods assignment | `{}` (evaluated as a template) |
| `initJob.nodeSelector` | Node labels for init job pods assignment | `{}` (evaluated as a template) |
| `initJob.tolerations` | Tolerations for init job pods assignment | `[]` (evaluated as a template) |
| `initJob.resources` | Redis<sup>TM</sup> CPU/Memory resource requests/limits | `nil` |
| `initJob.priorityClassName` | Priority class name | `nil` |
#### Cluster update job parameters
| Parameter | Description | Default |
@@ -564,6 +536,12 @@ Find more information about how to deal with common errors related to Bitnami
## Upgrading
### To 6.0.0
The cluster initialization job have been removed. Instead, the pod with index 0 from the statefulset will handle the initialization of the cluster.
As consequence, the `initJob` configuration section have been removed.
### To 5.0.0
This major version updates the Redis<sup>TM</sup> docker image version used from `6.0` to `6.2`, the new stable version. There are no major changes in the chart and there shouldn't be any breaking changes in it as `6.2` breaking changes center around some command and behaviour changes. For more information, please refer to [Redis<sup>TM</sup> 6.2 release notes](https://raw.githubusercontent.com/redis/redis/6.2/00-RELEASENOTES).
@@ -1,189 +0,0 @@
{{- if and .Values.cluster.init (or (and .Values.cluster.externalAccess.enabled .Values.cluster.externalAccess.service.loadBalancerIP) ( not .Values.cluster.externalAccess.enabled )) }}
apiVersion: batch/v1
kind: Job
metadata:
name: {{ template "common.names.fullname" . }}-cluster-create
labels: {{- include "common.labels.standard" . | nindent 4 }}
{{- if .Values.commonLabels }}
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
{{- end }}
annotations:
"helm.sh/hook": post-install,post-upgrade
{{- if .Values.initJob.annotations }}
{{- include "common.tplvalues.render" ( dict "value" .Values.initJob.annotations "context" $ ) | nindent 4 }}
{{- end }}
{{- if .Values.commonAnnotations }}
{{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
spec:
activeDeadlineSeconds: {{ .Values.initJob.activeDeadlineSeconds }}
template:
metadata:
labels: {{- include "common.labels.standard" . | nindent 8 }}
{{- if .Values.commonLabels }}
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 8 }}
{{- end }}
{{- if .Values.initJob.podLabels }}
{{- include "common.tplvalues.render" (dict "value" .Values.initJob.podLabels "context" $) | nindent 8 }}
{{- end }}
annotations:
{{- if .Values.commonAnnotations }}
{{- include "common.tplvalues.render" (dict "value" .Values.commonAnnotations "context" $) | nindent 8 }}
{{- end }}
{{- if .Values.initJob.podAnnotations }}
{{- include "common.tplvalues.render" (dict "value" .Values.initJob.podAnnotations "context" $) | nindent 8 }}
{{- end }}
spec:
{{- include "redis-cluster.imagePullSecrets" . | nindent 6 }}
{{- if .Values.initJob.hostAliases }}
hostAliases: {{- include "common.tplvalues.render" (dict "value" .Values.initJob.hostAliases "context" $) | nindent 8 }}
{{- end }}
{{- if .Values.initJob.affinity }}
affinity: {{- include "common.tplvalues.render" (dict "value" .Values.initJob.affinity "context" $) | nindent 8 }}
{{- else }}
affinity:
podAffinity: {{- include "common.affinities.pods" (dict "type" .Values.initJob.podAffinityPreset "context" $) | nindent 10 }}
podAntiAffinity: {{- include "common.affinities.pods" (dict "type" .Values.initJob.podAntiAffinityPreset "context" $) | nindent 10 }}
nodeAffinity: {{- include "common.affinities.nodes" (dict "type" .Values.initJob.nodeAffinityPreset.type "key" .Values.initJob.nodeAffinityPreset.key "values" .Values.initJob.nodeAffinityPreset.values) | nindent 10 }}
{{- end }}
{{- if .Values.initJob.nodeSelector }}
nodeSelector: {{- include "common.tplvalues.render" (dict "value" .Values.initJob.nodeSelector "context" $) | nindent 8 }}
{{- end }}
{{- if .Values.initJob.tolerations }}
tolerations: {{- include "common.tplvalues.render" (dict "value" .Values.initJob.tolerations "context" $) | nindent 8 }}
{{- end }}
{{- if .Values.initJob.priorityClassName }}
priorityClassName: {{ .Values.initJob.priorityClassName }}
{{- end }}
{{- if .Values.podSecurityContext.enabled }}
securityContext:
fsGroup: {{ .Values.podSecurityContext.fsGroup }}
{{- if .Values.podSecurityContext.sysctls }}
sysctls:
{{- toYaml .Values.podSecurityContext.sysctls | nindent 8 }}
{{- end }}
{{- end }}
serviceAccountName: {{ include "redis-cluster.serviceAccountName" . }}
{{- if .Values.initJob.initContainers }}
initContainers: {{- include "common.tplvalues.render" (dict "value" .Values.initJob.initContainers "context" $) | nindent 8 }}
{{- end }}
containers:
- name: trigger
image: {{ include "redis-cluster.image" . }}
imagePullPolicy: {{ .Values.image.pullPolicy | quote }}
{{- if .Values.containerSecurityContext.enabled }}
securityContext:
runAsUser: {{ .Values.containerSecurityContext.runAsUser }}
{{- end }}
{{- if .Values.initJob.command }}
command: {{- include "common.tplvalues.render" (dict "value" .Values.initJob.command "context" $) | nindent 12 }}
{{- else }}
command: ['/bin/bash', '-c']
{{- end }}
{{- if .Values.initJob.args }}
args: {{- include "common.tplvalues.render" (dict "value" .Values.initJob.args "context" $) | nindent 12 }}
{{- else if .Values.cluster.externalAccess.enabled }}
args:
- |
# Backwards compatibility change
if ! [[ -f /opt/bitnami/redis/etc/redis.conf ]]; then
cp /opt/bitnami/redis/etc/redis-default.conf /opt/bitnami/redis/etc/redis.conf
fi
ips=($(echo "{{ .Values.cluster.externalAccess.service.loadBalancerIP }}" | cut -d [ -f2 | cut -d ] -f 1))
export REDIS_NODES="${ips[@]}"
/opt/bitnami/scripts/redis-cluster/entrypoint.sh /opt/bitnami/scripts/redis-cluster/run.sh
{{- else }}
args:
- |
# Backwards compatibility change
if ! [[ -f /opt/bitnami/redis/etc/redis.conf ]]; then
cp /opt/bitnami/redis/etc/redis-default.conf /opt/bitnami/redis/etc/redis.conf
fi
/opt/bitnami/scripts/redis-cluster/entrypoint.sh /opt/bitnami/scripts/redis-cluster/run.sh
{{- end }}
env:
- name: REDIS_TLS_ENABLED
value: {{ ternary "yes" "no" .Values.tls.enabled | quote }}
{{- if .Values.tls.enabled }}
- name: REDIS_TLS_AUTH_CLIENTS
value: {{ ternary "yes" "no" .Values.tls.authClients | quote }}
- name: REDIS_TLS_CERT_FILE
value: {{ template "redis-cluster.tlsCert" . }}
- name: REDIS_TLS_KEY_FILE
value: {{ template "redis-cluster.tlsCertKey" . }}
- name: REDIS_TLS_CA_FILE
value: {{ template "redis-cluster.tlsCACert" . }}
{{- if .Values.tls.dhParamsFilename }}
- name: REDIS_TLS_DH_PARAMS_FILE
value: {{ template "redis-cluster.tlsDHParams" . }}
{{- end }}
{{- end }}
{{- if .Values.cluster.externalAccess.enabled }}
{{- if .Values.tls.enabled }}
- name: REDIS_TLS_PORT
{{- else }}
- name: REDIS_PORT
{{- end }}
value: {{ .Values.cluster.externalAccess.service.port | quote }}
{{- else }}
{{- if .Values.tls.enabled }}
- name: REDIS_TLS_PORT
{{- else }}
- name: REDIS_PORT
{{- end }}
value: {{ .Values.redis.port | quote }}
- name: REDIS_NODES
value: "{{ $count := .Values.cluster.nodes | int }}{{ range $i, $v := until $count }}{{ include "common.names.fullname" $ }}-{{ $i }}.{{ template "common.names.fullname" $ }}-headless {{ end }}"
{{- end }}
{{- if .Values.usePassword }}
- name: REDISCLI_AUTH
valueFrom:
secretKeyRef:
name: {{ template "redis-cluster.secretName" . }}
key: {{ template "redis-cluster.secretPasswordKey" . }}
{{- end }}
- name: REDIS_CLUSTER_CREATOR
value: "yes"
- name: REDIS_CLUSTER_REPLICAS
value: {{ .Values.cluster.replicas | quote }}
{{- if .Values.initJob.extraEnvVars }}
{{- include "common.tplvalues.render" (dict "value" .Values.initJob.extraEnvVars "context" $) | nindent 12 }}
{{- end }}
{{- if or .Values.initJob.extraEnvVarsCM .Values.initJob.extraEnvVarsSecret }}
envFrom:
{{- if .Values.initJob.extraEnvVarsCM }}
- configMapRef:
name: {{ include "common.tplvalues.render" (dict "value" .Values.initJob.extraEnvVarsCM "context" $) }}
{{- end }}
{{- if .Values.initJob.extraEnvVarsSecret }}
- secretRef:
name: {{ include "common.tplvalues.render" (dict "value" .Values.initJob.extraEnvVarsSecret "context" $) }}
{{- end }}
{{- end }}
{{- if .Values.initJob.resources }}
resources: {{- toYaml .Values.initJob.resources | nindent 12 }}
{{- end }}
{{- if or .Values.tls.enabled .Values.initJob.extraVolumeMounts }}
volumeMounts:
{{- if .Values.tls.enabled }}
- name: redis-certificates
mountPath: /opt/bitnami/redis/certs
readOnly: true
{{- end }}
{{- if .Values.initJob.extraVolumeMounts }}
{{- include "common.tplvalues.render" (dict "value" .Values.initJob.extraVolumeMounts "context" $) | nindent 12 }}
{{- end }}
{{- end }}
restartPolicy: OnFailure
{{- if or .Values.tls.enabled .Values.initJob.extraVolumes }}
volumes:
{{- if .Values.tls.enabled }}
- name: redis-certificates
secret:
secretName: {{ include "common.tplvalues.render" (dict "value" .Values.tls.certificatesSecret "context" $) }}
{{- end }}
{{- if .Values.initJob.extraVolumes }}
{{- include "common.tplvalues.render" (dict "value" .Values.initJob.extraVolumes "context" $) | nindent 6 }}
{{- end }}
{{- end }}
{{- end }}
@@ -104,6 +104,12 @@ spec:
ips=($(echo "{{ .Values.cluster.externalAccess.service.loadBalancerIP }}" | cut -d [ -f2 | cut -d ] -f 1))
export REDIS_CLUSTER_ANNOUNCE_IP="${ips[$pod_index]}"
export REDIS_NODES="${ips[@]}"
{{- if .Values.cluster.init }}
if [[ "$pod_index" == "0" ]]; then
export REDIS_CLUSTER_CREATOR="yes"
export REDIS_CLUSTER_REPLICAS="{{ .Values.cluster.replicas }}"
fi
{{- end }}
/opt/bitnami/scripts/redis-cluster/entrypoint.sh /opt/bitnami/scripts/redis-cluster/run.sh
{{- else }}
args:
@@ -113,19 +119,27 @@ spec:
echo COPYING FILE
cp /opt/bitnami/redis/etc/redis-default.conf /opt/bitnami/redis/etc/redis.conf
fi
{{- if .Values.cluster.init }}
pod_index=($(echo "$POD_NAME" | tr "-" "\n"))
pod_index="${pod_index[-1]}"
if [[ "$pod_index" == "0" ]]; then
export REDIS_CLUSTER_CREATOR="yes"
export REDIS_CLUSTER_REPLICAS="{{ .Values.cluster.replicas }}"
fi
{{- end }}
/opt/bitnami/scripts/redis-cluster/entrypoint.sh /opt/bitnami/scripts/redis-cluster/run.sh
{{- end }}
{{- if .Values.redis.lifecycleHooks }}
lifecycle: {{- include "common.tplvalues.render" (dict "value" .Values.redis.lifecycleHooks "context" $) | nindent 12 }}
{{- end }}
env:
{{- if .Values.cluster.externalAccess.enabled }}
- name: REDIS_CLUSTER_DYNAMIC_IPS
value: "no"
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
{{- if .Values.cluster.externalAccess.enabled }}
- name: REDIS_CLUSTER_DYNAMIC_IPS
value: "no"
{{- else }}
- name: REDIS_NODES
value: "{{ $count := .Values.cluster.nodes | int }}{{ range $i, $v := until $count }}{{ include "common.names.fullname" $ }}-{{ $i }}.{{ template "common.names.fullname" $ }}-headless {{ end }}"
+3 -137
View File
@@ -18,7 +18,7 @@ image:
## Bitnami Redis(TM) image tag
## ref: https://github.com/bitnami/bitnami-docker-redis#supported-tags-and-respective-dockerfile-links
##
tag: 6.2.2-debian-10-r0
tag: 6.2.2-debian-10-r4
## Specify a imagePullPolicy
## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent'
## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images
@@ -42,7 +42,7 @@ fullnameOverride:
## Redis(TM) Cluster settings
##
cluster:
## Enable the creation of a Job that will execute the proper command to create the Redis(TM) Cluster.
## Enable the initialization of the Redis(TM) Cluster.
##
init: true
## Number of Redis(TM) nodes to be deployed
@@ -276,140 +276,6 @@ redis:
##
busPort: 16379
## Cluster init job settings
##
initJob:
## Number of seconds the Job to create the cluster will be waiting for the Nodes to be ready.
##
activeDeadlineSeconds: 600
## Container command (using container default if not set)
##
command:
## Container args (using container default if not set)
##
args:
## Deployment pod host aliases
## https://kubernetes.io/docs/concepts/services-networking/add-entries-to-pod-etc-hosts-with-host-aliases/
##
hostAliases: []
## Job annotations
##
annotations: {}
## Pod annotations
## IMPORTANT: When using Istio set as the following (https://github.com/istio/istio/issues/11045):
## podAnnotations:
## sidecar.istio.io/inject: "false"
##
podAnnotations: {}
## An array to add extra env vars
## For example:
##
extraEnvVars: []
# - name: BEARER_AUTH
# value: true
## ConfigMap with extra environment variables
##
extraEnvVarsCM:
## Secret with extra environment variables
##
extraEnvVarsSecret:
## Extra volumes to add to the deployment
##
extraVolumes: []
## Extra volume mounts to add to the container
##
extraVolumeMounts: []
## Extra init containers to add to the deployment
##
initContainers: []
## Init job pod affinity preset
## ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#inter-pod-affinity-and-anti-affinity
## Allowed values: soft, hard
##
podAffinityPreset: ""
## Init job pod anti-affinity preset
## ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#inter-pod-affinity-and-anti-affinity
## Allowed values: soft, hard
##
podAntiAffinityPreset: soft
## Init job node affinity preset
## ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#node-affinity
## Allowed values: soft, hard
##
nodeAffinityPreset:
## Node affinity type
## Allowed values: soft, hard
##
type: ""
## Node label key to match
## E.g.
## key: "kubernetes.io/e2e-az-name"
##
key: ""
## Node label values to match
## E.g.
## values:
## - e2e-az1
## - e2e-az2
##
values: []
## Affinity for init job pods assignment
## ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity
## Note: initJob.podAffinityPreset, initJob.podAntiAffinityPreset, and initJob.nodeAffinityPreset will be ignored when it's set
##
affinity: {}
## Node labels for init job pods assignment
## ref: https://kubernetes.io/docs/user-guide/node-selection/
##
nodeSelector: {}
## Tolerations for init job pods assignment
## ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/
##
tolerations: []
## Pod extra labels
## ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/
##
podLabels: {}
## Priority class name
##
priorityClassName:
## Container resource requests and limits
## ref: http://kubernetes.io/docs/user-guide/compute-resources/
##
resources:
## We usually recommend not to specify default resources and to leave this as a conscious
## choice for the user. This also increases chances charts run on environments with little
## resources, such as Minikube. If you do want to specify resources, uncomment the following
## lines, adjust them as necessary, and remove the curly braces after 'resources:'.
##
limits: {}
## cpu: 500m
## memory: 1Gi
##
requests: {}
## cpu: 250m
## memory: 256Mi
##
## Cluster update job settings
##
updateJob:
@@ -745,7 +611,7 @@ metrics:
image:
registry: docker.io
repository: bitnami/redis-exporter
tag: 1.20.0-debian-10-r27
tag: 1.22.0-debian-10-r0
pullPolicy: IfNotPresent
## Optionally specify an array of imagePullSecrets.
## Secrets must be manually created in the namespace.