kubernetes.config.config_exception.ConfigException: Service host/port is not set. #87
NinhVanChuong
started this conversation in
Deployment
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have downloaded the Docker image in the package and deployment example docker compose. They both raise the error kubernet config Service host/port is not set. I don't know what I'm missing, I hope you can help me.
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
[2022-11-16 01:14:15 +0000] [1] [INFO] Starting gunicorn 20.1.0
[2022-11-16 01:14:15 +0000] [1] [INFO] Listening at: http://0.0.0.0:8000 (1)
[2022-11-16 01:14:15 +0000] [1] [INFO] Using worker: runboat.uvicorn.RunboatUvicornWorker
[2022-11-16 01:14:15 +0000] [8] [INFO] Booting worker with pid: 8
[01:14:18] DEBUG Using selector: EpollSelector [asyncio]
[2022-11-16 01:14:18 +0000] [8] [INFO] Started server process [8]
[2022-11-16 01:14:18 +0000] [8] [INFO] Waiting for application startup.
[2022-11-16 01:14:18 +0000] [8] [ERROR] Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/starlette/routing.py", line 645, in lifespan
async with self.lifespan_context(app):
File "/usr/local/lib/python3.10/site-packages/starlette/routing.py", line 540, in aenter
await self._router.startup()
File "/usr/local/lib/python3.10/site-packages/starlette/routing.py", line 622, in startup
await handler()
File "/app/runboat/app.py", line 17, in startup
await k8s.load_kube_config()
File "/app/runboat/utils.py", line 25, in inner
return await asyncio.get_running_loop().run_in_executor(_pool, f)
File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
File "/app/runboat/k8s.py", line 40, in load_kube_config
config.load_incluster_config()
File "/usr/local/lib/python3.10/site-packages/kubernetes/config/incluster_config.py", line 121, in load_incluster_config
try_refresh_token=try_refresh_token).load_and_set(client_configuration)
File "/usr/local/lib/python3.10/site-packages/kubernetes/config/incluster_config.py", line 54, in load_and_set
self._load_config()
File "/usr/local/lib/python3.10/site-packages/kubernetes/config/incluster_config.py", line 62, in _load_config
raise ConfigException("Service host/port is not set.")
kubernetes.config.config_exception.ConfigException: Service host/port is not set.
[2022-11-16 01:14:18 +0000] [8] [ERROR] Application startup failed. Exiting.
[2022-11-16 01:14:18 +0000] [8] [INFO] Worker exiting (pid: 8)
[2022-11-16 01:14:18 +0000] [1] [INFO] Shutting down: Master
[2022-11-16 01:14:18 +0000] [1] [INFO] Reason: Worker failed to boot.
The terminal process "/bin/bash '-c', 'docker run --rm -it -p 8000:8000/tcp ghcr.io/sbidoul/runboat:latest'" terminated with exit code: 3.
docker compone:
Runboat) (base) Ninhs-MacBook-Pro:runboat vanchuong$ uvicorn runboat.app:app --log-config=log-config.yaml
[08:25:36] DEBUG Using selector: KqueueSelector [asyncio]
[08:25:37] INFO Started server process [23575] [uvicorn.error]
INFO Waiting for application startup. [uvicorn.error]
ERROR Traceback (most recent call last):
File
"/Users/vanchuong/python-venv/3.10/Runboat/lib/python3.10/site-packages/starlette/r
outing.py", line 645, in lifespan
async with self.lifespan_context(app):
File
"/Users/vanchuong/python-venv/3.10/Runboat/lib/python3.10/site-packages/starlette/r
outing.py", line 540, in aenter
await self._router.startup()
File
"/Users/vanchuong/python-venv/3.10/Runboat/lib/python3.10/site-packages/starlette/r
outing.py", line 622, in startup
await handler()
File "/Users/vanchuong/Documents/git/runboat/src/runboat/app.py", line 17, in
startup
await k8s.load_kube_config()
File "/Users/vanchuong/Documents/git/runboat/src/runboat/utils.py", line 25, in
inner
return await asyncio.get_running_loop().run_in_executor(_pool, f)
File
"/opt/homebrew/Cellar/[email protected]/3.10.8/Frameworks/Python.framework/Versions/3.10/
lib/python3.10/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
File "/Users/vanchuong/Documents/git/runboat/src/runboat/k8s.py", line 40, in
load_kube_config
config.load_incluster_config()
File
"/Users/vanchuong/python-venv/3.10/Runboat/lib/python3.10/site-packages/kubernetes/
config/incluster_config.py", line 121, in load_incluster_config
try_refresh_token=try_refresh_token).load_and_set(client_configuration)
File
"/Users/vanchuong/python-venv/3.10/Runboat/lib/python3.10/site-packages/kubernetes/
config/incluster_config.py", line 54, in load_and_set
self._load_config()
File
"/Users/vanchuong/python-venv/3.10/Runboat/lib/python3.10/site-packages/kubernetes/
config/incluster_config.py", line 62, in _load_config
raise ConfigException("Service host/port is not set.")
kubernetes.config.config_exception.ConfigException: Service host/port is not set.
[uvicorn.error]
ERROR Application startup failed. Exiting. [uvicorn.error]
Beta Was this translation helpful? Give feedback.
All reactions