[Deployment]
$ kubectl create deployment source-ip-app --image=registry.k8s.io/echoserver:1.4

[Type=ClusterIP]
$ kubectl expose deployment source-ip-app --name=clusterip --port=80 --target-port=8080

$ kubectl get svc clusterip
NAME         TYPE        CLUSTER-IP    EXTERNAL-IP   PORT(S)   AGE
clusterip    ClusterIP   10.0.170.92   <none>        80/TCP    51s

[Type=NodePort]
$ kubectl expose deployment source-ip-app --name=nodeport --port=80 --target-port=8080 --type=NodePort

[Type=LoadBalancer]
$ kubectl expose deployment source-ip-app --name=loadbalancer --port=80 --target-port=8080 --type=LoadBalancer

$ kubectl get svc loadbalancer
NAME           TYPE           CLUSTER-IP    EXTERNAL-IP       PORT(S)   AGE
loadbalancer   LoadBalancer   10.0.65.118   203.0.113.140     80/TCP    5m

$ curl 203.0.113.140

$ kubectl get svc loadbalancer -o yaml | grep -i healthCheckNodePort

$ kubectl get pod -o wide -l app=source-ip-app
NAME                            READY     STATUS    RESTARTS   AGE       IP             NODE
source-ip-app-826191075-qehz4   1/1       Running   0          20h       10.180.1.136   kubernetes-node-6jst

[use curl to fetch the /healthz endpoint on various nodes]
$ curl localhost:32122/healthz

[delete the Services]
$ kubectl delete svc -l app=source-ip-app

[delete the Deployment, ReplicaSet and Pod]
$ kubectl delete deployment source-ip-app
