Skip to content

Latest commit

 

History

History
80 lines (52 loc) · 1.67 KB

kind.md

File metadata and controls

80 lines (52 loc) · 1.67 KB

Kind - Kubernetes in Docker

https://kind.sigs.k8s.io/

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.

Install

From DevOps-Bash-tools repo:

install_kind.sh

Create Cluster

Creates with name kind, waits for 5 mins until control plane becomes available:

kind create cluster --name 'kind' --wait 5m

Create using a config

HariSekhon/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"

Commands

To recover the local isolated kube config (will ruin the other contexts though):

kind get kubeconfig --name knative >> "$KUBECONFIG"
kind get clusters
kind delete cluster

Copy 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 images
kind export logs  # ./somedir
Exported logs to: /tmp/396758314

Ported from private Knowledge Base pages 2023+