Notes of Kubernetes Operation

HoistTheColorsAndStepToTheRail

kubectl

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

    • create
    • get
    • delete
    • describe
  • 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)
    image.png

Generate a yaml

  • kubectl create

    # Generate a yaml but not actually create the deployment
    kubectl create deployment DeployTest --image=nginx -o yaml --dry-run
    
    kubectl create deployment DeployTest --image=nginx -o yaml --dry-run > m1.yaml
  • kubectl get
    Export a yaml from a deployed application
    image.png
阅读 81
1 声望
0 粉丝
0 条评论
你知道吗?

1 声望
0 粉丝
文章目录
宣传栏