Skip to content

Commit

Permalink
AP-4505: Match redis chart hostname logic
Browse files Browse the repository at this point in the history
Use a different redis host name depending on whether the
release name contains the name of the chart, "redis".

TODO: if cloud-platform-tools image is update to helm 3.7+, currently 3.6+
we could use a `Subcharts` references in a helper as below instead.

```yaml
{{/*
Function to return the name for a UAT redis chart master node host
*/}}
{{- define "apply-for-legal-aid.redis-uat-host" -}}
  {{- $redis_fullName := (include "common.names.fullname" .Subcharts.redis) -}}
  {{- $redis_cluster_domain := "cluster.local" -}}
  {{- printf "%s-master.%s.svc.%s" $redis_fullName .Release.Namespace $redis_cluster_domain -}}
{{- end -}}
```
  • Loading branch information
jsugarman committed Oct 18, 2023
1 parent ec6728c commit c78a005
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion helm_deploy/apply-for-legal-aid/templates/_envs.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,11 @@ env:
- name: REDIS_PROTOCOL
value: "redis"
- name: REDIS_HOST
value: {{ printf "%s-%s.%s.%s" .Release.Name "master" .Release.Namespace "svc.cluster.local" }}
{{ if contains "redis" .Release.Name }}
value: {{ printf "%s-master.%s.svc.cluster.local" .Release.Name .Release.Namespace }}
{{ else }}
value: {{ printf "%s-redis-master.%s.svc.cluster.local" .Release.Name .Release.Namespace }}
{{ end }}
- name: REDIS_PASSWORD
valueFrom:
secretKeyRef:
Expand Down

0 comments on commit c78a005

Please sign in to comment.