Resplicaset

Kubernetes dla każdego – sztuka konteneryzacji

ReplicaSet

kubectl create -f replicaset.yaml utworzenie ReplicaSet

kubectl get rs wypisuje ReplicaSet

kubectl get pod -w wypisuje pody na bieżąco

kubectl scale rs <replicaSetName> --replicas=4 skalowanie replicaSet

replicaset.yaml

apiVersion: apps/v1
kind: ReplicaSet
metadata:
  name: replicaset-app
  labels:
    app: replicaset-app
    type: frontend
spec:
  template:
  {POD}
apiVersion: apps/v1
kind: ReplicaSet
metadata:
  name: frontend
spec:
  replicas: 3
  selector:
    matchLabels:
      app: frontend
  template:
    metadata:
      labels:
        app: frontend
    spec:
      containers:
        - name: frontend
          image: "nginx:1.17.3"