Hi everyone. In Mock Exam 1 Q 10. "Expose the hr-web-app as service hr-web-app-s . . .

Victor Pacheco:
Hi everyone. In Mock Exam 1 Q 10. “Expose the hr-web-app as service hr-web-app-service application on port 30082 on the nodes on the cluster. The web application listens on port 8080.”

When i run the command kubectl expose deployment hr-web-app or just try to get the deployment none is present. Is this a bug?

root@controlplane:~# kubectl get deployments
No resources found in default namespace.

Please advice.

Prashanth Vusirikapalli:
@Victor Pacheco You should have created the deployment as part of Question 6 as below

kubectl create deployment hr-web-app --image=kodekloud/webapp-color --replicas=2

For Question 10: write the out of expose command as below and add a nodePort: 30082 under ports

kubectl expose deployment hr-web-app --name=hr-web-app-service --type=NodePort --port=8080 --dry-run=client -oyaml > hr-web-app-service.yaml

Then

kubectl apply -f hr-web-app-service.yaml

Victor Pacheco:
You are correct. I am skipping around. Appreciate the response. I will take that into consideration going forward.