Skip to content

kubeconfig

kubeconfig is the file that permits to connect to a Kubernetes cluster.

It contains:

  • cluster information
  • user information
  • and context

The context is the pair user / cluster that is used to connect.

Kubee search the kubeconfig file in the following order:

  • the KUBECONFIG env
  • the default kubeconfig file ~/.kube/config
  • in the pass at $KUBEE_PASS_HOME/kubeconfig/$KUBEE_CONTEXT_NAME

To be sure that the command are executed against the required cluster, kubee checks that the kubeconfig current context is equal to the KUBEE_CONTEXT_NAME.

ie the expected value should be:

apiVersion: v1
kind: Config
clusters: [ ]
contexts: [ ]
users: [ ]
current-context: "$KUBEE_CONTEXT_NAME"

If it’s not the case, it will try to change it and if it does not succeed, it will exit.

Terminal window
# with the cert cached
kubee kubectl config view
# with all data
kubee kubectl config view --raw
Terminal window
kubee kubectl cluster-info

We allow encryption with pass

Check the unable to connect runbook