Deploy to K8s using helm without helm

On many occasions helm is not available directly on my cluster or I do not trust the author. So how can I deploy to my cluster without helm? Luckily helm can be configured to dump the template to on disk yaml manifests that can be applied to the target cluster. If you do not pass include-crds then no CRDs will be output and you will get errors later where CRDs are missing.

Here I use loki as an example but it works just the same for everything else.

helm template loki grafana/loki --values values.yaml --output-dir ./ --include-crds

The templates will be generated in the templates directory and you can the recursively apply them all with this (using server-side and force-conflicts helps when some annotations are too big):

k apply -f ./loki/templates -R  --server-side --force-conflicts --namespace loki

To get a starting point for a values.yaml run this and you will get all the defaults and options you can edit:

helm show values grafana/loki > values.yml

Chart requires kubeVersion which is incompatible with Kubernetes v1.20.0

I am getting this error:

Error: chart requires kubeVersion: >=1.21.0-0 which is incompatible with Kubernetes v1.20.0

helm template defaults to the version of the Kubernetes libs that helm was built against, not the version of the cluster. Since helm template doesn’t connect to the cluster.

To get around this you can override the version by passing helm template --kube-version v1.21.1

Comments

comments powered by Disqus