Error from server (BadRequest): a container name must be specified for pod

简介: Error from server (BadRequest): a container name must be specified for pod

报错


kubectl logs pod-name -n namespace

error: a container name must be specified for pod *, choose one of: [**] or one of the init containers: [**]

1

2

原因:本来一个pod使用了一个容器,当使用查看pod日志的命令时,会输出该pod的容器的日志…

一个pod中启用了多个容器,从此查看日志时需要指定查看该pod的哪个容器,可通过命令 -c <container_name> 指定,报错中的choose one of列出的是可查看的容器名称


kubectl logs podname -c containerName-n namespace


kubectl logs -f  -n kubesphere-devops-system           nodejs-296hl -c jnlp

相关文章
|
Kubernetes 容器 Perl
【kubernetes】解决: kubelet Failed to create pod sandbox: rpc error: code = Unknown desc = faile...
【kubernetes】解决: kubelet Failed to create pod sandbox: rpc error: code = Unknown desc = faile...
10756 0
|
Web App开发 Cloud Native Docker
删除容器报错:Error response from daemon: conflict: unable to delete
云原生日益普及的现在,docker容器化成为现有很多服务的改进方向,docker凭借更高效的利用系统资源、更快速的启动时间、一致的运行环境、持续支付和部署、更轻松的迁移、更轻松的维护和拓展等优势,迅速走红。但是,很多容器部署后在回收时,都会遇到各种各样的问题,比如今天讨论的删除镜像的问题,有时候删除操作会莫名其妙的报错。
910 1
|
3月前
|
API Windows 容器
【Azure Fabric Service】Service Fabric 遇见错误信息记录 - The process/container terminated with exit code:2148734499
【Azure Fabric Service】Service Fabric 遇见错误信息记录 - The process/container terminated with exit code:2148734499
|
3月前
|
Kubernetes 容器
Kubernetes(K8S) 安装 Metrics-Server kubectl top (metrics-server) node NotFound
Kubernetes(K8S) 安装 Metrics-Server kubectl top (metrics-server) node NotFound
49 0
|
5月前
|
小程序
Failed to load local image resource Xx the server responded with a status of of 500 (HTTP/1.1 500)
Failed to load local image resource Xx the server responded with a status of of 500 (HTTP/1.1 500)
145 4
|
6月前
|
Docker 容器
Docker服务启动失败报错:Job for docker.service failed because the control process exited with error code.
Docker服务启动失败报错:Job for docker.service failed because the control process exited with error code.
|
6月前
|
Kubernetes Docker 容器
Job for docker.service failed because the control process exited with error code.
Job for docker.service failed because the control process exited with error code.
252 0
|
网络协议 网络安全 Docker
Docker Swarm 解决报错Error response from daemon: rpc error: code = Unavailable desc = connection error:
本文是博主学习docker swarm遇到的问题记录,希望对大家有所帮助。
1547 0
Docker Swarm 解决报错Error response from daemon: rpc error: code = Unavailable desc = connection error:
|
6月前
|
Kubernetes 容器
使用kubeadm部署k8s报错:The kubelet is not running或者level=error msg="Handler for POST /v1.43/images/create returned error: Head \"https://us-west2-dock
使用kubeadm部署k8s报错:The kubelet is not running或者level=error msg="Handler for POST /v1.43/images/create returned error: Head \"https://us-west2-dock
|
6月前
|
Kubernetes 容器
【kubernetes】解决k8s1.28.4:"command failed" err="failed to parse kubelet flag: unknown flag: --c...
【kubernetes】解决k8s1.28.4:"command failed" err="failed to parse kubelet flag: unknown flag: --c...
1093 0