Skip to main content

ReplicaSet

·61 words·1 min
Jack Warner
Author
Jack Warner
A little blog by me
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

Apply the ReplicaSet

kubectl apply -f httpd-replicaset.yaml

Verify the ReplicaSet

kubectl get replicaset httpd-replicaset

Check the pods created by the ReplicaSet

kubectl get pods -l app=httpd_app

Related