Directly using ReplicaSet

A ReplicaSet's purpose is to maintain a stable set of replica Pods running at any given time. However, a Deployment is a higher-level concept that manages ReplicaSets and provides declarative updates to Pods along with a lot of other useful features. Therefore, we recommend using Deployments instead of directly using ReplicaSets.

Affected Resources: ReplicaSet

Example

apiVersion: apps/v1 kind: ReplicaSet metadata: name: frontend spec: replicas: 3 selector: matchLabels: tier: frontend template: metadata: labels: tier: frontend spec: containers: - name: nginx image: nginx:1.21.6

Resolution

  • Use Deployment instead of ReplicaSet.
  • Resolution Example

    apiVersion: apps/v1 kind: Deployment metadata: name: frontend spec: replicas: 3 selector: matchLabels: tier: frontend template: metadata: labels: tier: frontend spec: containers: - name: nginx image: nginx:1.21.6
    Share this article on:
    message