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 && 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?