Useful for CI/CD testing.
You can see this used in my GitHub Actions for repo HariSekhon/Kubernetes-configs, used for testing the yaml configurations on a live test kubernetes cluster.
From DevOps-Bash-tools repo:
install_kind.shCreates with name kind, waits for 5 mins until control plane becomes available:
kind create cluster --name 'kind' --wait 5mHariSekhon/Templates - kind.yaml
Tip: be careful not to do this in an isolated KUBECONFIG where the context will then be lost (eg. the fancy direnv .envrc-kubernetes from my repos):
kind create cluster --config="$templates/kind.yaml"To recover the local isolated kube config (will ruin the other contexts though):
kind get kubeconfig --name knative >> "$KUBECONFIG"kind get clusterskind delete clusterCopy locally built docker image into Kind cluster:
kind load docker-image "$DOCKER_IMAGE":"$TAG"Get list of images - may need to replace 'kind' with name of the cluster:
docker exec -it 'kind-control-plane' crictl imageskind export logs # ./somedirExported logs to: /tmp/396758314
Ported from private Knowledge Base pages 2023+