Kubernetes中的ReplicationController和ReplicaSet
$ kubectl get pods
NAME READY STATUS RESTARTS AGE
kubia-j8tth 0/1 ContainerCreating 0 35s
kubia-jkt8g 1/1 Running 0 35s
$ kubectl describe rc kubia
Name: kubia
Namespace: kubia
Selector: app=kubia
Labels: app=kubia
Annotations: Replicas: 2 current / 2 desired
Pods Status: 1 Running / 1 Waiting / 0 Succeeded / 0 Failed
Pod Template:
Labels: app=kubia
Containers:
kubia:
Image: wangjunjian/kubia:latest
Port: 8080/TCP
Host Port: 0/TCP
Environment: <none>
// ...
当删除 Pod 对象后,ReplicationController 会自动创建新的 Pod 对象来满足期望的副本个数。
$ kubectl delete pod kubia-jkt8g
pod "kubia-jkt8g" deleted
