I have following dependency in requirement.yaml file:
dependencies:
- name: redis
version: 0.1.2
repository: http://helm-charts.repo:8800/
requirements.lock:
dependencies:
- name: redis
repository: http://helm-charts.repo:8800/
version: 0.1.2
digest: sha256: <some alpha numeric value>
generated: <>
helm dependency build <Chart name>
is giving me:
Error: requirements.lock is out of sync with requirements.yaml
You probably have old digest. Instead of manually updating requirements.lock file use the following command after just updating your requirement.yaml file:
helm dep update
Related
i'm triyng to do one Helm Chart for different environments. In many tutorials such scheme should works, but my structure does not read value from dependency repository. Helm just ignores it.
I have following folder structure
helm
- charts
- core-web
- Chart.yaml
- values.yaml
- templates
- frontend
- Chart.yaml
- values.yaml
- templates
- prod
- Chart.yaml
- values.yaml
- dev
- Chart.yaml
- values.yaml
prod/Chart.yaml
apiVersion: v1
name: test
version: 1.0.0
dependencies:
- name: core-web
version: "1.37.0"
repository: file://../charts/core-web/
- name: frontend
version: "1.6.0"
repository: "file://../charts/frontend"
From helm folder i execute following command
helm install ./prod --dry-run --generate-name -n sandbox -f prod/values.yaml
Error: INSTALLATION FAILED: found in Chart.yaml, but missing in charts/ directory: core-web, frontend
If i move charts forlder to prod folder, then everithing works.
Why helm does not accept file path from dependency repository?
It should: https://helm.sh/docs/helm/helm_dependency/
Thanks for the help.
Try to replicate the issue, seems like a cache issue
you can verify that helm dependency on which path it's looking for charts.
helm template test ./prod
#output Error: found in Chart.yaml, but missing in charts/ directory: backend, web-app
then I tried to verify the path on which the helm looking
helm dep ls ./prod
from the output its clear it's still looking into the wrong path with the status missing as its still looking for chart inside prod folder.
NAME VERSION REPOSITORY STATUS
backend 1.2.3 file://charts/backend/ missing
web-app 1.2.3 file://charts/web-app/ missing
so to fix this
helm dependency update ./prod
then I can see
helm dep ls ./prod
Im trying to install Bitnami Mongodb. When i run the ci/cd pipeline i get the following error:
Error: found in Chart.yaml, but missing in charts/ directory: common
this is what my gitlab-ci.yaml file looks like(package build part):
script:
- kubectl config set-context --current --namespace $NAMESPACE
- export HELM_EXPERIMENTAL_OCI=1 # nodig voor de repo add commands
- export HARBOR_ROBOT_SECRET_DECODED=$(echo -n "$HARBOR_ROBOT_SECRET" | base64 -d)
- helm registry login -u $HARBOR_ROBOT_NAME -p $HARBOR_ROBOT_SECRET_DECODED https://....../
- helm repo add --username $HARBOR_ROBOT_NAME --password $HARBOR_ROBOT_SECRET_DECODED --insecure-skip-tls-verify pgu https://..../chartrepo/pgu
- helm repo update
- helm dependency update
- helm repo add stable https://charts.helm.sh/stable
- helm repo add bitnami https://charts.bitnami.com/bitnami
- helm search repo bitnami
- >
helm upgrade --install -f values.yaml --set application.name=mongodb,application.registryServer=$REGISTRY_SERVER,application.image=namespace=$NAMESPACE $HELM_RELEASE_NAME $HELM_CHART --namespace=$NAMESPACE --version=$HELM_CHART_VERSION
My chart.yaml file:
dependencies:
- name: common
repository: https://charts.bitnami.com/bitnami
tags:
- bitnami-common
UPDATE:
I ran debug:
history.go:56: [debug] getting history for release mongodb
Release "mongodb" does not exist. Installing it now.
install.go:173: [debug] Original chart version: "1.0.0"
install.go:190: [debug] CHART PATH: /root/.cache/helm/repository/mongodb-v1.0.0.tgz
Error: found in Chart.yaml, but missing in charts/ directory: common
helm.go:88: [debug] found in Chart.yaml, but missing in charts/ directory: common
helm.sh/helm/v3/pkg/action.CheckDependencies
helm.sh/helm/v3/pkg/action/install.go:619
main.runInstall
helm.sh/helm/v3/cmd/helm/install.go:216
main.newUpgradeCmd.func2
helm.sh/helm/v3/cmd/helm/upgrade.go:115
github.com/spf13/cobra.(*Command).execute
github.com/spf13/cobra#v1.1.3/command.go:852
github.com/spf13/cobra.(*Command).ExecuteC
github.com/spf13/cobra#v1.1.3/command.go:960
github.com/spf13/cobra.(*Command).Execute
github.com/spf13/cobra#v1.1.3/command.go:897
main.main
helm.sh/helm/v3/cmd/helm/helm.go:87
runtime.main
runtime/proc.go:225
runtime.goexit
runtime/asm_amd64.s:1371
Resolved: Replaced Original chart version: "1.0.0" with package version (to be the same)
install.go:173: [debug] Original chart version: "11.0.6"
install.go:190: [debug] CHART PATH: /root/.cache/helm/repository/mongodb-11.0.6.tgz
I am trying to make Skaffold work with Helm.
Below is my skaffold.yml file:
apiVersion: skaffold/v2beta23
kind: Config
metadata:
name: test-app
build:
artifacts:
- image: test.common.repositories.cloud.int/manager/k8s
docker:
dockerfile: Dockerfile
deploy:
helm:
releases:
- name: my-release
artifactOverrides:
image: test.common.repositories.cloud.int/manager/k8s
imageStrategy:
helm: {}
Here is my values.yaml:
image:
repository: test.common.repositories.cloud.int/manager/k8s
tag: 1.0.0
Running the skaffold command results in:
...
Starting deploy...
Helm release my-release not installed. Installing...
Error: INSTALLATION FAILED: failed to download ""
deploying "my-release": install: exit status 1
Does anyone have an idea, what is missing here?!
I believe this is happening because you have not specified a chart to use for the helm release. I was able to reproduce your issue by commenting out the chartPath field in the skaffold.yaml file of the helm-deployment example in the Skaffold repo.
You can specify a local chart using the deploy.helm.release.chartPath field or a remote chart using the deploy.helm.release.remoteChart field.
Im trying to setup a Helm chart repo using Github pages. Everything appears to work fine with generating the index.yaml etc via Github Actions, awesome.
index.yaml
apiVersion: v1
entries:
test:
- apiVersion: v1
created: "2021-08-27T09:54:44.830905882Z"
description: Testing the chart releaser
digest: b41b263d236ef9eee0a75e877982a10ea73face093b4999c6004263b041f0fad
keywords:
- test
name: test
urls:
- https://github.com/xxx/xxx/releases/download/test-0.0.9/test-0.0.9.tgz
version: 0.0.9
generated: "2021-08-27T09:54:44.587113879Z"
And a test chart
name: test
description: Testing the chart releaser
version: 0.0.9
apiVersion: v1
keywords:
- test
sources:
home:
However, when i try to add the repo using
helm repo add test https://didactic-quibble-e0daddd0.pages.github.io/
I get the error
Error: looks like "http://didactic-quibble-e0daddd0.pages.github.io/" is not a valid chart repository or cannot be reached: error converting YAML to JSON: yaml: line 188: mapping values are not allowed in this context
The URL http://didactic-quibble-e0daddd0.pages.github.io/index.yaml returns the index.yaml file described above.
Any help would be much appreciated.
Cheers
I would suggest a different procedure and hope that helps you in hosting GitHub as a Helm Repo.
I have 2 Helm charts here:
Library- this is going to be used by other helm charts as a
dependency . This I am going to host in the below example as a helm repo on GitHub
App- this is going to consume the Library chart and extra
functionality.
Library Chart: In your Library Directory
helm package libchart
helm helm repo index .
Validate the index file is created and entries are correct
more index.yaml
apiVersion: v1
entries:
libchart:
- apiVersion: v2
appVersion: 1.16.0
created: "2022-11-30T08:57:01.109116+09:00"
description: A Helm chart for Kubernetes
digest: 8aa38d70d61f81cf31627a7d7d9cc5c293f340bf01918c9a16ac1fac9fcc96e9
name: libchart
type: library
urls:
- libchart-0.1.0.tgz
version: 0.1.0
generated: "2022-11-30T08:57:01.108194+09:00"
Commit "index.yaml" and ".tgz" files to the git .
Add helm repo:
#~: helm repo add mylib --username parjun8840 --password TOPSECRET-TOKEN-FROM-GIT
https://raw.githubusercontent.com/YOURGITUSER/helm-library/master
"mylib" has been added to your repositories
#~:helm-library arjunpandey$ helm repo update
App Chart: In your App Directory
#~:appchart arjunpandey$ more Chart.yaml
apiVersion: v2
name: appchart
description: A Helm chart for Kubernetes
type: application
version: 0.1.0
appVersion: "1.16.0"
dependencies:
- name: libchart
version: 0.1.0
repository: https://raw.githubusercontent.com/YOURGITUSER/helm-library/master
#~:appchart arjunpandey$ helm dependency update
Hang tight while we grab the latest from your chart repositories...
...Successfully got an update from the "mylib" chart repository
...Successfully got an update from the "newrelic" chart repository
Update Complete. ⎈Happy Helming!⎈
Saving 1 charts
Downloading libchart from repo https://raw.githubusercontent.com/YOURGITUSER/helm-library/master
Deleting outdated charts
To ease local development/testing, I have an umbrella chart that deploys all my sub-charts. Those applications make use of resources (e.g. MongoDB, Kafka, etc) and I want to make sure that if you are installing the umbrella chart to a cluster, it will also install those resources.
To do this, I have the following:
apiVersion: v2
name: my-cool-project
type: application
version: 0.1.0
appVersion: 0.1.0
dependencies:
- name: my-cool-app-1
repository: "file://my-cool-app-1"
- name: my-cool-app-2
repository: "file://my-cool-app-2"
- name: bitnami/kafka
version: 2.5.0
repository: "https://charts.bitnami.com/bitnami"
Unfortunately, installing this chart throws the following error:
Error: found in Chart.yaml, but missing in charts/ directory: bitnami/kafka
This seems so fundamental to the concept of Helm that the fact it's not working means I'm clearly missing something basic. Even the official docs are pretty clear this is the right approach.
Most documentation/guides instruct you to simply helm install it straight to the cluster. While this might solve my immediate problem of needing Kafka or MongoDB on the cluster, my desire is to code-ify the need for that resource so that I can achieve "single chart installs everything to an empty cluster and it just works" status.
What am I missing?
This worked for me 🔧:
apiVersion: v2
name: my-cool-project
type: application
version: 0.1.0
appVersion: 0.1.0
dependencies:
- name: my-cool-app-1
repository: "file://my-cool-app-1"
- name: my-cool-app-2
repository: "file://my-cool-app-2"
- name: kafka 👈
version: 11.6.0 👈
repository: "https://charts.bitnami.com/bitnami"
Then update on the dependencies on your local helm Chart:
○ → helm dependency update
Hang tight while we grab the latest from your chart repositories...
...Successfully got an update from the "bitnami" chart repository
Update Complete. ⎈Happy Helming!⎈
Saving 1 charts
Downloading kafka from repo https://charts.bitnami.com/bitnami
Deleting outdated charts
✌️☮️