Just wanted to share how we are renewing the kubeconfig from the command line.
In our organization it was considered a bit clumsy to download the kubeconfig from the Karbon UI. We love the command line and wanted a quick’n’easy way to renew the authentication token.
We created a docker image that contains the “karbonctl” binary and a wrapper script. The Dockerfile was also included into our CI/CD pipeline to automate the image creation.
The wrapper script does two things:
- karbonctl login --pc-ip prism.nightingale.nu --pc-username “$1”
karbonctl cluster kubeconfig --cluster-name “$2” >”$3”
The commands that the end user run:
- docker run --rm -it -v “$(pwd)”:/tmp docker.registry.local/karbonctl:latest <login> mycluster /tmp/karbon.cfg
- export KUBECONFIG=”$(pwd)/karbon.cfg”