How to choose dependency release name for custom Helm 3 chart

4/1/2020

The syntax for adding a dependency to a helm 3 chart looks like this (inside of chart.yaml).
How can you specify a release name if you need multiple instances of a dependency?

apiVersion: v2
name: shared
description: Ingress Controller and Certificate Manager
type: application
version: 0.1.1
appVersion: 0.1.0

dependencies:
  - name: cert-manager
    version: ~0.13
    repository: https://charts.jetstack.io    

In the CLI it's just helm upgrade -i RELEASE_NAME CHART_NAME -n NAMESPACE But inside of Chart.yaml the option to specify a release seems to be missing.

The next question I have is if there's a weird way to do it, how would you write the values for each instance in the values.yaml file?

-- Stephen
kubernetes
kubernetes-helm

1 Answer

4/1/2020

After 5 more minutes of searching I found that there's an alias field that can be added, like so:

dependencies:
  - name: cert-manager
    alias: first-one
    version: ~0.13
    repository: https://charts.jetstack.io
  - name: cert-manager
    alias: second-one
    version: ~0.13
    repository: https://charts.jetstack.io 

And in the values.yaml file

first-one:
    # values go here

second-one:
    # values go here

Reference https://helm.sh/docs/topics/charts/#the-chartyaml-file

Using cert-manager is just an example, I can't think of a use-case that would need two instances of that particular chart. I'm hoping to use it for brigade projects

-- Stephen
Source: StackOverflow