Skip to content

Commit af6e9e1

Browse files
author
John T Skarbek
committed
rename param, create a helper, document in README
1 parent 9ba126d commit af6e9e1

File tree

5 files changed

+19
-12
lines changed

5 files changed

+19
-12
lines changed

bitnami/redis/README.md

+2
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,8 @@ The command removes all the Kubernetes components associated with the chart and
8686
| `diagnosticMode.enabled` | Enable diagnostic mode (all probes will be disabled and the command will be overridden) | `false` |
8787
| `diagnosticMode.command` | Command to override all containers in the deployment | `["sleep"]` |
8888
| `diagnosticMode.args` | Args to override all containers in the deployment | `["infinity"]` |
89+
| `useExternalDNS.enabled` | Enable various syntax that would enable external-dns to work. Note this requires a working installation of `external-dns` to be usable. | `false` |
90+
| `useExternalDNS.suffix` | The DNS suffix utilized when `external-dns` is enabled. Note that we prepend the suffix with the full name of the install. | `""` |
8991

9092

9193
### Redis™ Image parameters

bitnami/redis/templates/_helpers.tpl

+5
Original file line numberDiff line numberDiff line change
@@ -274,3 +274,8 @@ redis: tls.enabled
274274
enable auto-generated certificates.
275275
{{- end -}}
276276
{{- end -}}
277+
278+
{{/* Define the suffix utilized for external-dns */}}
279+
{{- define "redis.externalDNS.suffix" -}}
280+
{{ printf "%s.%s" (include "common.names.fullname" .) .Values.useExternalDNS.suffix }}
281+
{{- end -}}

bitnami/redis/templates/headless-svc.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ metadata:
1111
{{- if .Values.commonAnnotations }}
1212
{{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
1313
{{- end }}
14-
{{- if .Values.externalDNS.enabled }}
15-
external-dns.alpha.kubernetes.io/hostname: {{ printf "%s.%s" (include "common.names.fullname" .) .Values.externalDNS.suffix }}
14+
{{- if .Values.useExternalDNS.enabled }}
15+
external-dns.alpha.kubernetes.io/hostname: {{ include "redis.externalDNS.suffix" . }}
1616
{{- end }}
1717
spec:
1818
type: ClusterIP

bitnami/redis/templates/scripts-configmap.yaml

+8-8
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ data:
4343
get_full_hostname() {
4444
hostname="$1"
4545
46-
{{- if .Values.externalDNS.enabled }}
47-
echo "${hostname}.{{- printf "%s.%s" (include "common.names.fullname" .) .Values.externalDNS.suffix }}"
46+
{{- if .Values.useExternalDNS.enabled }}
47+
echo "${hostname}.{{- include "redis.externalDNS.suffix" . }}"
4848
{{- else if eq .Values.sentinel.service.type "NodePort" }}
4949
echo "${hostname}.{{- .Release.Namespace }}"
5050
{{- else }}
@@ -250,8 +250,8 @@ data:
250250
get_full_hostname() {
251251
hostname="$1"
252252
253-
{{- if .Values.externalDNS.enabled }}
254-
echo "${hostname}.{{- printf "%s.%s" (include "common.names.fullname" .) .Values.externalDNS.suffix }}"
253+
{{- if .Values.useExternalDNS.enabled }}
254+
echo "${hostname}.{{- include "redis.externalDNS.suffix" . }}"
255255
{{- else if eq .Values.sentinel.service.type "NodePort" }}
256256
echo "${hostname}.{{- .Release.Namespace }}"
257257
{{- else }}
@@ -400,8 +400,8 @@ data:
400400
get_full_hostname() {
401401
hostname="$1"
402402
403-
{{- if .Values.externalDNS.enabled }}
404-
echo "${hostname}.{{- printf "%s.%s" (include "common.names.fullname" .) .Values.externalDNS.suffix }}"
403+
{{- if .Values.useExternalDNS.enabled }}
404+
echo "${hostname}.{{- include "redis.externalDNS.suffix" . }}"
405405
{{- else if eq .Values.sentinel.service.type "NodePort" }}
406406
echo "${hostname}.{{- .Release.Namespace }}"
407407
{{- else }}
@@ -547,8 +547,8 @@ data:
547547
get_full_hostname() {
548548
hostname="$1"
549549
550-
{{- if .Values.externalDNS.enabled }}
551-
echo "${hostname}.{{- printf "%s.%s" (include "common.names.fullname" .) .Values.externalDNS.suffix }}"
550+
{{- if .Values.useExternalDNS.enabled }}
551+
echo "${hostname}.{{- include "redis.externalDNS.suffix" . }}"
552552
{{- else if eq .Values.sentinel.service.type "NodePort" }}
553553
echo "${hostname}.{{- .Release.Namespace }}"
554554
{{- else }}

bitnami/redis/values.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ global:
2323
## @section Common parameters
2424
##
2525

26-
## @param externalDNS Boolean to indicate the desire to utilize `external-dns`
26+
## @param useExternalDNS Boolean to indicate the desire to utilize `external-dns`
2727
##
28-
externalDNS:
28+
useExternalDNS:
2929
enabled: false
3030
# suffix: ""
3131

0 commit comments

Comments
 (0)