Articles → DOCKER → Replica Set In Kubernetes

Replica Set In Kubernetes






Purpose





Prerequisite





Create A YAML File




apiVersion: apps/v1
kind: ReplicaSet
metadata:
  name: my-replicaset
spec:
  replicas: 3
  selector:
    matchLabels:
      app: my-app
  template:
    metadata:
      labels:
        app: my-app
    spec:
      containers:
      - name: my-container
        image: nginx:latest
        ports:
        - containerPort: 80




kubectl apply -f replicaset.yaml


Picture showing the replica set created in kubernetes



Kubectl Get Rs Command




Picture showing the output of kubectl get rs command



Posted By  -  Karan Gupta
 
Posted On  -  Wednesday, January 31, 2024
 
Updated On  -  Saturday, February 3, 2024

Query/Feedback


Your Email Id
 
Subject
 
Query/FeedbackCharacters remaining 250