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

generic ephemeral volume GA #105609

Merged
merged 4 commits into from
Oct 29, 2021

Conversation

pohly
Copy link
Contributor

@pohly pohly commented Oct 11, 2021

What type of PR is this?

/kind feature

What this PR does / why we need it:

Generic ephemeral volume has met the GA criteria and is meant to graduate to GA in 1.23.

Special notes for your reviewer:

This contains two other minor PRs that were still pending when creating this PR:

Some other locations where the helper functions could be used were found when removing the feature gate.

Does this PR introduce a user-facing change?

The "Generic Ephemeral Volume" feature graduates to GA. It is now enabled unconditionally.

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:

- [KEP]: https://github.com/kubernetes/enhancements/blob/e669a1483064f4a3f248e78c9b8399858ca75f66/keps/sig-storage/1698-generic-ephemeral-volumes/README.md

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/feature Categorizes issue or PR as related to a new feature. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. do-not-merge/contains-merge-commits Indicates a PR which contains merge commits. labels Oct 11, 2021
@k8s-ci-robot k8s-ci-robot added area/kubelet area/test kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. sig/apps Categorizes an issue or PR as relevant to SIG Apps. sig/auth Categorizes an issue or PR as relevant to SIG Auth. sig/node Categorizes an issue or PR as relevant to SIG Node. sig/scheduling Categorizes an issue or PR as relevant to SIG Scheduling. sig/storage Categorizes an issue or PR as relevant to SIG Storage. sig/testing Categorizes an issue or PR as relevant to SIG Testing. and removed do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Oct 11, 2021
pohly added 2 commits October 11, 2021 17:33
The name concatenation and ownership check were originally considered small
enough to not warrant dedicated functions, but the intent of the code is more
readable with them.
The name concatenation and ownership check were originally considered small
enough to not warrant dedicated functions, but the intent of the code is more
readable with them.
@pohly pohly force-pushed the generic-ephemeral-volume-ga branch from 1dc06f8 to 23f29fe Compare October 11, 2021 15:34
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/contains-merge-commits Indicates a PR which contains merge commits. label Oct 11, 2021
@k8s-triage-robot
Copy link

This PR may require API review.

If so, when the changes are ready, complete the pre-review checklist and request an API review.

Status of requested reviews is tracked in the API Review project.

@pohly pohly changed the title generic ephemeral volume GA WIP: generic ephemeral volume GA Oct 11, 2021
@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Oct 11, 2021
@xing-yang
Copy link
Contributor

/assign @xing-yang

@k8s-ci-robot k8s-ci-robot added triage/accepted Indicates an issue or PR is ready to be actively worked on. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Oct 14, 2021
@sftim
Copy link
Contributor

sftim commented Oct 20, 2021

@pohly in the PR description, I think the hyperlink to the KEP is incorrect.

@pohly
Copy link
Contributor Author

pohly commented Oct 20, 2021

in the PR description, I think the hyperlink to the KEP is incorrect.

@sftim: What is the correct link? The template only says [KEP]: <link>, without going into details whether that should be the readme, the directory, or the enhancement issue.

@pohly
Copy link
Contributor Author

pohly commented Oct 22, 2021

The repo was wrong (pohly vs, kubernetes). Fixed.

pvcSource.ClaimName,
)
if isEphemeral {
if err := ephemeral.VolumeIsForPod(pod, pvc); err != nil {
Copy link
Member

@mauriciopoppe mauriciopoppe Oct 27, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The condition to throw an error was changed from:

ephemeral && !metav1.IsControlledBy(pvc, pod)

to

ephemeral && (pvc.Namespace != pod.Namespace || !metav1.IsControlledBy(pvc, pod))

I guess this is ok because the caller shouldn't pass a PVC that isn't from the same namespace as the pod as you pointed out

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct. ephemeral.VolumeIsForPod is more thorough because it's a general-purpose function that doesn't know whether the namespaces match. The semantic is the same.

AllowEphemeralVolumeType: utilfeature.DefaultFeatureGate.Enabled(features.GenericEphemeralVolume) ||
volumeInUse(old.(*policy.PodSecurityPolicy), policy.Ephemeral),
}
opts := validation.PodSecurityPolicyValidationOptions{}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This became:

AllowEphemeralVolumeType:  true || volumeInUse(old.(*policy.PodSecurityPolicy), policy.Ephemeral)

So it makes sense that AllowEphemeralVolumeType is removed

@@ -94,9 +94,6 @@ var ValidatePodSecurityPolicyName = apimachineryvalidation.NameIsDNSSubdomain

// PodSecurityPolicyValidationOptions contains additional parameters for ValidatePodSecurityPolicy.
type PodSecurityPolicyValidationOptions struct {
// AllowEphemeralVolumeType determines whether Ephemeral is a valid entry
// in PodSecurityPolicySpec.Volumes.
AllowEphemeralVolumeType bool
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If PodSecurityPolicyValidationOptions is always empty, is this still needed?

Copy link
Contributor Author

@pohly pohly Oct 28, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not now, but it may be needed again in the future. Therefore I kept it. Not removing it also avoids additional churn due to function prototype changes.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've pushed a commit which removes the struct. It's intentionally a separate commit to support reverting.

@xing-yang
Copy link
Contributor

/milestone v1.23

@k8s-ci-robot k8s-ci-robot added this to the v1.23 milestone Oct 28, 2021
Since the only member of that struct is gone, the struct itself can also be
removed. If for whatever reason the struct is needed again, then this commit
can be reverted to bring it back.
@k8s-ci-robot k8s-ci-robot added the sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. label Oct 28, 2021
@xing-yang
Copy link
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 28, 2021
@xing-yang
Copy link
Contributor

/assign @thockin

@pohly
Copy link
Contributor Author

pohly commented Oct 28, 2021

Can we also verify that all our storage_operation metrics are handling pvc ephemeral volumes appropriately?
...
We have e2e tests here: https://github.com/kubernetes/kubernetes/blob/master/test/e2e/storage/volume_metrics.go.

I updated those tests. They now run as "Volume Metrics Ephemeral" in https://testgrid.kubernetes.io/sig-storage-kubernetes#gce-serial. The recent test failures in that job are unrelated (#105965).

Copy link
Member

@thockin thockin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: pohly, thockin

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/kubelet area/test cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API kind/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. sig/apps Categorizes an issue or PR as relevant to SIG Apps. sig/auth Categorizes an issue or PR as relevant to SIG Auth. sig/node Categorizes an issue or PR as relevant to SIG Node. sig/scheduling Categorizes an issue or PR as relevant to SIG Scheduling. sig/storage Categorizes an issue or PR as relevant to SIG Storage. sig/testing Categorizes an issue or PR as relevant to SIG Testing. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
Archived in project
Archived in project
Development

Successfully merging this pull request may close these issues.