-
Notifications
You must be signed in to change notification settings - Fork 41.1k
Add per-service env vars for *_SERVICE_HOST #1415
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
Conversation
Is it worth the energy to make these call-sites more resilient and fall-back on SERVICE_HOST if *_SERVICE_HOST does not exist? |
LGTM, making this fallback probably makes sense, since we have lots of old directions/binaries for installing k8s. --brendan |
So long as we're continuing to use environment variables, why not just support the Docker links format (e.g., FOO_PORT_5432_TCP_ADDR=172.17.0.5)? |
While you're updating the examples, it might be worth it to change |
Added fallbacks to SERVICE_HOST |
@razic - I'm going to decline that change for now - unrelated |
@thockin I agree w/ @bgrant0607 the links support is already in there: https://github.com/GoogleCloudPlatform/kubernetes/blob/master/pkg/registry/service/rest.go#L217 As long as we're changing the examples, let's change to use that syntax. |
From what docs I can find, docker's vars are of the form (with commentary by me)
Those variables? Or are there some that are actually useful. What we want to present is "what host is service 'foo' on?" and "what port is service 'foo' on?" None of these vars answer either of those questions. What am I missing? |
I think that DB_PORT_5432_TCP_PORT is equivalent to DB_PORT and On Tue, Sep 23, 2014 at 9:25 PM, Tim Hockin notifications@github.com
|
I don't get it. If I KNOW that the port is 5432, which must be the case in order for me to look up a variable with that number embedded in the name, why would I look up the value I already know? I'm fine adding these variables but I really think they are pointless. |
if you're exporting an explicit port (like 5432:5432) the variable is pointless. But say that you let docker assign a random port (:5432) then the DB_PORT_5432_TCP_PORT will give you that port. |
Since each container has its own IP, there is no need for docker style port I think the variables are exclusively for discovery. If you know what you Brendan
|
Caveat, maybe there is something that I am TOTALLY MISSING on why these are useful. If so, I'm happy to be wrong. @gust1n Actually not. At least not in my tests.
In order to use any of those variables, I have to already know the port number. That's fine, but I really don't see ANY point in saying I guess it's OK if you know the service name and port to get the IP, but is that really better than what we're offering with In short, I can not fathom why these vars are named the way they are. They seem less useful than they could be, to the point of near uselessness. |
@brendanburns We still have env vars, they are still useful for introspection (I call it "shopping"). But the ones we have are actually useful, rather than a waste of memory. |
As a replacement of a single SERVICE_HOST variable, offer a FOO_SERVICE_HOST variable. This will help ease the transition to ip-per-service, where there is no longer a single service host. # *** ERROR: *** Some files are missing the required boilerplate # header from hooks/boilerplate.txt: # examples/guestbook/redis-slave/run.sh # # Your commit will be aborted unless you fix these. # COMMIT_BLOCKED_ON_BOILERPLATE
FWIW, we already have all of the docker-compatible env vars populated, though there are bugs (I'll tackle some of those after this goes in). |
I'm going to take the previous LGTM and self-commit, because I have a followup PR and I want to keep moving. We can argue about how to spell the env vars later. |
Trying to run e2e first, not having much luck |
e2e passed. |
Add per-service env vars for *_SERVICE_HOST
…-release-4.10 [release-4.10] OCPBUGS-3434: UPSTREAM: 113517: kubelet: fix pod log line corruption when using timestamps and long lines
…n internal stores in reflector to limit memory usage bursts Signed-off-by: Valerian Roche <valerian.roche@datadoghq.com>
…n internal stores in reflector to limit memory usage bursts Signed-off-by: Valerian Roche <valerian.roche@datadoghq.com>
[client-go #1415] Use transformer from provided store within internal stores in reflector to limit memory usage bursts
…n internal stores in reflector to limit memory usage bursts Signed-off-by: Valerian Roche <valerian.roche@datadoghq.com>
… and ensure transformer is used in internal informer Signed-off-by: Valerian Roche <valerian.roche@datadoghq.com>
… and ensure transformer is used in internal informer Signed-off-by: Valerian Roche <valerian.roche@datadoghq.com>
…re to ensure DeltaFIFO and RealFIFO are implementing it Signed-off-by: Valerian Roche <valerian.roche@datadoghq.com>
As a replacement of a single SERVICE_HOST variable, offer a FOO_SERVICE_HOST
variable. This will help ease the transition to ip-per-service, where there
is no longer a single service host.