Skip to content

Instantly share code, notes, and snippets.

@cccaaannn
Last active November 4, 2023 13:19
Show Gist options
  • Save cccaaannn/a192b05b51de24ff4ca0c86a944a28b6 to your computer and use it in GitHub Desktop.
Save cccaaannn/a192b05b51de24ff4ca0c86a944a28b6 to your computer and use it in GitHub Desktop.

K8s cluster in docker with k3d

Install k3d

sudo curl -s https://raw.githubusercontent.com/k3d-io/k3d/main/install.sh | bash

Create k8s cluster

sudo k3d cluster create <CLUSTER_NAME> --k3s-arg "--tls-san=<SERVER_IP>"@server:*

Get k8s cluster config

Update the config with your server ip

sudo k3d kubeconfig get <CLUSTER_NAME>

Get k8s cluster info

kubectl cluster-info
kubectl get node

Delete k8s cluster

sudo k3d cluster delete <CLUSTER_NAME>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment