我正在使用 Cloud Code for Intellij (PyCharm) 构建 Cloud Run 服务,并且在本地部署失败之前,ide 无法访问部署错误日志:
...
Step 7/8 : COPY . .
---> d239cd803bb2
Step 8/8 : CMD exec uvicorn main:app --host 0.0.0.0 --port $PORT --workers 1
---> Running in 1b76770ca2db
---> 60404f7887c5
Successfully built 60404f7887c5
Successfully tagged directory:latest
Tags used in deployment:
- directory -> directory:60404f7887c5697f9d89b5c5d670803028042c8f7963a220193501416cfe470f
Starting deploy...
- deployment.apps/directory created
- service/directory created
Waiting for deployments to stabilize...
- deployment/directory: container directory-container terminated with exit code 1
- pod/directory-d7cb9b968-cndxx: container directory-container terminated with exit code 1
> Error retrieving logs for pod directory-d7cb9b968-cndxx. Try `kubectl logs directory-d7cb9b968-cndxx -n default -c directory-container`
- deployment/directory failed. Error: container directory-container terminated with exit code 1.
Cleaning up...
- deployment.apps "directory" deleted
- service "directory" deleted
exiting dev mode because first deploy failed: 1/1 deployment(s) failed
任何人都知道如何访问这些日志,以便我可以找出服务失败的原因?我尝试了通过打开 CLI 到“cloud-run-dev-internal”docker 容器建议的 kubectl 命令,但似乎 kubectl 没有安装在那里,并且从主机操作系统(MacOS)连接运行它被拒绝。