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

internal/external address #10

Closed
miekg opened this issue Dec 15, 2020 · 2 comments
Closed

internal/external address #10

miekg opened this issue Dec 15, 2020 · 2 comments

Comments

@miekg
Copy link
Collaborator

miekg commented Dec 15, 2020

Right now there is a bit of code that figures out what the external addresses are and which are internal. This assumes rfc-1918 address space, which may be a stretch.

We probable need the make flags for this if the defaults don't suite you. A pod can then use these by inspecting the node object (I think that how you do it) and set some env vars which can then be used.

My use case: prom metrics should be exposed on the private port.

@miekg
Copy link
Collaborator Author

miekg commented Dec 19, 2020

So. In k8s land you can not get the IP address of the node - this makes sense because why would a pod care. But systemk just uses the host networking and there you may care. I have the following use-case: I want to start coredns listening on the public interface (and or address), but the metrics should only be exported on the internal (or the other interface).
From within a Pod there is now easy way to get that other interface, you need to connect to the API, get the node object and jsonpath the stuff you need from there.
Another option is an init-container that does some ip addr dance, writes a file, which is then read by the other container and sets some env vars.

The option I'm pondering here is to have default environment variables that just hold this information: SYSTEMK_INTERNAL_IPV4 and the like. These would be set on startup and thus be available to all pods. I like this a lot, the biggest downside is this is not done in k8s, so your podspec isn't universal anymore.

The latter begs a bigger question, how much of the spec can we possibly support and when (and why) do we need to deviate?

@miekg
Copy link
Collaborator Author

miekg commented Dec 22, 2020

closed via #23

@miekg miekg closed this as completed Dec 22, 2020
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

1 participant