Deployment
从一个例子开始
kubectl run nginx-deployment --image=nginx:1.7.9 --replicas=2
kubectl get deployment nginx-deployment 查看状态
通过kubectl describe deployment nginx-deploymnet查看详细的创建过程
重点看最下面:NewReplicaSet: nginx-deployment-6fb585c4cc (2/2 replicas created)
Event:是deployment的日志
所以说deployment通过replicaset来管理pod
通过kubactl describe replicaset nginx-deployment-6fb585c4cc
Controlled By: Deployment/nginx-deployment 记录replicaset由nginx-deployment创建
Events 记录了两个副本 Pod 的创建
通过kubectl get pod 查看pod
查看pod详细信息:
kubectl describe pod nginx-deployment-6fb585c4cc-cnrqh
Controlled By: ReplicaSet/nginx-deployment-6fb585c4cc 由ReplicaSet创建的
总结deployment创建过程:
1.用户通过kubectl创建deployment
2.Deployment创建replicaset
3.replicaset创建pod
此为盗图
其中命名方式:子对象的名字 = 父对象名字
+ 随机字符串或数字