Currently create command uses $HOME/.kube/config for writing kubeconfig of Kind cluster. And get command also uses same default path for interacting with cluster.
This works fine but there are following scenarios where this behavior is not useful.
Story 1:
I don't want the local cluster kubeconfig in default location.
Story 2:
I am using context switching tools like kubeswitch which allows me to create sticky context for each terminal. In this case, If I create multiple builds, the get secrets command keeps fetching secrets from the cluster for which the context is set in the default kubeconfig.
Story 3:
I want to have kubectl like experience of using non-default kubeconfig when I am interacting with the cluster.
Possible Solution
As a quick fix, the logic of kubeConfigPath in create and get secret command can be modified to check KUBECONFIG environment variable as follows:
Have you searched for this feature request?
Problem Statement
Currently create command uses
$HOME/.kube/config
for writing kubeconfig of Kind cluster. And get command also uses same default path for interacting with cluster.This works fine but there are following scenarios where this behavior is not useful. Story 1: I don't want the local cluster kubeconfig in default location.
Story 2: I am using context switching tools like
kubeswitch
which allows me to create sticky context for each terminal. In this case, If I create multiple builds, theget secrets
command keeps fetching secrets from the cluster for which the context is set in the default kubeconfig.Story 3: I want to have
kubectl
like experience of using non-defaultkubeconfig
when I am interacting with the cluster.Possible Solution
As a quick fix, the logic of
kubeConfigPath
in create and get secret command can be modified to checkKUBECONFIG
environment variable as follows:Long term, we should add support for
--kubeconfig
flag and then set the value to opts. Eventually it can be used for #74Alternatives Considered
Currently. No alternative than using default
kubeconfig
file