keep separate k3d kubeconfig files #646
-
Hi Team, Problem: I want to create multiple k3d clusters and when cluster is creating i want to keep config files separately to achieve parallel tasks. by default k3d will club the 3 or n cluster configs in to Singleconfig, I dont want to use switch context, I want to create separate configs. ex: k3d cluster create cluster01
k3d cluster create cluster02
k3d cluster create cluster03 ConfigFile should be like $ ls -l ~/.kube/
cluster01.yaml cluster02.yaml cluster03.yaml I want to use like kubectl get pods -A --kubeconfig ~/.kube/custer01.yaml
kubectl get pods -A --kubeconfig ~/.kube/custer02.yaml
kubectl get pods -A --kubeconfig ~/.kube/custer03.yaml i was searching on k3d docs and found root@yasin:~/.kube# k3d cluster create cluster3 --config /root/k3d_db/cluster3.yaml
FATA[0000] Failed to stat config file /root/k3d_db/cluster3.yaml: stat /root/k3d_db/cluster3.yaml: no such file or directory EDIT (@iwilltry42): add code blocks for better readability |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Hi @Yasinmohammed007 , let me just go through all the parts of your question 👍
This is actually the "standard way" of doing things as per https://kubernetes.io/docs/tasks/access-application-cluster/configure-access-multiple-clusters/, but it's fine, if that's not suitable for you (in any case, checkout https://github.com/ahmetb/kubectx which makes handling multiple contexts super easy).
Then this is what you were searching for: https://k3d.io/usage/kubeconfig/
With the So you have at least the following to options here to achieve what you want:
|
Beta Was this translation helpful? Give feedback.
-
Thanks @iwilltry42. |
Beta Was this translation helpful? Give feedback.
Hi @Yasinmohammed007 , let me just go through all the parts of your question 👍
This is actually the "standard way" of doing things as per https://kubernetes.io/docs/tasks/access-application-cluster/configure-access-multiple-clusters/, but it's fine, if that's not suitable for you (in any case, checkout https://github.com/ahmetb/kubectx which makes handling multiple contexts super easy).
Then this is what you were searching for: https://k3d.io/usage/kubeconfig/
When you create a k3d cluster with default parameters, k3d will merge the kubeconfig from the new cluster into whatever is specified as your default kubeconfig (
$HOME…