ReplicationController Overview
The Nautilus DevOps team is setting up a ReplicationController to ensure high availability by running multiple identical pods.
Requirements #
- Image:
nginx:latest - Name:
nginx-replicationcontroller - Replicas:
3 - Labels:
app: nginx_apptype: front-end
- Container name:
nginx-container - All pods must be in Running state after deployment
ReplicationController Manifest #
Create the ReplicationController using the following YAML:
apiVersion: v1
apiVersion: v1
kind: ReplicationController
metadata:
name: nginx-replicationcontroller
labels:
app: nginx_app
type: front-end
spec:
replicas: 3
selector:
app: nginx_app
type: front-end
template:
metadata:
labels:
app: nginx_app
type: front-end
spec:
containers:
- name: nginx-container
image: nginx:latest
ports:
- containerPort: 80To check
kubectl get rc nginx-replicationcontroller
kubectl get pods -l app=nginx_app,type=front-end