subham Saha:
Question
Create a new pod called custom-nginx using the nginx image and expose it on container port 8080.
For the solution I have first created POD then exposed it to port. Then why its showing me wrong
FYI,
root@controlplane:~# kubectl run --image=nginx custom-nginx
pod/custom-nginx created
root@controlplane:~# kubectl expose pod custom-nginx --port=8080
service/custom-nginx exposed
And the solution is given is
kubectl run custom-nginx --image=nginx --port=8080
I want to know the difference between these 2 commands.