1. 获取所有的namespace

    1. kubectl get namespaces
    2. kubectl get pods --all-namespaces
    3. kubectl get pods -A
    4. kubectl get pods --namespace=shop

    2. 部署nginx到shop中

    1. kubectl run nginx --image=nginx --namespace=shop

    3. 通过label查询pods

    1. kubectl get pods --namespace=shop -l "app=user-service"

    https://kubernetes.io/zh-cn/docs/concepts/overview/working-with-objects/labels/

    4. 查看pod的日志

    1. kubectl logs --namespace=shop -l "app=user-service"

    5. 查看pods更多的详细信息

    1. kubectl get pods --namespace=shop -l "app=user-service" -o wide

    6. 更多的pods相关的命令

    https://kubernetes.io/docs/reference/kubectl/generated/kubectl_get/

    https://kubernetes.io/zh-cn/docs/reference/kubectl/cheatsheet/