Notes|Notes of Kubernetes Operation

kubectl

kubectl [command] [TYPE] [NAME] [flags]

  • command
    • create
    • get
    • delete
    • describe
  • 【Notes|Notes of Kubernetes Operation】TYPE (to specify resource types)
    kubectl get pod pod1 kubectl get pods pod1 kubectl get po pod1

  • NAME (to specify resource name, if not specified, list all the resources)
    Notes|Notes of Kubernetes Operation
    文章图片
Generate a yaml
  • kubectl create
    # Generate a yaml but not actually create the deployment kubectl create deployment DeployTest --image=nginx -o yaml --dry-runkubectl create deployment DeployTest --image=nginx -o yaml --dry-run > m1.yaml

  • kubectl get
    Export a yaml from a deployed application
    Notes|Notes of Kubernetes Operation
    文章图片

    推荐阅读