Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get the name of a child chart with Helm?

I have a helm chart that requires stable/redis as a child chart. The parent chart needs to expose the redis service as an environment variable.

The redis chart includes a template called redis.fullname. How can I refer to this in my parent chart? I.e. I want something like this in my parent deployment but it doesn't work:

kind: Deployment
spec:
  template:
    containers:
        env:
        - name: REDIS_CLUSTER_SERVICE_HOST
          value: {{ template "redis.fullname" . }}
like image 702
jbrown Avatar asked Dec 08 '17 13:12

jbrown


1 Answers

You can use '{{ .Release.Name }}-redis' in your parent chart. I had same requirement. This is my example in case you want to take a look ->https://github.com/kubernetes/charts/tree/master/incubator/distribution

like image 186
Jainish Shah Avatar answered Oct 28 '22 07:10

Jainish Shah