[英]Error: Unable to access jarfile (Kubernetes)
kubectl get pods -n abc
NAME READY STATUS RESTARTS AGE
abc-v2-78b59ccc4f-85xgr 0/1 CrashLoopBackOff 27 129m
Facing below error:面临以下错误:
> ➜ ~ kubectl logs -f abc-v2-78b59ccc4f-85xgr -n
Error: Unable to access jarfile abc.jar
I am assuming either jar is not present or required access is missing.我假设 jar 不存在或缺少所需的访问权限。 Pls guide me here, how to proceed.
请在这里指导我,如何进行。
Edit 1: As suggested by @howard-roark, Jar is available inside container, getting the same error message.编辑 1:正如@howard-roark 所建议的,Jar 在容器内可用,得到相同的错误消息。
Edit 2: Check results now with .jar in java command编辑 2:在 java 命令中使用 .jar 现在检查结果
Edit 4: Ideally there should be only one instance with running status.编辑 4:理想情况下应该只有一个处于运行状态的实例。
Kubernetes is a Container Orchestrator. Kubernetes 是一个容器编排器。 It runs your images as Containers.
它将您的图像作为容器运行。 The error you are showing looks like an application error and not a Kubernetes error.
您显示的错误看起来像是应用程序错误,而不是 Kubernetes 错误。 The way I would approach this is:
我处理这个问题的方法是:
docker run -it <image> /bin/bash
Or you can do a similar command via Kubernetes to exec into your pod:或者您可以通过 Kubernetes 执行类似的命令来执行到您的 pod:
kubectl run -i --tty testjavacontainer --image=<image> -- /bin/bash
In short, I would approach this as a standard java error , with the nuance that it happens to run in a container.简而言之,我会将其视为标准的 java 错误,其细微差别恰好是在容器中运行。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.