k8s 基礎 pod操作


  • 創建hell world pod

  •  
    #vim hello-world-pod.yaml
    
    apiVersion: v1
    kind: Pod
    metadata:
      name: hello-world
    spec:                                   配置pod的具體規格
      restartPolicy: OnFailure              
      containers:
      - name: hello
        image: "ubuntu:14.04"
        command: ["/bin/echo","Hello","world"]

    #kubectl create -f hello-world-pod.yaml

    #kubectl get pod hello-world 查詢 也可以用kubectl describe pod helloworld

    #kubectl logs hello-world


     

  • 刪除 pod   

  • kubectl delete pod hello
  • 更新Pod

  • kubctl replace hello-world.yaml

     


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM