欧阳维*_*阳维杰 0 kubernetes kubectl
我使用以下命令打印所有 Pod:
$ kubectl get pods --all-namespaces
Run Code Online (Sandbox Code Playgroud)
输出是:
NAMESPACE NAME READY STATUS RESTARTS AGE
calico-system calico-kube-controllers-7487d7f956-hx4fp 1/1 Running 0 88m
calico-system calico-node-vn52p 1/1 Running 0 88m
calico-system calico-typha-7588984c44-m6tsz 1/1 Running 0 88m
gitlab-managed-apps install-ingress 0/1 Error 0 14m********
gitlab-managed-apps install-prometheus 0/1 Error 0 12m
kube-system coredns-f9fd979d6-2n2pg 1/1 Running 0 91m
kube-system coredns-f9fd979d6-sq9bl 1/1 Running 0 91m
kube-system etcd-tuoputuo-iamnotstone-server 1/1 Running 0 91m
kube-system kube-apiserver-tuoputuo-iamnotstone-server 1/1 Running 0 91m
kube-system kube-controller-manager-tuoputuo-iamnotstone-server 1/1 Running 0 91m
kube-system kube-proxy-87jkr 1/1 Running 0 91m
kube-system kube-scheduler-tuoputuo-iamnotstone-server 1/1 Running 0 91m
tigera-operator tigera-operator-58f56c4958-4x9tp 1/1 Running 0 89m
Run Code Online (Sandbox Code Playgroud)
但是当我执行日志命令时:
$ kubectl logs -f install-ingress
Run Code Online (Sandbox Code Playgroud)
我看到这个错误
Error from server (NotFound): pods "install-ingress" not found
Run Code Online (Sandbox Code Playgroud)
该install-ingress吊舱是在gitlab-managed-apps命名空间。如果您没有在kubectl命令中指定命名空间,那么它将在默认命名空间中搜索install-ingress不存在 Pod 的 Pod。
您能否尝试以下命令(指定 pod 的命名空间)。
kubectl logs -f install-ingress -n gitlab-managed-apps
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
52 次 |
| 最近记录: |