Exposing and Examining a Service
Expose the port of the service
Linux shell command
export NODE_PORT=$(kubectl get services/kubernetes-bootcamp -o go-template='{{(index .spec.ports 0).nodePort}}')
Windows shell command
$Env:NODE_PORT=$(kubectl get services/kubernetes-bootcamp -o go-template='{{(index .spec.ports 0).nodePort}}')
Use curl the view a response from the service
Linux shell command
curl $(minikube ip):$NODE_PORT
Windows shell command
curl "$(minikube ip):$Env:NODE_PORT"
View the content of a deployment
shell command
View the content of a single pod
shell command
View the content of a single service
shell command
Get the name of the POD
Linux shell command
Windows shell command
Seeing all information on a service
Windows shell command
kubectl get all
Seeing detailed information about a deployment
Windows shell command
kubectl get deploy/<service name> -o yaml
Change a label within a POD
Linux shell command
Windows shell command
kubectl label pod $Env:POD_NAME app=v1
Describe POD using pod name
Linux shell command
Windows shell command
Using value of POD get a particular POD
kubectl get pods -l app=v1
Delete a service
kubectl delete service -l run=kubernetes-bootcamp
Confirm service has been deleted
kubectl get services
The next command proves that the app is not reachable from the outside
Linux shell command
curl $(minikube ip):$NODE_PORT
Windows shell command
The next command proves that the app is still up and running
Linux shell command
Windows shell command