-
Notifications
You must be signed in to change notification settings - Fork 40k
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
Container downward/upward API umbrella issue #386
Comments
Would it be better to make this explicit in the manifest (VAR_A=$K8_POD_ID) rather than implicit? I ask because in Openshift we found this led to lazy coupling, and in scenarios where you have code that wants a unique id, you want to be able to alias names instead. At least that couples k8s to an image via a specific resource provided by k8s, vs making the image dependent on k8s. |
@smarterclayton Hmm. I see the case for doing the substitution in k8s rather than in the container, though I do have some concerns about introducing yet another substitution mechanism. I was thinking that, at least for now, any additional information the container wanted about itself could be retrieved by querying the apiserver, which would obviously also couple the querier to k8s. I think we are going to need to standardize on a "downward-facing API", including this type of contextual information (and also IP address, DNS name, auth info, etc.), but also a variety of notifications and/or hooks (#140). If we had hooks, we could make the context info available to the hooks, which could then normalize the info for the application. I see hooks as being necessarily specific to the hosting framework and other glue services. |
That's true, although one strong goal in docker has been to try and offer via libchan/libswarm a "Docker" abstraction where on multiple platforms images can invoke consistent actions that affect the platform. That applies to more generic operations, whereas k8s specific actions will always require some downwards API. The abstraction is a long term play that requires active participation by a number of stakeholders and also implemented, demonstrated use cases, so it's not an argument for avoiding trying. I don't think the downward API is bad, but some of the use cases (unique id for an instance, what ip do I have) might benefit from looser coupling or by trying to find the most lowest common denominator expression. In the end image authors can always ignore those settings, but you do want image users to have the tools to bend a recaltricant image to their will. |
As much as I want to keep this simple, Clayton's argument of using a non But what scope? Env vars only? Env vars and command lines?
|
I find it compelling, too. Internally, we have thousands of uses of the downward API, and I agree it introduces unnecessary coupling. OTOH, I'd like to think more about the configuration and parameterization story before introducing substitution. As opposed to the k8s-specific mechanism I proposed, perhaps we could start by thinking about what a typical application would need to know about itself and how that information could be provided in the least entangled manner. |
I propose a general approach: We should use/extend standard networking and filesystem-based mechanisms for the downward and upward container APIs as much as possible. We should not use custom environment variables (which can't be dynamically updated) nor REST APIs, and the mechanisms should not be intrinsically specific to Kubernetes (so no kubernetes in paths/names). Downward:
TODO: Master election, shard assignment. Upward:
References: |
Also, while we could make the paths configurable for some of these files, I don't think we need to. Users could set their own environment variables and evaluate them on the command line (as described in https://github.com/GoogleCloudPlatform/kubernetes/wiki/User-FAQ), or could extract the information in a PreStart hook (#140, #1445). |
Missing here - resource limits and usage? |
@thockin That's "resource discovery". |
We need to think hard about what cgroups interfaces we expose. On the one On Mon, Oct 6, 2014 at 9:13 PM, bgrant0607 notifications@github.com wrote:
|
@thockin User subcontainers is #1568. Perhaps the solution to that overlaps with resource discovery, or perhaps not. Rather than directly reading cgroup files, I'd be fine if they were wrapped with a system utility and/or library, but it shouldn't require a daemon and definitely shouldn't require a HTTP API. Ideally, Linux apps would not need to be container-aware in order to work. |
We don't need to design it here, but we should definitely make sure Vish, On Mon, Oct 6, 2014 at 9:58 PM, bgrant0607 notifications@github.com wrote:
|
Being discussed in Docker land: moby/moby#8427 |
We did some discussion on this topic starting around here: #2316 (comment) |
Rancher's metadata service: http://rancher.com/introducing-rancher-metadata-service-for-docker/ |
I propose we close this umbrella bug and open new issues for specific points remaining. |
Create a deployment as follows 😊 |
sync kubeadm.conf with core repo
We need to start establishing the "downward API", starting with enough context that a container can find out more information about itself.
I think that minimal info is:
K8S_APISERVER = host:port of apiserver
K8S_POD_ID
K8S_CONTAINER_NAME
The text was updated successfully, but these errors were encountered: