- move viper initialization from k3d config file to separate util
sub-package in cmd/
- use that new subpackage init function to leverage the config file in
`k3d cluster delete`
- cover that with an e2e test case
This comes with several fixes/improvements
- only consider containers that have the default object label (app=k3d)
- handle network deletion
- check if there are other k3d containers connected
- if there are only registries, disconnect them
- if there are non-registry nodes, leave everything as it is
- if there are any containers connected, that are not automatically
disconnected, log a warning and continue
- package cluster: use context.Context as first function param in every
exported function
- package cmd: pass cmd.Context() to calls to package cluster exported
functions
- refactoring in pkg/cluster/kubeconfig
- new functions to delete a cluster from kubeconfig
- call RemoveClusterFromDefaultKubeConfig after deleting cluster
We have been giving user warnings about --timeout going away for a
while. Now fully deprecate it.
Use -t for --wait option
Move -w from --wait to --workers. Many users of K3d generate multi-node
clusters, -w will make their life easier.
In addition to provide an interactive shell, this patch adds the
'--command' and '-c' options to allow user to issue a command in the
context of a cluster.
For example:
$ k3d bash -c 'kubectl cluster-info'
Add the basic frame work for supporting spawning a bash shell by cli
command.
With this change, we can spawn a bash shell in the context of a cluster
$ k3d create -n my-cluster
$ k3d bash -n my-cluster
[my-cluster] $>
// execute commands with KUBECONFIG already set up
[my-cluster] $> kubectl get pods
When creating clusters with the --auto-restart flag, any running cluster
will remain "running" up on docker daemon restart.
By default, without this flag, a "running" cluster becomes "stopped"
after docker daemon restart.
Clusters stopped with 'k3d stop' command will remain stopped after
docker daemon restart regardless the settings of this flag.