helm chart with requirements.yaml, did not find local charts

2/19/2019

my charts has elasticsearch and mongdb dependencies, and in my charts, the structure like this:

├── [-rw-rw-r--]  Chart.yaml
├── [drwxrwxr-x]  dependency_charts
│   ├── [drwxrwxr-x]  elasticsearch
│   └── [drwxrwxr-x]  mongodb
├── [-rw-rw-r--]  deploy.sh
├── [-rw-rw-r--]  requirements.yaml
├── [-rw-rw-r--]  values.yaml
├── [drwxrwxr-x]  templates
│   ├── [-rw-rw-r--]  proj-deploy.yaml
│   └── [-rw-rw-r--]  proj-svc.yaml

but when I try to install my chart, it will say:

Error: found in requirements.yaml, but missing in charts/ directory: elasticsearch, mongodb

and when I execute helm dep ls, it show status missing

$ helm dep list
NAME            VERSION REPOSITORY                              STATUS
elasticsearch   6.5.1   file://dependency_charts/elasticsearch  missing
mongodb         4.0.3   file://dependency_charts/mongodb        missing

the version is appVersion, and I have also change the version to chart version, it doesn't work.

this is the official document: https://github.com/helm/helm/blob/master/docs/helm/helm_dependency.md https://docs.helm.sh/chart_best_practices/#repository-urls

this is helm version

$ helm version
Client: &version.Version{SemVer:"v2.10.0", GitCommit:"9ad53aac42165a5fadc6c87be0dea6b115f93090", GitTreeState:"clean"}
Server: &version.Version{SemVer:"v2.10.0", GitCommit:"9ad53aac42165a5fadc6c87be0dea6b115f93090", GitTreeState:"clean"}

And I can put those chart to a charts folder, but if I do that, helm will install mongodb and elasticsearch in the same charts, that's not expected, what I'm expecting is under the same namespace has three charts: myproj, elasticsearch, mongodb.

Anyone got a clue about what I do wrong? Thanks.

-- jolla
kubernetes-helm

3 Answers

2/26/2019

You have to run helm dep update. This will put subcharts into the ./charts folder and create ./requirements.lock file. Then you can install.

-- abinet
Source: StackOverflow

1/17/2020
helm dep update

only works when the repo list is empty. Check helm repo list , if this return something then local dependencies will not resolve. Try removing the repos using command helm repo remove REPO_NAME

-- Shivang Gupta
Source: StackOverflow

2/20/2019

... what I'm expecting is under the same namespace has three charts: myproj, elasticsearch, mongodb.

You need to run helm install three separate times to get that effect.


The requirements.yaml mechanism causes Helm to install multiple sub-charts in a single Helm release. helm list would just show myproj, but internally it would also have the Kubernetes resources for the other components. If you kubectl get service then you'd see Service objects like unusual-animal-myproj and unusual-animal-mongodb, managed by the same Helm release. If you helm del unusual-animal, it would delete all three components together.

If that's the behavior you want, then the error message you got means what it says: the local charts must be in a subdirectory named exactly charts. Running helm dep up or helm dep build will copy them there.

-- David Maze
Source: StackOverflow