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

Add hostname and port environment variables to containers #284

Open
2 tasks done
pcfreak30 opened this issue Feb 25, 2025 · 3 comments
Open
2 tasks done

Add hostname and port environment variables to containers #284

pcfreak30 opened this issue Feb 25, 2025 · 3 comments

Comments

@pcfreak30
Copy link

Is your feature request related to a problem? Please describe.

Containers deployed on Akash have no way to know their own external hostnames and port mappings. This makes it impossible for applications to self-register or configure themselves properly without manual intervention. For example, when running database clusters, or monitoring, each node needs to know its own external endpoint to register with the cluster's configuration system.

Describe the solution you'd like

Add environment variables to all containers that provide:

The container's ingress hostname: AKASH_INGRESS_HOSTNAME
Any custom hostnames: AKASH_INGRESS_CUSTOM_HOSTNAME_{PORT}{INDEX}
External port mappings: AKASH_EXTERNAL_PORT
{PORT}

This would allow containers to programmatically access their own network information and use it for self-configuration, registration with service discovery, or sharing connection details with other systems.

Describe alternatives you've considered

no good alternatives

Search

  • I did search for other open and closed issues before opening this

Code of Conduct

  • I agree to follow this project's Code of Conduct

Additional context

See draft PR akash-network/provider#259

@Dimokus88
Copy link

Dimokus88 commented Feb 26, 2025

Hey @pcfreak30 !
Thanks for raising this issue.
So far, all deployments using IP lease have been limited to restarting the container with the IP_ADDRESS variable set, but this is certainly not the right solution. We need to make sure that when the environment starts, the container knows the IP assigned to it.
The same applies to ports, as you described.

@pcfreak30
Copy link
Author

pcfreak30 commented Feb 26, 2025

So far, all deployments using IP lease have been limited to restarting the container with the IP_ADDRESS variable set that cant even technically happen as you would need a manifest update to even do that.

And that doesnt work when you need the node port which only the k8 daemon knows. its impossible to know that info by accessing ipchicken or similar.

@pcfreak30
Copy link
Author

So far, all deployments using IP lease

This is not restricted to dedicated ips though. this is needing to know any self discovery. very few of my pods use a dedicated ip.

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

No branches or pull requests

2 participants