navi/cheats/k3d.cheat

37 lines
821 B
Text
Raw Normal View History

2019-09-22 08:50:19 +00:00
% k3d
# Check if docker is running
k3d check-tools
# Start a subshell for a cluster
k3d shell
# Create a single k3s cluster in docker containers
2019-09-24 16:30:31 +00:00
k3d create --name <cluster_name>
2019-09-22 08:50:19 +00:00
# Create a multi-node k3s cluster in docker containers
2019-09-24 16:30:31 +00:00
k3d create --name <name> --workers <worker_count>
2019-09-22 08:50:19 +00:00
# Delete cluster
2019-09-24 16:30:31 +00:00
k3d delete --name <cluster_name>
2019-09-22 08:50:19 +00:00
# Stop cluster
2019-09-24 16:30:31 +00:00
k3d stop --name <cluster_name>
2019-09-22 08:50:19 +00:00
# Start a stopped cluster
2019-09-24 16:30:31 +00:00
k3d start --name <cluster_name>
2019-09-22 08:50:19 +00:00
# List all clusters
k3d list
# Get kubeconfig location for cluster
2019-09-24 16:30:31 +00:00
k3d get-kubeconfig --name <cluster_name>
2019-09-22 08:50:19 +00:00
# Import a comma- or space-separated list of container images from your local docker daemon into the cluster
k3d import-images
# Show a list of commands or help for one command
k3d help
2019-09-24 16:21:27 +00:00
2019-09-24 16:30:31 +00:00
$ cluster_name: k3d list |awk '{print $2}' | awk 'NF {print $0}' | tail -n +2