Skip to content

Demonstration of the Flawed Dependency Management in Kubernetes Helm

Notifications You must be signed in to change notification settings

apeschel/helm-dependency-problem

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Overview

This repository exists to demonstrate a flaw with Helm's recursive dependency management.

Currently, Helm will generate a set of resources for every dependency listed in the chart tree. Unfortunately, this causes breakage when the same dependency is listed multiple times.

As a workaround, one can only have dependencies listed in the umbrella and leave them out of the subcharts, but this removes the ability to develop and test the subcharts as separate entities from the umbrella.

It would make more sense for Helm to identify the overlapping dependencies and only generate a single set of resources for all the charts to use.

Example

Imagine an application stack with two services that want to access the same database. If you place each service in its own chart and use an umbrella chart to combine them, you will end up with the following hierarchy:

umbrella
├── helpers
├── mariadb (sampledb)
├── subchart1
│   ├── helpers
│   └── mariadb (sampledb)
└── subchart2
    ├── helpers
    └── mariadb (sampledb)

Both subchart1 and subchart2 work fine on their own. However, when they are both included with the umbrella chart, a collision occurs.

$ helm dep build subchart1
$ helm dep build subchart2
$ helm dep build umbrella
$ helm install --debug --dry-run ./umbrella |
    grep Source |
    sed 's!.*[ /]\([^/]*/templates/.*\.yaml\)$!\1!' |
    sort |
    uniq -c

   3 sampledb/templates/configmap.yaml
   3 sampledb/templates/deployment.yaml
   3 sampledb/templates/pvc.yaml
   3 sampledb/templates/secrets.yaml
   3 sampledb/templates/svc.yaml
   1 subchart1/templates/configmap.yaml
   1 subchart2/templates/configmap.yaml

Trying to install this umbrella package will cause an error due to duplicated resources.

$ helm install --debug ./umbrella
Error: release quoting-possum failed: secrets "quoting-possum-sampledb" already exists

About

Demonstration of the Flawed Dependency Management in Kubernetes Helm

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages