Christine Siepka:
Hi there, just trying to understand something:
Are the following two commands equal?
kubectl run httpd --image=httpd:alpine --port=80 --expose
kubectl run httpd --image=httpd:alpine --port=80 --expose=true
if expose is by default false, does just adding the option make it true, is this method frowned upon?
Alistair Mackay:
--expose
is a boolean switch with default true
, so yes they are the same if kubectl does not complain about the second syntax
Shwetha:
Since --port
is a part of both commands, they are treated equal. The port arg is required, if expose is used.
Alistair Mackay:
Can’t say I have ever had to explicitly put =true
here. It’s probably implied when you couple it with -port
etc.
It is definitely false
when not specified on command line.