部署(Deployment)控制器为Pod和ReplicaSet提供声明性更新。
apiVersion: apps/v1beta1 # for versions before 1.6.0 use extensions/v1beta1 kind: Deployment metadata: name: nginx-deployment spec: replicas: 3 template: metadata: labels: app: nginx spec: containers: - name: nginx image: nginx:1.7.9 ports: - containerPort: 80
kubectl get deployments
kubectl describe deployment
kubectl describe deployment xxx-deployment
kubectl delete deployment xxx-deployment
kubectl get pods -l app=nginx # -l即label