1.

If I have multiple containers running inside a pod, and I want to wait for a specific container to start before starting another one.

Answer»

ONE way is  Init Containers are for one-shot tasks that start, run, end; all before the next init container or the main container start, but  if a client in one container wants to consume some RESOURCES exposed by some server provided by another container or If the server  ever crashes or is restarted, the client will need to retry connections. So the client can retry always, EVEN if the server isn't up yet. The best way is sidecar pattern_ are where one container is the Main one, and other containers expose METRICS or logs or encrypted tunnel or somesuch. In these CASES, the other containers can be killed when the Main one is done/crashed/evicted.



Discussion

No Comment Found

Related InterviewSolutions