首页 > 技术文章 > k8s 基础 pod操作

guxiaobei 2017-11-07 08:47 原文

  • 创建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

     

推荐阅读