Skip to content

Commit

Permalink
[bitnami/redis-cluster] Remove Jobs (#6160)
Browse files Browse the repository at this point in the history
* [bitnami/redis-cluster] Remove Jobs

Signed-off-by: Miguel A. Cabrera Minagorri <[email protected]>

* [bitnami/redis-cluster] Update components versions

Signed-off-by: Bitnami Containers <[email protected]>

Co-authored-by: Bitnami Containers <[email protected]>
  • Loading branch information
miguelaeh and bitnami-bot authored Apr 23, 2021
1 parent 570e5b8 commit d1e367b
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 358 deletions.
3 changes: 2 additions & 1 deletion bitnami/redis-cluster/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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

34 changes: 6 additions & 28 deletions bitnami/redis-cluster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand Down Expand Up @@ -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).
Expand Down
189 changes: 0 additions & 189 deletions bitnami/redis-cluster/templates/init-cluster.yaml

This file was deleted.

20 changes: 17 additions & 3 deletions bitnami/redis-cluster/templates/redis-statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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 }}"
Expand Down
Loading

0 comments on commit d1e367b

Please sign in to comment.