ReplicaSets deploy and maintain a defined number of Pods, all generated from a common template and a count. They're generally not created directly, instead created as part of a Deployment.
From ReplicationControllersGo to text →
- A selector, which matches Pods.
- A count of
replicasdefining the desired number of Pods.
- A Pod
template, used for creation of new Pods.
apiVersion: apps/v1 kind: ReplicaSet metadata: name: my-app spec: replicas: 12 selector: matchLabels: app: my-app template: metadata: labels: app: my-app spec: containers: - name: nginx image: nginx