1.

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

Answer»

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 RC 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


Discussion

No Comment Found

Related InterviewSolutions