replicaset > pod
이미 생성된 pod 도 포함할 수있음.
kubectl get rs
NAME DESIRED CURRENT READY AGE
new-replica-set 4 4 0 58s
kubectl describe rs new-replica-set
Name: new-replica-set
Namespace: default
Selector: name=busybox-pod
Labels: <none>
Annotations: <none>
Replicas: 4 current / 4 desired
Pods Status: 0 Running / 4 Waiting / 0 Succeeded / 0 Failed
Pod Template:
Labels: name=busybox-pod
Containers:
busybox-container:
Image: busybox777
Port: <none>
Host Port: <none>
Command:
sh
-c
echo Hello Kubernetes! && sleep 3600
Environment: <none>
Mounts: <none>
Volumes: <none>
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal SuccessfulCreate 88s replicaset-controller Created pod: new-replica-set-zq26s
Normal SuccessfulCreate 88s replicaset-controller Created pod: new-replica-set-thgc8
Normal SuccessfulCreate 88s replicaset-controller Created pod: new-replica-set-9jk58
Normal SuccessfulCreate 88s replicaset-controller Created pod: new-replica-set-7kpwk
kubectl describe pod new-replica-set-7kpwk
check event
apps/v1
selector matchLabels = template metadata labels
apiVersion: apps/v1
kind: ReplicaSet
metadata:
name: replicaset-1
spec:
replicas: 2
selector:
matchLabels:
tier: frontend
template:
metadata:
labels:
tier: frontend
spec:
containers:
- name: nginx
image: nginx
kubectl delete rs replicaset-2
kubectl edit rs new-replica-set
kubectl scale --replicas 0 rs new-replica-set
kubectl scale --replicas 4 rs new-replica-set