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,061 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,050 points
10,198 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
819 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
14,593 views
+4 votes
1 answer

Installing Web UI (Dashboard):kubernetes-dashboard on main Ubuntu 16.04.6 LTS (Xenial Xerus) server

Follow these steps: $ kubeadm reset $ kubeadm init ...READ MORE

answered Apr 12, 2019 in Kubernetes by Kalgi
• 52,360 points

reshown Apr 12, 2019 by Kalgi 6,077 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