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 in Kubernetes by Zoya
39 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 by Sirajul
• 40,990 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
• 6,920 points
682 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 in Kubernetes by Sirajul
• 40,990 points
64 views
0 votes
1 answer
0 votes
3 answers

Error while joining cluster with node

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

answered Jan 17 in Others by anonymous
3,412 views
+3 votes
1 answer
0 votes
1 answer