Create and export the service
export NODE_PORT=$(kubectl get services/kubernetes-bootcamp -o go-template='{{(index .spec.ports 0).nodePort}}')
$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
curl $(minikube ip):$NODE_PORT
curl "$(minikube ip):$Env:NODE_PORT"
View the content of a deployment
kubectl describe deployment
View the content of a single pod
kubectl get pods -l run=kubernetes-bootcamp
View the content of a single service
kubectl get services -l run=kubernetes-bootcamp
Get the name of the POD
export POD_NAME=$(kubectl get pods -o go-template --template '{{range .items}}{{.metadata.name}}{{"\n"}}{{end}}')
$Env:POD_NAME=$(kubectl get pods -o go-template --template '{{range .items}}{{.metadata.name}}{{end}}')
Examine POD content using labels
kubectl label pod $POD_NAME app=v1
Describe POD using pod name
kubectl describe pods $POD_NAME
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
curl $(minikube ip):$NODE_PORT
kubectl exec -ti $POD_NAME curl localhost:8080