49

I have added mysql in requirements.yaml. Helm dependency downloads the mysql chart

helm dependency update
Hang tight while we grab the latest from your chart repositories...
...Successfully got an update from the "nginx" chart repository
...Successfully got an update from the "stable" chart repository

Update Complete. ⎈Happy Helming!⎈
Saving 1 charts
Downloading mysql from repo <our private repository>
Deleting outdated charts

But when I do helm install my_app_chart ../my_app_chart It gives error

Error: found in Chart.yaml, but missing in charts/ directory: mysql
Komal Kadam
  • 808
  • 1
  • 7
  • 18

3 Answers3

107

You don't have to add it to the control version system, you just download them again if for some reason you have lost them (for example when you clone the repository). To do this, execute the command:

helm dependency update

The above command will download the dependencies you've defined in the requirements.yaml file or dependencies entry in Chart.yaml to the charts folder. This way, requirements are updated and you'll have the correct dependencies without worrying about if you updated them also in the control version system.

PhoneixS
  • 10,574
  • 6
  • 57
  • 73
  • 5
    Remember to run this after 'cd' ing into your helm chart dir. Else it might throw an error like: Error: validation: chart.metadata is required – EFreak Sep 01 '20 at 18:56
  • I have the same issue in `helm install --set cp-zookeeper.enabled=false,cp-zookeeper.url="unhinged-robin-cp-zookeeper-headless:2181" cp-helm-charts/charts/cp-kafka`. I have removed requirements.yaml. and it solved – NIrav Modi Mar 22 '21 at 11:48
13

I updated .helmignore

# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
charts/

It contained charts/ I removed the entry and it worked

# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
Komal Kadam
  • 808
  • 1
  • 7
  • 18
  • 5
    Just so it helps others, I had `*.tgz` in .helmignore – Ashvjit Singh Feb 22 '21 at 12:32
  • Confirming what @AshvjitSingh said. I also had `*.tgz` and could not run `helm package .` until I removed it. I also don't have `charts/` in `.helmignore`. – wsams Mar 03 '21 at 18:17
  • 1
    This solved the issue for me. – Vishrant Jan 25 '22 at 23:25
  • This is a wrong way of doing it *.tgz should never be pushed in. You must adjust your chart as shown by @Affes Salem then perform helm dependency update as should by PhoneixS. – Sanjeev Jan 27 '23 at 13:31
4

I have encountred the same error message when I first started learning how to use libcharts, I used chart.yaml to specify the dependency of the libchart like so:

chart.yaml

...
dependencies:
  - name: mylibchart
    version: 0.1.0
    repository: file://path/to/libchart

and in that libchart chart.yaml data was like this:

apiVersion: v2
name: lib <-- this was causing the error to occur (should be mylibchart instead)
description: A Helm chart for Kubernetes
type: library
version: 0.1.0
appVersion: "1.16.0"

so as you can see the name specified in the dependencies has to be the same name of the chart/libchart.

Affes Salem
  • 1,303
  • 10
  • 26
  • 1
    Thanks @Affes Salem. This is exactly the issue I had and its hard to diagnose since the error and even debugging give no clues to this. – Giles Knap May 20 '22 at 07:13
  • Glad that helped, also starting working with chart dependencies, make sure to try things test and troubleshoot by yourself on a separate dir/new_project to get an idea about what's going on (that's the approach I follow using helm), you can also find more in the [helm_dependency docs](https://helm.sh/docs/helm/helm_dependency/) – Affes Salem May 20 '22 at 13:01