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)
    Notes of Kubernetes Operation_第1张图片

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
    Notes of Kubernetes Operation_第2张图片

你可能感兴趣的