DEV Community

Carlos Nogueira
Carlos Nogueira

Posted on • Edited on

3 2

Converting Helm Charts to K8S SDK Templates

If you are working on a helm chart, however, you need to make customizations or debug in a more native way. An alternative is to convert it to kubernetes SDK templates.

Requirements

  • Kubernetes(1.16+)
  • helm (3+)
  • kubectl(1.16+)

The process is simple:
(mongodb example)

1 Install desired chart generic release

- $ kubectl create ns mgodb-ns
- $ helm install mongodb --namespace mgodb-ns stable/mongodb
Enter fullscreen mode Exit fullscreen mode

2 Extract default generated chart values from the release

- $ helm get values mongodb -a --output yaml > values.yaml 
Enter fullscreen mode Exit fullscreen mode

3 Convert the chart to template

- $ helm template --values ./values.yaml --output-dir \
./manifests stable/mongodb

OUTPUT: 
wrote ./manifests/mongodb/templates/secrets.yaml
wrote ./manifests/mongodb/templates/pvc-standalone.yaml
wrote ./manifests/mongodb/templates/svc-standalone.yaml
wrote ./manifests/mongodb/templates/deployment-standalone.yaml
Enter fullscreen mode Exit fullscreen mode

Now you can work on native SDK k8s yamls at the directory manifests/mongodb/templates/

4 Don't forget to delete the generic release

- $ helm uninstall mongodb
- $ kubectl delete ns mgodb-ns
Enter fullscreen mode Exit fullscreen mode

Image of Datadog

The Future of AI, LLMs, and Observability on Google Cloud

Datadog sat down with Google’s Director of AI to discuss the current and future states of AI, ML, and LLMs on Google Cloud. Discover 7 key insights for technical leaders, covering everything from upskilling teams to observability best practices

Learn More

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay