Hi team, I am following below exercise <https://github.com/dgkanatsios/CKAD-exe . . .

Mayur Sharma:
Hi team,

I am following below exercise

Create a pod with image nginx called nginx and expose its port 80

I am confused whether service needs to be created or not, as port I can export without creating the service also like,

kubectl run nginx --image=nginx --port=80

The second question after above expects that you would have created the clusterIP service using the below command:

kubectl run nginx --image=nginx --restart=Never --port=80 --expose

Please guide me how do I understand it is asking for creating the service also.

Mohamed Ayman:
To expose the POD port, you need to create a service for the POD.

Mohamed Ayman:
–expose option will create the service for you.

Mayur Sharma:
@Mohamed Ayman Thanks for clarification. when you wrote it, I can clearly understand/recall the difference between container port and Pod port.