Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

K8S issue: Port is not a valid integer #69

Open
midzdotdev opened this issue Jan 16, 2023 · 1 comment
Open

K8S issue: Port is not a valid integer #69

midzdotdev opened this issue Jan 16, 2023 · 1 comment

Comments

@midzdotdev
Copy link

I started out this issue as a question, but now it's much more an answer to running EdgeDB on K8S.

I've seen this is a common issue for other packages (here and here), but I was surprised this hadn't already been reported for EdgeDB. To my eyes, taking a look at the entrypoint script EdgeDB's fix seems more involved than simply amending the container's environment variables.

Problem

Running a pod using edgedb/edgedb without overriding any environment variables gives me the following logs in my k8s dashboard.

Usage: edgedb-server.py [OPTIONS] COMMAND [ARGS]...
Try 'edgedb-server.py -h' for help.
Error: Invalid value for '-P' / '--port': 'tcp://10.245.182.142:5656' is not a valid integer

Running with EDGEDB_SERVER_PORT=5656 gives:

ERROR: EDGEDB_SERVER_PORT and EDGEDB_PORT are exclusive, but both are set.

EDGEDB_PORT is used as environment variable in the docker entrypoint script. We have to overwrite this.

Solution

Specify EDGEDB_PORT=5656 as an environment variable. The EdgeDB server will bind to 0.0.0.0 of the container and then you can expose the 5656 using a Kubernetes service object.

I'll leave this open and wait to be responded to and closed by an admin for SEO purposes.

To the EdgeDB contributors, would you be happy for Kubernetes to be added to the 'Deployments' section of the docs? We could include an example pod and service.

@midzdotdev midzdotdev changed the title Fails to run in Kubernetes K8S issue: Port is not a valid integer Jan 16, 2023
@elprans
Copy link
Member

elprans commented Jan 17, 2023

Ah, this is an annoying and dubious behavior of docker --link that is inherited by k8s. I think we can find a way to handle this nicely without the need for special cases, like we do in edgedb-python.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants