kubernetes - kubectl 不输出日志
问题描述
我用以下方式打印我所有的 Pod:
$ kubectl get pods --all-namespaces
输出是:
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
但是当我执行日志命令时:
$ kubectl logs -f install-ingress
我看到这个错误
Error from server (NotFound): pods "install-ingress" not found
解决方案
install-ingress
pod 在命名gitlab-managed-apps
空间中。如果您没有在kubectl
命令中指定命名空间,那么它将在不存在该 pod 的默认命名空间中搜索该 pod。install-ingress
您能否尝试以下命令(指定 pod 的命名空间)。
kubectl logs -f install-ingress -n gitlab-managed-apps
推荐阅读
- jquery - 如何选择 val?[私人]
- spring - Sprint 启动:POST 带有外键的实体
- java - 如何从 sql3 数据库中获取时间并转换为 LocalTime
- or-tools - 车辆路径问题,如何调用数据
- javascript - 将不同元素的js数组传递给php进行验证并存储在mysql数据库中?
- php - 如何从上到下拆分 2 列的数据?
- python-3.x - 如何在 Python 3 中逐行汇总文本文件中的所有数字并存储到不同的文件中
- python - 如何使 Hexchat 线程安全的 Python 插件?
- python - ModuleNotFoundError:没有名为“pkg”的模块
- javascript - 异步函数不返回 json 对象