Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Kubernetes helm - Running helm install in a running pod

I want to spin up a single installer pod with helm install that once running, will apply some logic and install other applications into my cluster using helm install.

I'm aware of the helm dependencies, but I want to run some business logic with the installations and I'd rather do it in the installer pod and on the host triggering the whole installation process.

I found suggestions on using the Kubernetes REST API when inside a pod, but helm requires kubectl installed and configured.

Any ideas?

like image 777
Eldad Assis Avatar asked Nov 03 '25 04:11

Eldad Assis


1 Answers

It seems this was a lot easier than I thought...

On a simple pod running Debian, I just installed kubectl, and with the default service account's secret that's already mounted, the kubectl was already configured to the cluster's API.

Note that the configured default namespace is the one that my installer pod is deployed to.

Verified with

$ kubectl cluster-info
$ kubectl get ns

I then installed helm, which was already using the kubectl to access the cluster for installing tiller.

Verified with

$ helm version
$ helm init

I installed a test chart

$ helm install --name my-release stable/wordpress

It works!!

I hope this helps

like image 166
Eldad Assis Avatar answered Nov 04 '25 18:11

Eldad Assis



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!