If there are too many pods, the Replication Controller terminates the extra pods. If there are too few, the
Replication Controller starts more pods
1.
A relocation controller is an object that enable you to easily create multiple pods, then make sure that
number of pods always exists.
2.
if a pod get crashed, terminated then RC will automatically recreate the new pod with similar
configuration.
3.
4. RC is recommended if you just want to make sure 1 pod is always running, even after system reboot.
5. You can run the RC with 1 replica & the RC make sure that pod is always running.
xxxxxxxxxx
apiVersion: v1
kind: ReplicationController
metadata:
name: rcpod
spec:
replicas: 3
selector:
app: rcpod
template:
metadata:
name: rcpod
labels:
app: rcpod
spec:
containers:
- name: rcpod
image: ubuntu
command: ["/bin/bash", "-c", "while true; do echo c1; sleep 5 ; done"]