Had follwoing questions: 1. how do we distingush when the question say expose a . . .

Chandrika:
Had follwoing questions:

  1. how do we distingush when the question say expose a port on pod, in some cases, we just create a container port and in some cases we use --expose command?
  2. Is the below command is just a tag or it will upgrade the version also?
kubectl get pod mypod -o yaml | sed 's/\(image: myimage\):.*$/\1:v4/' | kubectl replace -f -
  1. for command, sometimes [“sleep”, “3600”] works and sometimes with [“/bin/sh”, “-c”, “sleep 3600”] …?

Xin Zheng:
Answer1: the --expose for run/deploy pod will create a service, while containerPort is just internal ports communication without service abstraction.
Answer2: sorry, not quite sure this bash command, I am not a bash master. but from the command, seems it will update the image.
Answer3: use [‘/bin/sh’, ‘-c’, ‘sleep 3600’], or use yaml list for these commands.
- sleep
- 3600

Xin Zheng:
Correct me if I am wrong, thanks!