Steps to install kubernetes on Mac m1:
- Install docker on mac (m1) from the link. Run docker.
- Install kind. kind lets you run Kubernetes on your local computer
brew install kind
- Install Create a kind cluster using (kind quick start guide)
kind create cluster
Default cluster created name is kind. To create a different name cluster, use the following commandkind create cluster --name kind-2
- This will create a kind cluster in docker as shown below
- get all clusters
kind get clusters - Install kubectl
brew install kubectl - Check kubectl version
kubectl version --client --output=yaml
- Check cluster info using kubectl
kubectl cluster-info
(optional argument: –context kind-kind-2 ) - Change default context for kubectl command (in case of multiple clusters)
kubectl config use-context kind-kind-2
(Use kubectl config current-context to see current context) - List all pods on a specific namespace (use -A for all namespaces)
kubectl get pods -n kube-system
- See all namespaces
kubectl get namespace
- To delete default kind cluster
kind delete cluster
(use –name kind-2 for deleting specific cluster)