Get the new cluster's connection details merged into your default kubeconfig (usually specified using the `KUBECONFIG` environment variable or the default path `#!bash $HOME/.kube/config`) and directly switch to the new context:
```bash
k3d kubeconfig merge mycluster --switch
k3d kubeconfig merge mycluster --switch-context
```
Use the new cluster with [`kubectl`](https://kubernetes.io/docs/tasks/tools/install-kubectl/), e.g.:
None of the above options switch the current-context by default.
This is intended to be least intrusive, since the current-context has a global effect.
<<<<<<<HEAD
You can switch the current-context directly with the `kubeconfig merge` command by adding the `--switch` flag.
You can switch the current-context directly with the `kubeconfig merge` command by adding the `--switch-context` flag.
## Removing cluster details from the kubeconfig
`#!bash k3d cluster delete mycluster` will always remove the details for `mycluster` from the default kubeconfig.
## Handling multiple clusters
`k3s kubeconfig merge` let's you specify one or more clusters via arguments _or_ all via `--all`.
All kubeconfigs will then be merged into a single file, which is either the default kubeconfig or the kubeconfig specified via `--output FILE`.
Note, that with multiple cluster specified, the `--switch` flag will change the current context to the cluster which was last in the list.
=======
You can switch the current-context directly with the `get kubeconfig` command by adding the `--switch-context` flag.
## Removing cluster details from the kubeconfig
`#!bash k3d delete cluster mycluster` will always remove the details for `mycluster` from the default kubeconfig.
It will also delete the respective kubeconfig file in `$HOME/.k3d/` if it exists.
## Handling multiple clusters
`k3d get kubeconfig` let's you specify one or more clusters via arguments _or_ all via `--all`.
`k3d kubeconfig merge` let's you specify one or more clusters via arguments _or_ all via `--all`.
All kubeconfigs will then be merged into a single file if `--merge-default-kubeconfig` or `--output` is specified.
If none of those two flags was specified, a new file will be created per cluster and the merged path (e.g. `$HOME/.k3d/kubeconfig-cluster1.yaml:$HOME/.k3d/cluster2.yaml`) will be returned.
Note, that with multiple cluster specified, the `--switch-context` flag will change the current context to the cluster which was last in the list.