7.Deploy ReplicaSet in Kubernetes Cluster

Published: (February 16, 2026 at 09:30 PM EST)
2 min read
Source: Dev.to

Source: Dev.to

Lab Information

The Nautilus DevOps team is preparing to deploy applications on a Kubernetes cluster for migration. One task is to create a ReplicaSet with the following specifications:

  • Image: httpd:latest
  • ReplicaSet name: httpd-replicaset
  • Labels: app=httpd_app, type=front-end
  • Container name: httpd-container
  • Replica count: 4

Note: The kubectl utility on jump_host is already configured to interact with the Kubernetes cluster.

ReplicaSet Manifest (httpd-replicaset.yaml)

apiVersion: apps/v1
kind: ReplicaSet
metadata:
  name: httpd-replicaset
  labels:
    app: httpd_app
    type: front-end
spec:
  replicas: 4
  selector:
    matchLabels:
      app: httpd_app
      type: front-end
  template:
    metadata:
      labels:
        app: httpd_app
        type: front-end
    spec:
      containers:
      - name: httpd-container
        image: httpd:latest
        ports:
        - containerPort: 80

Apply the ReplicaSet

kubectl apply -f httpd-replicaset.yaml

Verify the Deployment

  • Check that the ReplicaSet was created

    kubectl get replicaset httpd-replicaset
  • List the Pods created by the ReplicaSet

    kubectl get pods
  • Get detailed information about the ReplicaSet

    kubectl describe replicaset httpd-replicaset

Resources & Next Steps

Credits

  • All labs are from KodeKloud.
0 views
Back to Blog

Related posts

Read more »