关于kubernetes:Notes-of-Kubernetes-Operation

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)

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

评论

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

这个站点使用 Akismet 来减少垃圾评论。了解你的评论数据如何被处理