Install KIND and kubectl using the provided script:
Create a kind-config.yaml file:
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
- role: control-plane
image: kindest/node:v1.33.1
- role: worker
image: kindest/node:v1.33.1
- role: worker
image: kindest/node:v1.33.1Create the cluster using the configuration file:
kind create cluster --config kind-config.yaml --name tws-kind-clusterVerify the cluster:
kubectl get nodes
kubectl cluster-infoUse kubectl to interact with the cluster:
kubectl cluster-infoDeploy the Dashboard Apply the Kubernetes Dashboard manifest:
kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.7.0/aio/deploy/recommended.yamlCreate an Admin User Create a dashboard-admin-user.yml file with the following content:
apiVersion: v1
kind: ServiceAccount
metadata:
name: admin-user
namespace: kubernetes-dashboard
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: admin-user
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: cluster-admin
subjects:
- kind: ServiceAccount
name: admin-user
namespace: kubernetes-dashboardApply the configuration:
kubectl apply -f dashboard-admin-user.ymlGet the Access Token Retrieve the token for the admin-user:
kubectl -n kubernetes-dashboard create token admin-userCopy the token for use in the Dashboard login.
Access the Dashboard Start the Dashboard using kubectl proxy:
kubectl proxyOpen the Dashboard in your browser:
http://localhost:8001/api/v1/namespaces/kubernetes-dashboard/services/https:kubernetes-dashboard:/proxy/Use the token from the previous step to log in.
Delete the KIND cluster:
kind delete cluster --name my-kind-clusterMultiple Clusters: KIND supports multiple clusters. Use unique --name for each cluster. Custom Node Images: Specify Kubernetes versions by updating the image in the configuration file. Ephemeral Clusters: KIND clusters are temporary and will be lost if Docker is restarted.