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