How to get the manifest file with all values populated from helm chart?
Asked Answered
O

2

9

Is there a way to obtain the manifest file from a helm chart? The manifest file needs to be able to run just like a helm install. This will need to have all values populated and aggregated into one manifest file for kubectl apply -f

Orellana answered 7/10, 2020 at 15:32 Comment(0)
B
12

If I heard you properly, then my answer is: you can. And it is helm template cmd. See

$ helm template --help

Render chart templates locally and display the output.

Any values that would normally be looked up or retrieved in-cluster will be
faked locally. Additionally, ...
Balthasar answered 7/10, 2020 at 15:42 Comment(3)
"Any values that would normally be looked up or retrieved in-cluster will be faked locally." from helm.sh/docs/helm/helm_template. I need them to be real values, not fake ones.Orellana
This means, the actual values that would be populated in-cluster are shown as full manifests. The term faked does not mean actual fake values. It actually means you can see the final manifests what would be applied to the cluster after running helm install/helm upgrade cmd.Balthasar
If your purpose is to get the manifest file instead of output on terminal just use the Pipe > Eg helm template helloworld -f values-dev.yaml \chartdir\ > deployment.yamlHorsehide
K
1

helm template will render the manifest without interact with the cluster at all, so if any value need to be looked up, you need to put them manually.

Is possible to run helm install --dry-run to let helm interact with the server to feel the gaps:

helm install \
  --dry-run \
  --debug \
  --create-namespace \
  --namespace dry-run-namespace \
  dry-run-release . >|  manifest.dryrun.yaml

The install output will include the notes too

Kara answered 16/1 at 14:59 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.