k8s Deployment

部署(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

  

 

posted @ 2019-09-05 11:02  happyyoung  阅读(141)  评论(0编辑  收藏  举报