helm: found in Chart.yaml, but missing in charts/ directory: postgresql, - kubernetes

I try to follow the kubernetes install README of ReportPortal
guettli#yoga15:~/projects/reportportal-kubernetes/reportportal$ mv v5 reportportal
guettli#yoga15:~/projects/reportportal-kubernetes/reportportal$ helm install ./reportportal
Error: must either provide a name or specify --generate-name
guettli#yoga15:~/projects/reportportal-kubernetes/reportportal$ helm install ./reportportal --generate-name
Error: found in Chart.yaml, but missing in charts/ directory: postgresql, rabbitmq-ha, elasticsearch, minio
Here is the v5 directory.
What needs to be done now?

I found the solution:
cd reportportal
helm dependency update

Adding a bit of a background.
Chart dependencies that are specified in the Chart.yaml should be download to disk before executing the installation of the parent chart.
This is done by helm dependency update which verifies that the required charts, as expressed in Chart.yaml, are present in charts/ and are at an acceptable version.
It will pull down the latest charts that satisfy the dependencies, and clean up old dependencies.

Related

How can I create my own helm chart package from the kube-prometheus-stack charts on github

I'm trying to create my own helm chart package for prometheus and its components but I am trying to reuse parts of the kube-prometheus-stack helm chart on github : https://github.com/prometheus-community/helm-charts/tree/main/charts/kube-prometheus-stack
I've modified the templates to my liking but when I try to create a package for them which I can then upload it to my repo I get the following :
helm package prometheus-chart/
Error: found in Chart.yaml, but missing in charts/ directory: alertmanager, kube-state-metrics, prometheus-node-exporter, prometheus-pushgateway
How can I get the templates from that repo, and create a deployable package from my local machine which I can then share it?
These components alertmanager, kube-state-metrics, prometheus-node-exporter, prometheus-pushgateway are added as dependencies in the Chart.yaml. So the helm will check whether these dependencies are built or not.
So you need to build the dependencies as well by using this command
$ helm dependency build CHARTNAME
Example:
$ helm dependency build alertmanager
Once the dependencies are built you can update them using update command
$ helm dependency update CHARTNAME
For more detailed information refer to this official documents doc1 doc2
There are dependencies added in the Chart.yml file that are not downloaded, you need to run the command helm dependency build <CHART> in order to fetch them

Confused with Helm dependency management

In my parent chart Chart.yaml I have
dependencies:
- name: postgresql11
repository: "#myrepo"
version: 8.9.7
condition: postgresql11.enabled
- name: postgresql12
repository: "#myrepo"
version: 8.9.7
condition: postgresql12.enabled
In the same parent chart values.yaml I have:
postgresql11:
enabled: true
postgresql12:
enabled: false
My problem is that unless I run helm dep update neither subchart is downloaded and installed (I'm expecting the postgresql11 subchart to be installed). If I run helm dep update both subcharts are pulled, ignoring my ruleset which indicates that only postgresql11 should be installed.
Can anybody shed some light on what I'm doing wrong here, and what the relationship is between helm dependency build/update and the conditional rules in Chart.yaml? I'm also curious why there is an enabled field in Chart.yaml which seems redundant with the condition field? I'm running Helm 3.2.4.
Thanks in advance!
The command helm dep update does not use values.yaml and that is why your dependencies are updated even if you have them disabled in values.yaml.
To understand the enabled for dependencies, read the section "Tags and Condition fields in dependencies" in the Helm: Charts documentation.
helm dependency update command will download all the subchart specified in the dependencies option and download it to the charts/ directory, even you have them disabled in values.yaml. However, only enabled charts will be installed.
To release the new changes/version you need to run the command helm upgrade <chart-name> <chart-dir-location>.
Please refer https://helm.sh/docs/helm/helm_upgrade/
Helm Dependency Update:
Update the on-disk dependencies to mirror Chart.yaml.
This command verifies that the required charts, as expressed in 'Chart.yaml', are present in 'charts/' and are at an acceptable version. It will pull down the latest charts that satisfy the dependencies, and clean up old dependencies.
On successful update, this will generate a lock file that can be used to rebuild the dependencies to an exact version.
Helm Dependency Build:
Build out the charts/ directory from the Chart.lock file.
Build is used to reconstruct a chart's dependencies to the state specified in the lock file. This will not re-negotiate dependencies, as 'helm dependency update' does.
If no lock file is found, 'helm dependency build' will mirror the behavior of 'helm dependency update'.

Error: found in Chart.yaml, but missing in charts/ directory: elasticsearch, kibana, filebeat, logstash

I would like to deploy elastic-stack into Kubernetes cluster. I git clone the chart, use default settings. But, I got errors.
git clone https://github.com/helm/charts
Create namespace
kubectl create namespace elastic-stack
At $HOME/charts
$ helm install elastic-stack stable/elastic-stack --namespace=elastic-stack
Error: found in Chart.yaml, but missing in charts/ directory: elasticsearch, kibana, filebeat, logstash, fluentd, fluent-bit, fluentd-elasticsearch, nginx-ldapauth-proxy, elasticsearch-curator, elasticsearch-exporter
helm version
version.BuildInfo{Version:"v3.3.0-rc.1"
Have you enabled the stable repo for helm ? you can check this by running helm repo list
If not, please add using helm repo add stable https://charts.helm.sh/stable

How to find the chart version of subcharts from a released helm chart?

I have installed a helm chart with subcharts and I want to find out which version of the subchart is installed. Is there any possible way in helm 3?
Following official Helm documentation:
Helm.sh: Subcharts and globals
Helm.sh: Charts
Helm.sh: Helm dependency
You can get the version of a subchart used by a chart by following below example:
Download the chart with $ helm pull repo/name --untar
Go inside the chart directory
Invoke command: $ helm dependency list
You can get a message that there are no dependencies:
WARNING: no dependencies at gce-ingress/charts
You can also get a message with dependencies and their versions:
NAME VERSION REPOSITORY STATUS
kube-state-metrics 2.7.* https://kubernetes-charts.storage.googleapis.com/ unpacked
Additionally you can check the content of the prometheus/charts/kube-state-metrics/Chart.yaml for additional information.
Please let me know if that helped you.

Error: found in requirements.yaml, but missing in charts/ directory: dependency-chart

I'm getting the following error
Error: found in requirements.yaml, but missing in charts/ directory: dependency-chart
when I try to install a chart. The chart has a dependency on dependency-chart.
requirements.yaml:
dependencies:
- name: dependency-chart
repository: "#some-repo"
version: 0.1.0
Commands performed:
rm -rf charts
helm dep up
helm upgrade --install chart-to-install . --debug
Output:
Hang tight while we grab the latest from your chart repositories...
...Successfully got an update from the "some-repo" chart repository
Update Complete. ⎈Happy Helming!⎈
Saving 1 charts
Downloading dependency-chart from repo gs://some-repo
Deleting outdated charts
[debug] Created tunnel using local port: '65477'
[debug] SERVER: "127.0.0.1:65477"
Error: found in requirements.yaml, but missing in charts/ directory: dependency-chart
charts/ directory contains dependency-chart-0.1.0.tgz
I have many other charts which depends on dependency-chart and they work just fine. helm lint does not help:
==> Linting .
[ERROR] Chart.yaml: directory name (helm) and chart name (dependency-chart) must be the same
[INFO] Chart.yaml: icon is recommended
[WARNING] templates/: directory not found
Error: 1 chart(s) linted, 1 chart(s) failed
The ERROR is reported by the linter in other charts where the helm install command works, so it's not really helping me.
I've tried to point to the local chart in the requirements.yaml instead of from the aliased repository, same result.
I've run out of things to try to debug the issue as well, any suggestion?
I've started debugging the Helm project locally and I stumbled upon this:
// If a .helmignore file matches, skip this file.
if rules.Ignore(n, fi) {
return nil
}
This reminded me that, for some reason, I've added charts/ to the .helmignore file. And that is the reason why it was not seeing the downloaded dependencies :(