Create a pod called `httpd` using the image `httpd:alpine` in the default namesp . . .

madhusmita:
Create a pod called httpd using the image httpd:alpine in the default namespace. Next, create a service of type ClusterIP by the same name (httpd). The target port for the service should be 80.

Try to do this with as few steps as possible.

• ‘httpd’ pod created with the correct image?
• ‘httpd’ service is of type ‘ClusterIP’?
• ‘httpd’ service uses correct target port 80?
• ‘httpd’ service exposes the ‘httpd’ pod?
How can I verify if httpd’ service exposes the ‘httpd’ pod?

R Banerjee:
The service would have an IP, right?
Why not curl to the IP:80 and see if there is a response or not…

akash lunkad:
kubectl describe svc httpd and then see if the IP of the endpoint is the IP of the pod

Shivesh:
Below should work #
#kubectl run httpd --image=httpd:alpine --port=80 expose
Post that # check the status via describe as indicated above

correct answer:


 kubectl run httpd --image=httpd:alpine --port=80  --expose=true