Is there a way to make a pod to automatically come up when the host restarts

0 votes
How can i configure my pod to be up automatically whenever the host restarts? Is this possible? How?
Jul 19, 2019 in Kubernetes by Zoya
2,429 views

1 answer to this question.

0 votes

Yes using replication controller but it may reschedule to another host if you have multiple nodes in the cluster

A replication controller is a supervisor for long-running pods. 

An Replication Controller will launch a specified number of pods called replicas and makes sure that they keep running. 

Replication Controller only supports the simple map-style `label: value` selectors. 

Also, Replication Controller and ReplicaSet aren't very different. You could think of ReplicaSet as Replication Controller. The only thing that is different today is the selector format. 

If pods are managed by a replication controller or replication set you can kill the pods and they'll be restarted automatically. 

The yaml definition is as given below:

apiVersion: v1
kind: ReplicationController
metadata:
name: test
spec:
replicas: 3
selector:
app: test
template:
metadata:
name: test
labels:
app: test
spec:
containers:
name: test
image: image/test
ports:
containerPort: 80
answered Jul 19, 2019 by Sirajul
• 59,230 points

Related Questions In Kubernetes

0 votes
2 answers

Is there a way to start a cron job manually

You can create a simple job based ...READ MORE

answered Sep 18, 2018 in Kubernetes by Nilesh
• 7,060 points
10,808 views
0 votes
1 answer

Is it possible to force the pod to run on a specific node?

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

answered Jul 15, 2019 in Kubernetes by Sirajul
• 59,230 points
1,347 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,571 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,058 views
0 votes
1 answer
+1 vote
1 answer
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