I have multiple containers running inside a kubernetes-pod and i want a specific container to start before starting another one How can i do this

0 votes
Jul 23, 2019 in Kubernetes by Ruby
2,341 views

1 answer to this question.

0 votes
  • One way is  Init Containers

  • These 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 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.

answered Jul 23, 2019 by Sirajul
• 59,230 points

Related Questions In Kubernetes

0 votes
2 answers

How do I force a pod to run on a specific node?

By default, anti-affinity is not attempted by Kubernetes as ...READ MORE

answered Aug 6, 2019 in Kubernetes by Sirajul
• 59,230 points
5,030 views
0 votes
1 answer
0 votes
1 answer

How do i tie a service to a pod or a set of pods?

By declaring pods with the label(s) and ...READ MORE

answered Jul 16, 2019 in Kubernetes by Sirajul
• 59,230 points
1,765 views
0 votes
1 answer

Can i configure my kubernetes pod to use multiple service accounts ?

A service account provides an identity for ...READ MORE

answered Jul 17, 2019 in Kubernetes by Sirajul
• 59,230 points
7,684 views
+1 vote
1 answer
0 votes
3 answers

Error while joining cluster with node

Hi Kalgi after following above steps it ...READ MORE

answered Jan 17, 2019 in Others by anonymous
15,477 views
+15 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 27, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
4,036 views
0 votes
1 answer

how can i access two containers that are inside a pod from the browser with IP address?

Just do port forward. kubectl port-forward [nginx-pod-name] 80:80 kubectl ...READ MORE

answered Jul 18, 2019 in Kubernetes by Sirajul
• 59,230 points
2,057 views
+1 vote
1 answer

How to use a Volume to communicate between two Containers running in the same Kubernetes-Pod?

Create a Pod that runs two Containers Create a ...READ MORE

answered Jul 23, 2019 in Kubernetes by Sirajul
• 59,230 points
2,586 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP