I have a need to move my chart from an umbrella system to use one universal subchart, so as not to spawn identical subcharts that differ only in some values. I have left this chart identical to my previous subcharts using the umbrella system. In values.yaml the example of values for a certain service looks like this.
service1:
enabled: true
env:
# List of envs
service:
# List of specific params
Chart.yaml of the general chart looks like this.
apiVersion: v2
name: meta-chart
description: A Helm chart for Kubernetes
type: application
version: 1.0.0
appVersion: "1.0.0"
dependencies:
- name: template-service
alias: service1
condition: service1.enabled
- name: template-service
alias: service2
condition: service2.enabled
- name: template-service
alias: service3
condition: service3.enabled
- name: template-service
alias: service4
condition: service4.enabled
Issue: The helm template command works correctly. However, the result I get is not what I expected. Instead of an identical list as with the umbrella chart, I only get the resources of this template-service
as output. Where is the error in my solution? Let me also clarify that I am calling the helm template to test the following command (I am passing two value files, one of which is generic for general settings, not service-specific, and does not contain a service-specific name or alias section).
The command for the helm template:
helm template release services/ -f services/values.common.yaml -f services/values.dev1.yaml -f services/secrets/secrets.dev1.yaml.enc
UPD1: I found a similar problem in issues, and the author it solved when added a version to each dependency. I also tried adding a version, but it didn’t work for me.
3
The problem was this. My charts directory was missing Chart.lock
, which was causing the alias property to be ignored. Adding a Chart.lock
file to the charts directory helped solve the problem. Although it is still strange that before using the umbrella system everything worked correctly without this file.