To make sure that everything is in place, let's go ahead and carry out some checks:
- Install busybox to check and validate the Kubernetes deployments:
$ kubectl create -f https://k8s.io/examples/admin/dns/busybox.yaml
- Now install the hostname deployment. First, create a deployment:
$ kubectl run hostnames --image=k8s.gcr.io/serve_hostname
--labels=app=hostnames
--port=9376
--replicas=3
- Next, create a service:
$ kubectl expose deployment hostnames --port=80 --target-port=9376
- Finally, perform a sanity check for the cluster. Check the pod with the following:
$ kubectl get pods
NAME READY STATUS RESTARTS AGE
busybox 1/1 Running 0 13s
For more help regarding testing the cluster, you can visit https://kubernetes.io/docs/tasks/debug-application-cluster/debug-service/.