Question on practice test: <https://kodekloud.com/topic/practice-test-imperative . .

Titi Wangsa Damhore:
Question on practice test: https://kodekloud.com/topic/practice-test-imperative-commands-2/ 09.

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.

I ran this one:

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

and it failed the last check 'httpd' service exposes the 'httpd' pod?
I looked at the answer, and the difference was instead of --expose=true the answer was --expose
I did a diff, of kubectl get pods httpd -o yaml and kubectl get service httpd -o yaml for both, and I could not see any notable differences.

steps:
• ran kubectl run httpd --image=httpd:alpine --expose=true --port=80
• failed at the last check, 'httpd' service exposes the 'httpd' pod?
• ran kubectl delete service httpd &amp;&amp; kubectl delete pods httpd to delete the pod and service
• ran kubectl run httpd --image=httpd:alpine --expose --port=80
• all checks passed
why did --expose=true fail and --expose passed?

Titi Wangsa Damhore:
Can anyone help with this?

Titi Wangsa Damhore:
@Tej_Singh_Rana ping?

• The --expose=true : create a service and expose it to external traffic when running a pod or a deployment.
• The --expose=true : creates and exposes a service in one command.
• The --expose : expose an existing resource (such as a deployment, pod, or service) as a new service.
• The --expose : exposes an existing resource as a new service.
• The --expose=false : specify whether to create a service for the pod or deployment that is being created. 
	○ If true, then a ClusterIP service is created with the same name and port as the pod or deployment. 
	○ If false, then no service is created.