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
Downward API EnvVar and VolFiles contain differing information, could use more examples #43222
Comments
Will close the issue as the main work is completed. |
Reopening this as I closed it in error. Will release PR with suggested fixes for this soon. |
/sig api-machinery |
Issues go stale after 90d of inactivity. Prevent issues from auto-closing with an If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or |
Stale issues rot after 30d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
Rotten issues close after 30d of inactivity. Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
I repro this on 1.8.1. |
I use downwardAPI like this
And in container I get $MY_NODE_ACCESSIP with null value. |
For those who wonder here in the future: the |
Some strange behavior regarding exposing labels through the ENV variables (reproduced with CronJob) - if I do the following:
When I describe my Pod (with
But, what I really get is:
So, it seems like it's not working, but when I read It's kind a bug, I think. Be aware of this behavior, because I spent hour or two to figure out that it's actually working (even it seems that's not working). My cluster info:
|
Is this a request for help? (If yes, you should use our troubleshooting guide and community support channels, see http://kubernetes.io/docs/troubleshooting/.): No
What keywords did you search in Kubernetes issues before filing this one? (If you have found any duplicates, you should instead reply there.): downward api
Is this a BUG REPORT or FEATURE REQUEST? (choose one): FEATURE REQUEST (sort of?)
Kubernetes version (use
kubectl version
):Client Version: version.Info{Major:"1", Minor:"5", GitVersion:"v1.5.3", GitCommit:"029c3a408176b55c30846f0faedf56aae5992e9b", GitTreeState:"clean", BuildDate:"2017-02-22T10:12:27Z", GoVersion:"go1.8", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"5", GitVersion:"v1.5.3", GitCommit:"029c3a408176b55c30846f0faedf56aae5992e9b", GitTreeState:"clean", BuildDate:"1970-01-01T00:00:00Z", GoVersion:"go1.7.3", Compiler:"gc", Platform:"linux/amd64"}
What happened:
The documentation on the DownwardAPI explains how to retrieve information, but does not state that most data is exclusive for each method of exposing data.
Node Name I have only been able to pull using envvars. To try 'spec.nodeName' as VolFile creates this error:
spec.volumes[0].downwardAPI.fieldRef.fieldPath: Unsupported value: "spec.nodeName": supported values: metadata.annotations, metadata.labels, metadata.name, metadata.namespace
From my testing, the following appears true:
Either method can get:
DAPI VolFiles can retrieve:
EnvVars can get:
The documentation currently doesn't describe this, and it seems like it should. It took me some time and digging to determine these differences, which I hadn't expected.
The documentation as it stands makes it seem the two methods are mostly interchangeable in terms of data. Even the text provided on "Exposing Pod Information to Containers Using a DownwardAPIVolFile" includes the information at the end, only mentioning what is exclusive to the DAPI VolFile and not what's exclusive to EnvVar:
The corresponding doc emphasizing the EnvVar approach, "Exposing Pod Information to Containers Through Environment Variables"
While it would be great to have both methods return the same data, this issue exists because I'm volunteering to flesh out the documentation (hopefully saving people some time digging) and to get confirmation that:
Again, whether the data should exist or not in certain places is not my issue; right now I simply want to document how it currently is to clear up confusion (and maybe the confusion is mine!)
The text was updated successfully, but these errors were encountered: