|
| 1 | +CHART NAME: {{ .Chart.Name }} |
| 2 | +CHART VERSION: {{ .Chart.Version }} |
| 3 | +APP VERSION: {{ .Chart.AppVersion }} |
| 4 | + |
| 5 | +⚠ WARNING: Since August 28th, 2025, only a limited subset of images/charts are available for free. |
| 6 | + Subscribe to Bitnami Secure Images to receive continued support and security updates. |
| 7 | + More info at https://bitnami.com and https://github.com/bitnami/containers/issues/83267 |
| 8 | + |
| 9 | +** Please be patient while the chart is being deployed ** |
| 10 | + |
| 11 | +{{- if .Values.diagnosticMode.enabled }} |
| 12 | +The chart has been deployed in diagnostic mode. All probes have been disabled and the command has been overwritten with: |
| 13 | + |
| 14 | + command: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.command "context" $) | nindent 4 }} |
| 15 | + args: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.args "context" $) | nindent 4 }} |
| 16 | + |
| 17 | +Get the list of pods by executing: |
| 18 | + |
| 19 | + kubectl get pods --namespace {{ include "common.names.namespace" . }} -l app.kubernetes.io/instance={{ .Release.Name }} |
| 20 | + |
| 21 | +Access the pod you want to debug by executing |
| 22 | + |
| 23 | + kubectl exec --namespace {{ include "common.names.namespace" . }} -ti <NAME OF THE POD> -- bash |
| 24 | + |
| 25 | +In order to replicate the container startup scripts execute this command: |
| 26 | + |
| 27 | +For Redis: |
| 28 | + |
| 29 | + /opt/bitnami/scripts/redis/entrypoint.sh /opt/bitnami/scripts/redis/run.sh |
| 30 | + |
| 31 | +{{- if .Values.sentinel.enabled }} |
| 32 | + |
| 33 | +For Redis Sentinel: |
| 34 | + |
| 35 | + /opt/bitnami/scripts/redis-sentinel/entrypoint.sh /opt/bitnami/scripts/redis-sentinel/run.sh |
| 36 | + |
| 37 | +{{- end }} |
| 38 | +{{- else }} |
| 39 | + |
| 40 | +{{- if contains .Values.master.service.type "LoadBalancer" }} |
| 41 | +{{- if not .Values.auth.enabled }} |
| 42 | +{{ if and (not .Values.networkPolicy.enabled) (.Values.networkPolicy.allowExternal) }} |
| 43 | + |
| 44 | +------------------------------------------------------------------------------- |
| 45 | + WARNING |
| 46 | + |
| 47 | + By specifying "master.service.type=LoadBalancer" and "auth.enabled=false" you have |
| 48 | + most likely exposed the Redis® service externally without any authentication |
| 49 | + mechanism. |
| 50 | + |
| 51 | + For security reasons, we strongly suggest that you switch to "ClusterIP" or |
| 52 | + "NodePort". As alternative, you can also switch to "auth.enabled=true" |
| 53 | + providing a valid password on "password" parameter. |
| 54 | + |
| 55 | +------------------------------------------------------------------------------- |
| 56 | +{{- end }} |
| 57 | +{{- end }} |
| 58 | +{{- end }} |
| 59 | + |
| 60 | +{{- if and .Values.auth.enabled .Values.auth.usePasswordFiles (not .Values.auth.usePasswordFileFromSecret) (or (empty .Values.master.initContainers) (empty .Values.replica.initContainers)) }} |
| 61 | + |
| 62 | +------------------------------------------------------------------------------- |
| 63 | + WARNING |
| 64 | + |
| 65 | + By specifying ".Values.auth.usePasswordFiles=true" and ".Values.auth.usePasswordFileFromSecret=false" |
| 66 | + Redis is expecting that the password is mounted as a file in each pod |
| 67 | + (by default in /opt/bitnami/redis/secrets/redis-password) |
| 68 | + |
| 69 | + Ensure that you specify the respective initContainers in |
| 70 | + both .Values.master.initContainers and .Values.replica.initContainers |
| 71 | + in order to populate the contents of this file. |
| 72 | + |
| 73 | +------------------------------------------------------------------------------- |
| 74 | +{{- end }} |
| 75 | + |
| 76 | +{{- if eq .Values.architecture "replication" }} |
| 77 | +{{- if .Values.sentinel.enabled }} |
| 78 | + |
| 79 | +Redis® can be accessed via port {{ .Values.sentinel.service.ports.redis }} on the following DNS name from within your cluster: |
| 80 | + |
| 81 | + {{ template "common.names.fullname" . }}.{{ include "common.names.namespace" . }}.svc.{{ .Values.clusterDomain }} for read only operations |
| 82 | + |
| 83 | +For read/write operations, first access the Redis® Sentinel cluster, which is available in port {{ .Values.sentinel.service.ports.sentinel }} using the same domain name above. |
| 84 | + |
| 85 | +{{- else }} |
| 86 | + |
| 87 | +Redis® can be accessed on the following DNS names from within your cluster: |
| 88 | + |
| 89 | + {{ printf "%s-master.%s.svc.%s" (include "common.names.fullname" .) (include "common.names.namespace" . ) .Values.clusterDomain }} for read/write operations (port {{ .Values.master.service.ports.redis }}) |
| 90 | + {{ printf "%s-replicas.%s.svc.%s" (include "common.names.fullname" .) (include "common.names.namespace" . ) .Values.clusterDomain }} for read-only operations (port {{ .Values.replica.service.ports.redis }}) |
| 91 | + |
| 92 | +{{- end }} |
| 93 | +{{- else }} |
| 94 | + |
| 95 | +Redis® can be accessed via port {{ .Values.master.service.ports.redis }} on the following DNS name from within your cluster: |
| 96 | + |
| 97 | + {{ template "common.names.fullname" . }}-master.{{ include "common.names.namespace" . }}.svc.{{ .Values.clusterDomain }} |
| 98 | + |
| 99 | +{{- end }} |
| 100 | + |
| 101 | +{{ if .Values.auth.enabled }} |
| 102 | + |
| 103 | +To get your password run: |
| 104 | + |
| 105 | + export REDIS_PASSWORD=$(kubectl get secret --namespace {{ include "common.names.namespace" . }} {{ template "redis.secretName" . }} -o jsonpath="{.data.redis-password}" | base64 -d) |
| 106 | + |
| 107 | +{{- end }} |
| 108 | + |
| 109 | +To connect to your Redis® server: |
| 110 | + |
| 111 | +1. Run a Redis® pod that you can use as a client: |
| 112 | + |
| 113 | + kubectl run --namespace {{ include "common.names.namespace" . }} redis-client --restart='Never' {{ if .Values.auth.enabled }} --env REDIS_PASSWORD=$REDIS_PASSWORD {{ end }} --image {{ template "redis.image" . }} --command -- sleep infinity |
| 114 | + |
| 115 | +{{- if .Values.tls.enabled }} |
| 116 | + |
| 117 | + Copy your TLS certificates to the pod: |
| 118 | + |
| 119 | + kubectl cp --namespace {{ include "common.names.namespace" . }} /path/to/client.cert redis-client:/tmp/client.cert |
| 120 | + kubectl cp --namespace {{ include "common.names.namespace" . }} /path/to/client.key redis-client:/tmp/client.key |
| 121 | + kubectl cp --namespace {{ include "common.names.namespace" . }} /path/to/CA.cert redis-client:/tmp/CA.cert |
| 122 | + |
| 123 | +{{- end }} |
| 124 | + |
| 125 | + Use the following command to attach to the pod: |
| 126 | + |
| 127 | + kubectl exec --tty -i redis-client \ |
| 128 | + {{- if and (.Values.networkPolicy.enabled) (not .Values.networkPolicy.allowExternal) }}--labels="{{ template "common.names.fullname" . }}-client=true" \{{- end }} |
| 129 | + --namespace {{ include "common.names.namespace" . }} -- bash |
| 130 | + |
| 131 | +2. Connect using the Redis® CLI: |
| 132 | + |
| 133 | +{{- if eq .Values.architecture "replication" }} |
| 134 | + {{- if .Values.sentinel.enabled }} |
| 135 | + {{ if .Values.auth.enabled }}REDISCLI_AUTH="$REDIS_PASSWORD" {{ end }}redis-cli -h {{ template "common.names.fullname" . }} -p {{ .Values.sentinel.service.ports.redis }}{{ if .Values.tls.enabled }} --tls --cert /tmp/client.cert --key /tmp/client.key --cacert /tmp/CA.cert{{ end }} # Read only operations |
| 136 | + {{ if .Values.auth.enabled }}REDISCLI_AUTH="$REDIS_PASSWORD" {{ end }}redis-cli -h {{ template "common.names.fullname" . }} -p {{ .Values.sentinel.service.ports.sentinel }}{{ if .Values.tls.enabled }} --tls --cert /tmp/client.cert --key /tmp/client.key --cacert /tmp/CA.cert{{ end }} # Sentinel access |
| 137 | + {{- else }} |
| 138 | + {{ if .Values.auth.enabled }}REDISCLI_AUTH="$REDIS_PASSWORD" {{ end }}redis-cli -h {{ printf "%s-master" (include "common.names.fullname" .) }}{{ if .Values.tls.enabled }} --tls --cert /tmp/client.cert --key /tmp/client.key --cacert /tmp/CA.cert{{ end }} |
| 139 | + {{ if .Values.auth.enabled }}REDISCLI_AUTH="$REDIS_PASSWORD" {{ end }}redis-cli -h {{ printf "%s-replicas" (include "common.names.fullname" .) }}{{ if .Values.tls.enabled }} --tls --cert /tmp/client.cert --key /tmp/client.key --cacert /tmp/CA.cert{{ end }} |
| 140 | + {{- end }} |
| 141 | +{{- else }} |
| 142 | + {{ if .Values.auth.enabled }}REDISCLI_AUTH="$REDIS_PASSWORD" {{ end }}redis-cli -h {{ template "common.names.fullname" . }}-master{{ if .Values.tls.enabled }} --tls --cert /tmp/client.cert --key /tmp/client.key --cacert /tmp/CA.cert{{ end }} |
| 143 | +{{- end }} |
| 144 | + |
| 145 | +{{- if and (.Values.networkPolicy.enabled) (not .Values.networkPolicy.allowExternal) }} |
| 146 | + |
| 147 | +Note: Since NetworkPolicy is enabled, only pods with label {{ template "common.names.fullname" . }}-client=true" will be able to connect to redis. |
| 148 | + |
| 149 | +{{- else }} |
| 150 | + |
| 151 | +To connect to your database from outside the cluster execute the following commands: |
| 152 | + |
| 153 | +{{- if and (eq .Values.architecture "replication") .Values.sentinel.enabled }} |
| 154 | +{{- if contains "NodePort" .Values.sentinel.service.type }} |
| 155 | + |
| 156 | + export NODE_IP=$(kubectl get nodes --namespace {{ include "common.names.namespace" . }} -o jsonpath="{.items[0].status.addresses[0].address}") |
| 157 | + export NODE_PORT=$(kubectl get --namespace {{ include "common.names.namespace" . }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ template "common.names.fullname" . }}) |
| 158 | + {{ if .Values.auth.enabled }}REDISCLI_AUTH="$REDIS_PASSWORD" {{ end }}redis-cli -h $NODE_IP -p $NODE_PORT {{- if .Values.tls.enabled }} --tls --cert /tmp/client.cert --key /tmp/client.key --cacert /tmp/CA.cert{{ end }} |
| 159 | + |
| 160 | +{{- else if contains "LoadBalancer" .Values.sentinel.service.type }} |
| 161 | + |
| 162 | + NOTE: It may take a few minutes for the LoadBalancer IP to be available. |
| 163 | + Watch the status with: 'kubectl get svc --namespace {{ include "common.names.namespace" . }} -w {{ template "common.names.fullname" . }}' |
| 164 | + |
| 165 | + export SERVICE_IP=$(kubectl get svc --namespace {{ include "common.names.namespace" . }} {{ template "common.names.fullname" . }} --template "{{ "{{ range (index .status.loadBalancer.ingress 0) }}{{ . }}{{ end }}" }}") |
| 166 | + {{ if .Values.auth.enabled }}REDISCLI_AUTH="$REDIS_PASSWORD" {{ end }}redis-cli -h $SERVICE_IP -p {{ .Values.sentinel.service.ports.redis }} {{- if .Values.tls.enabled }} --tls --cert /tmp/client.cert --key /tmp/client.key --cacert /tmp/CA.cert{{ end }} |
| 167 | + |
| 168 | +{{- else if contains "ClusterIP" .Values.sentinel.service.type }} |
| 169 | + |
| 170 | + kubectl port-forward --namespace {{ include "common.names.namespace" . }} svc/{{ template "common.names.fullname" . }} {{ .Values.sentinel.service.ports.redis }}:{{ .Values.sentinel.service.ports.redis }} & |
| 171 | + {{ if .Values.auth.enabled }}REDISCLI_AUTH="$REDIS_PASSWORD" {{ end }}redis-cli -h 127.0.0.1 -p {{ .Values.sentinel.service.ports.redis }} {{- if .Values.tls.enabled }} --tls --cert /tmp/client.cert --key /tmp/client.key --cacert /tmp/CA.cert{{ end }} |
| 172 | + |
| 173 | +{{- end }} |
| 174 | +{{- else }} |
| 175 | +{{- if contains "NodePort" .Values.master.service.type }} |
| 176 | + |
| 177 | + export NODE_IP=$(kubectl get nodes --namespace {{ include "common.names.namespace" . }} -o jsonpath="{.items[0].status.addresses[0].address}") |
| 178 | + export NODE_PORT=$(kubectl get --namespace {{ include "common.names.namespace" . }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ printf "%s-master" (include "common.names.fullname" .) }}) |
| 179 | + {{ if .Values.auth.enabled }}REDISCLI_AUTH="$REDIS_PASSWORD" {{ end }}redis-cli -h $NODE_IP -p $NODE_PORT {{- if .Values.tls.enabled }} --tls --cert /tmp/client.cert --key /tmp/client.key --cacert /tmp/CA.cert{{ end }} |
| 180 | + |
| 181 | +{{- else if contains "LoadBalancer" .Values.master.service.type }} |
| 182 | + |
| 183 | + NOTE: It may take a few minutes for the LoadBalancer IP to be available. |
| 184 | + Watch the status with: 'kubectl get svc --namespace {{ include "common.names.namespace" . }} -w {{ template "common.names.fullname" . }}' |
| 185 | + |
| 186 | + export SERVICE_IP=$(kubectl get svc --namespace {{ include "common.names.namespace" . }} {{ printf "%s-master" (include "common.names.fullname" .) }} --template "{{ "{{ range (index .status.loadBalancer.ingress 0) }}{{ . }}{{ end }}" }}") |
| 187 | + {{ if .Values.auth.enabled }}REDISCLI_AUTH="$REDIS_PASSWORD" {{ end }}redis-cli -h $SERVICE_IP -p {{ .Values.master.service.ports.redis }} {{- if .Values.tls.enabled }} --tls --cert /tmp/client.cert --key /tmp/client.key --cacert /tmp/CA.cert{{ end }} |
| 188 | + |
| 189 | +{{- else if contains "ClusterIP" .Values.master.service.type }} |
| 190 | + |
| 191 | + kubectl port-forward --namespace {{ include "common.names.namespace" . }} svc/{{ printf "%s-master" (include "common.names.fullname" .) }} {{ .Values.master.service.ports.redis }}:{{ .Values.master.service.ports.redis }} & |
| 192 | + {{ if .Values.auth.enabled }}REDISCLI_AUTH="$REDIS_PASSWORD" {{ end }}redis-cli -h 127.0.0.1 -p {{ .Values.master.service.ports.redis }} {{- if .Values.tls.enabled }} --tls --cert /tmp/client.cert --key /tmp/client.key --cacert /tmp/CA.cert{{ end }} |
| 193 | + |
| 194 | +{{- end }} |
| 195 | +{{- end }} |
| 196 | + |
| 197 | +{{- end }} |
| 198 | +{{- end }} |
| 199 | +{{- include "redis.checkRollingTags" . }} |
| 200 | +{{- include "common.warnings.rollingTag" .Values.volumePermissions.image }} |
| 201 | +{{- include "common.warnings.rollingTag" .Values.sysctl.image }} |
| 202 | +{{- include "redis.validateValues" . }} |
| 203 | + |
| 204 | +{{- if and (eq .Values.architecture "replication") .Values.sentinel.enabled (eq .Values.sentinel.service.type "NodePort") (not .Release.IsUpgrade ) }} |
| 205 | +{{- if $.Values.sentinel.service.nodePorts.sentinel }} |
| 206 | +No need to upgrade, ports and nodeports have been set from values |
| 207 | +{{- else }} |
| 208 | +#!#!#!#!#!#!#!# IMPORTANT #!#!#!#!#!#!#!# |
| 209 | +YOU NEED TO PERFORM AN UPGRADE FOR THE SERVICES AND WORKLOAD TO BE CREATED |
| 210 | +{{- end }} |
| 211 | +{{- end }} |
| 212 | +{{- $resourceSections := list "metrics" "replica" "sentinel" "sysctl" "volumePermissions" }} |
| 213 | +{{- if not (and (eq .Values.architecture "replication") .Values.sentinel.enabled) }} |
| 214 | + {{- $resourceSections = append $resourceSections "master" -}} |
| 215 | +{{- end }} |
| 216 | +{{- include "common.warnings.resources" (dict "sections" $resourceSections "context" $) }} |
| 217 | +{{- include "common.warnings.modifiedImages" (dict "images" (list .Values.image .Values.sentinel.image .Values.metrics.image .Values.volumePermissions.image .Values.kubectl.image .Values.sysctl.image) "context" $) }} |
| 218 | +{{- include "common.errors.insecureImages" (dict "images" (list .Values.image .Values.sentinel.image .Values.metrics.image .Values.volumePermissions.image .Values.kubectl.image .Values.sysctl.image) "context" $) }} |
0 commit comments