{ clear && \
echo -e "\n=== Kubernetes Status ===\n" && \
kubectl get --raw '/healthz?verbose' && \
kubectl version --short && \
kubectl get nodes && \
kubectl cluster-info;
} | grep -z 'Ready\| ok\|passed\|running'
==========================================================
Inspect the control plane
$ kubectl get pods,services --all-namespaces
==========================================================
Create a multinode cluster with exposed ports
$ less example-kind-cluster.yaml | tee
==========================================================
Create cluster with configuration
$ kind create cluster --config example-kind-cluster.yaml
$ kind get clusters
$ docker container ls --all --size --filter name=^kind | grep -z "kindest"
$ kubectl get nodes -o wide
==========================================================
Inspect the control plane
$ kubectl get pods,services --all-namespaces
===========================================================
Create a deployment
$ kubectl create deployment my-nginx --image=nginx
===========================================================
Expose the deployment with a service
$ kubectl expose deployment my-nginx --type=NodePort --port=80
----------------------------------------------------------
Confirm that the application objects have been created and are running:
$ kubectl get pods,services
============================================================
The service my-nginx is exposed as NodePort:
$ PORT=$(kubectl get service my-nginx -o jsonpath="{.spec.ports[0].nodePort}") && echo $PORT
However, if we try to expose nginx server at that port we do not get a response
$ curl http:
we added the mapping to kind 32001 so we'll expose the service name public-nginx
on port 32001 NodePort;
$ kubectl apply -f public-nginx.yaml
$ kubectl get pods,services | grep -z 32001
--------------------------------------------------------------
Now curl command to that port:
$ curl http:
===================================================================
Kubernetes dashboard:
Now that the kubernetes is kind, you can install other helpful application
such as kubernetes dashboard, A common way to install kubernetes dashboard
is through Helm chart.
$ helm version --short
-------------------------------------------------------------------
Add the chart to helm:
$ helm repo add kubernetes-dashboard https:
Add an admin user service account to grant the dashboard roles to access the cluster
resources and objects:
$ kubectl create namespace kubernetes-dashboard && kubectl apply -f dash-auth.yaml
-------------------------------------------------------------------
Install kubernetes dashboard using Public Helm chart:
$ helm install kubernetes-dashboard kubernetes-dashboard/kubernetes-dashboard \
--version=5.4.1 \
--namespace kubernetes-dashboard \
--create-namespace \
--values dash-values.yaml
--------------------------------------------------------------------
Once the dashboard pods reports Running we can access it using:
$ kubectl get services,pods -n kubernetes-dashboard -l app.kubernetes.io/name=kubernetes-dashboard
we can administer our cluster using kubectl or using kubernetes dashboard:
$ kubectl get services,pods -n kubernetes-dashboard -l app.kubernetes.io/name=kubernetes-dashboard
it will prompt us to provide access token at ay time we can run the following script:
$ k8s-dash-token.sh
and done....