Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optional helm dependency update for helm charts #63

Open
kvaps opened this issue Aug 8, 2019 · 3 comments
Open

Optional helm dependency update for helm charts #63

kvaps opened this issue Aug 8, 2019 · 3 comments

Comments

@kvaps
Copy link
Contributor

kvaps commented Aug 8, 2019

Some helm applications may not work without helm dependency update.
For example stable/cert-manager will not working without it.

setting cluster to stage
setting context to stage
cluster metadata load took 9ms
[helm template] cd /tmp/cert-manager/components && helm template ../vendor/helm-charts/stable/cert-manager --name cert-manager --namespace kube-system --values -
Error: found in requirements.yaml, but missing in charts/ directory: webhook
✘ evaluate 'cert-manager': RUNTIME ERROR: run helm template command: exit status 1
	components/cert-manager.jsonnet:(5:1)-(14:2)	

after

cd /tmp/cert-manager/vendor/helm-charts/stable/cert-manager && helm dependency update

everything is working fine

@gotwarlost
Copy link
Contributor

gotwarlost commented Nov 9, 2019

Does this flow work at all when the chart is packaged as a tar.gz file?

@kvaps
Copy link
Contributor Author

kvaps commented Nov 15, 2019

What do you mean?
I have helm-charts repository which is connected to my project as submodule:

# git submodule
 f3d852b477a87eabc83adbb8fcdbba038458c8d2 vendor/helm-charts (f3d852b47)

and my component is looking like:

# cat components/prometheus-operator.jsonnet
local env = { name: std.extVar('qbec.io/env'), namespace: std.extVar('qbec.io/defaultNs') };
local p = import '../params.libsonnet';
local params = p.components.prometheusOperator;

std.native('expandHelmTemplate')(
  '../vendor/helm-charts/stable/prometheus-operator',
  params.values,
  {
    namespace: env.namespace,
    name: params.name,
    thisFile: std.thisFile,
    verbose: true,
  }
)

If I trying to use prometheus-operator from it, I will get:

# qbec show stage
[helm template] cd /home/kvaps/git/infrastructure/deployments/prometheus-operator/components && helm template ../vendor/helm-charts/stable/prometheus-operator --name monitoring --namespace monitoring --values -
Error: found in Chart.yaml, but missing in charts/ directory: kube-state-metrics, prometheus-node-exporter, grafana
✘ evaluate 'prometheus-operator': RUNTIME ERROR: run helm template command: exit status 1
	components/prometheus-operator.jsonnet:(5:23)-(14:2)	

but after I manually run helm dependency update

# cd vendor/helm-charts/stable/prometheus-operator
# helm dependency update
Saving 3 charts
Downloading kube-state-metrics from repo https://kubernetes-charts.storage.googleapis.com/
Downloading prometheus-node-exporter from repo https://kubernetes-charts.storage.googleapis.com/
Downloading grafana from repo https://kubernetes-charts.storage.googleapis.com/
Deleting outdated charts
# ls -l charts
total 36
-rw-r--r-- 1 kvaps kvaps 16935 Nov 15 11:26 grafana-3.8.19.tgz
-rw-r--r-- 1 kvaps kvaps  5739 Nov 15 11:26 kube-state-metrics-2.3.1.tgz
-rw-r--r-- 1 kvaps kvaps  5982 Nov 15 11:26 prometheus-node-exporter-1.5.2.tgz

helm downloads dependent tar.gz, and everything is starting working

@kvaps
Copy link
Contributor Author

kvaps commented Aug 27, 2020

BTW I also found that qbec with helm3 can use already packed charts. eg:

# cat components/prometheus-operator.jsonnet
local env = { name: std.extVar('qbec.io/env'), namespace: std.extVar('qbec.io/defaultNs') };
local p = import '../params.libsonnet';
local params = p.components.prometheusOperator;

std.native('expandHelmTemplate')(
  'https://charts.jetstack.io/charts/cert-manager-v1.0.0-beta.0.tgz',
  params.values,
  {
    namespace: env.namespace,
    name: params.name,
    thisFile: std.thisFile,
    verbose: true,
  }
)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants