Controllers
- Controllers are part of Workload APIs
- Controllers can maintain desired state
Replication Controller.
- Replication controller can replicate pods.
- Desired State would be number of pods
- Gives Self-Healing Capability to K8S cluster
Writing Replication Controller Manifest YAML
- In Replication Controller’s spec we would have information of POD.
- Refer API Reference from here
---
apiVersion: v1
kind: ReplicationController
metadata:
name: tomcat-rc
spec:
replicas: 2
template:
metadata:
labels:
app: tomcat
spec:
containers:
- image: tomcat:8
name: tomcat
ports:
- containerPort: 8080
protocol: TCP
Like this:
Like Loading...