Skip to main content

ReplicationController Deployment

·106 words·1 min
Jack Warner
Author
Jack Warner
A little blog by me

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_app
    • type: 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: 80

To check

kubectl get rc nginx-replicationcontroller
kubectl get pods -l app=nginx_app,type=front-end

Related