teleskopio helm integration
Helm
Under the hood
Hey! Hope you're doing fine.
The teleskopio has released a new version v0.1.3 featuring Helm integration.
In this article, I'll explain how that feature was developed.
We'll test it on a kind cluster. Let's create a simple cluster. In the previous post, you can find how to set up a cluster with kind.
Helm
Run teleskopio --config=./config.yaml.
In this video, we've run a bunch of helm install/uninstall commands in another terminal. In the teleskopio web UI, we can open the manifests of a Helm release by double‑clicking the release column.
Under the hood
From the backend side, the realization is pretty simple and built on top of the Helm Go SDK. We have a Kubernetes client initialized, and with that client we can initialize the Helm client.
Here is an example:
flags := genericclioptions.NewConfigFlags(false)
// Spoof kube config on the fly
flags.WrapConfigFn = func(_ *rest.Config) *rest.Config {
return r.GetCluster(req.Server).RestConfig
}
actionConfig := new(action.Configuration)
err := actionConfig.Init(flags, ns, "secret", slog.Default().Info)
// Handle error
list := action.NewList(actionConfig)
list.All = true
rels, err := list.Run()
// rels is a helm releases slice
After listing Helm releases, we create a Kubernetes shared index informer and watch Secret resources.
A Kubernetes shared index informer is a mechanism in the client-go library for efficiently watching, listing, and caching Kubernetes resources, with the added ability to create custom indexes for fast data retrieval. It is the foundation for building Kubernetes controllers and operators.
That's because of helm nature.
Helm stores release metadata, including chart data and values, in Kubernetes Secrets by default.
In this teleskopio version, the Helm backend is hardcoded to use Secret. Maybe we'll add more backends (ConfigMap, sql, etc.) in the future.
If you want to know more, feel free to dig into the teleskopio source code.
That's a brief overview of the teleskopio features.
Happy coding!
- ← Previous
teleskopio with kind