-
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
Downward API implementation for resources limits and requests #24179
Downward API implementation for resources limits and requests #24179
Conversation
587f290
to
6fafbea
Compare
6fafbea
to
960e33b
Compare
960e33b
to
16dc24c
Compare
16dc24c
to
85bfb54
Compare
85bfb54
to
54893f1
Compare
Updated PR. Will add more tests soon. |
54893f1
to
260841c
Compare
Added some validation tests and fixed some issues. |
I have tested it with following in case any one is interested: Env variables:
Volume plugin:
|
@bgrant0607 @derekwaynecarr @pmorie I have tested it with the above configs and also some other variations including error conditions. |
ContainerName string `json:"containerName,omitempty"` | ||
// Required: resource to select | ||
Resource string `json:"resource"` | ||
// Specifies the output format of the exposed resources |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add info about the default here.
@aveshagarwal this is moving in the right direction. Please add e2es for envs and volumes. |
260841c
to
55caeb0
Compare
@bgrant0607 @derekwaynecarr @pmorie I have updated this PR.
Still working on e2e for volume. |
55caeb0
to
d31acbd
Compare
Added e2e tests for volumes too now and tested locally to make sure they work. |
if downwardAPIVolumeFile.FieldRef != nil { | ||
allErrs = append(allErrs, validateObjectFieldSelector(downwardAPIVolumeFile.FieldRef, &validDownwardAPIFieldPathExpressions, fldPath.Child("fieldRef"))...) | ||
if downwardAPIVolumeFile.ResourceFieldRef != nil { | ||
allErrs = append(allErrs, field.Invalid(fldPath.Child("path"), "resource", "fieldRef and resourceFieldRef can not be specified simultaneously")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/.Child("path")//
@aveshagarwal I'll take the nits in a follow-up. LGTM. Thanks a lot. |
I see a failure in unit tests: FAIL k8s.io/kubernetes/pkg/api , it seems to be failing in pkg/api/serialization_test.go. |
I regenerated auto-generated files and when I test ./hack/test-go.sh pkg/api now it fails in pkg/api/copy_test.go. Not sure what is happening. |
I have found the solution and will just run the tests locally and update it and hopefully it should be good to go. |
d31acbd
to
1931931
Compare
I will re-tag once green |
This e2e failure does not seem related to this PR:
|
Seems similar to this: #26131 |
@pmorie all green, LGTM again? |
@bgrant0607 @derekwaynecarr can you tag it LGTM again? |
@k8s-bot test this [submit-queue is verifying that this PR is safe to merge] |
GCE e2e build/test passed for commit 1931931. |
Automatic merge from submit-queue |
This is an implementation of Downward API for resources limits and requests, and it works with environment variables and volume plugin.
This is based on proposal #24051. This implementation follows API with magic keys approach as discussed in the proposal.
@kubernetes/rh-cluster-infra
This change is