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

Fix translation of Cinder storage classess to CSI #98311

Merged

Conversation

jsafrane
Copy link
Member

@jsafrane jsafrane commented Jan 22, 2021

/kind bug

What this PR does / why we need it:
In-tree Cinder storage class must be translated to CSI:

  • sc.parameters["fsType"] -> sc.parameters["csi.storage.k8s.io/fstype"]
  • sc.parameters["availability"] -> sc.allowedTopology (with CSI topology keys)
  • sc.allowedTopology (with in-tree topology keys) -> sc.allowedTopology (with CSI topology keys)

Found by running e2e tests with CSI migration enabled. One topology test failed:

[sig-storage] In-tree Volumes [Driver: cinder] [Testpattern: Dynamic PV (delayed binding)] topology should provision a volume and schedule a pod with AllowedTopologies [Suite:openshift/conformance/parallel] [Suite:k8s]

...

ProvisioningFailed: failed to provision volume with StorageClass "e2e-topology-1939-cinder-scf2rsm": error generating accessibility requirements: topology map[topology.cinder.csi.openstack.org/zone:nova] from selected node "jsafrane-5x4gw-worker-0-vc2z9" is not in requisite: [map[failure-domain.beta.kubernetes.io/zone:nova]]

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

Fixed provisioning of Cinder volumes migrated to CSI when StorageClass with AllowedTopologies was used.

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


@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/bug Categorizes issue or PR as related to a bug. size/M Denotes a PR that changes 30-99 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. labels Jan 22, 2021
@jsafrane
Copy link
Member Author

/sig storage
/priority important-soon

@k8s-ci-robot k8s-ci-robot added sig/storage Categorizes an issue or PR as relevant to SIG Storage. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. and removed do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Jan 22, 2021
@jsafrane jsafrane force-pushed the fix-cinder-topology-translation branch from 04450b7 to 1d34a35 Compare January 25, 2021 09:24
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jan 25, 2021
@jsafrane
Copy link
Member Author

/retest

@jsafrane jsafrane force-pushed the fix-cinder-topology-translation branch from 1d34a35 to 0333480 Compare January 25, 2021 11:19
@ialidzhikov
Copy link
Contributor

/test pull-kubernetes-integration

@jsafrane
Copy link
Member Author

cc @kubernetes/provider-openstack-pr-reviews, PTAL.

@msau42
Copy link
Member

msau42 commented Jan 27, 2021

/approve
/triage accepted

Will let openstack folks give final review

@k8s-ci-robot k8s-ci-robot added triage/accepted Indicates an issue or PR is ready to be actively worked on. approved Indicates a PR has been approved by an approver from all required OWNERS files. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Jan 27, 2021
@ramineni
Copy link
Contributor

@jsafrane sc.parameters["availability"] is still supported in CSI driver and takes priority over other topology keys if specified. So we dont need to translate the same?

}

if !reflect.DeepEqual(got, tc.expSc) {
t.Errorf("Got parameters: %v, expected :%v", got, tc.expSc)
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: typo

Suggested change
t.Errorf("Got parameters: %v, expected :%v", got, tc.expSc)
t.Errorf("Got parameters: %v, expected: %v", got, tc.expSc)

@jsafrane
Copy link
Member Author

@ramineni, you're right, I removed availability translation and added explicit unit tests it's not translated.

Still, migration to CSI was a great opportunity to drop the hack we had in Kubernetes StorageClasses and stop supporting two conflicting ways how to place volumes into zones. I did not find a clear statement if the CSI driver is GA or beta or alpha, is it too late to remove availability support from there? (If it's at least beta, then the answer is yes, it's too late).

@jsafrane jsafrane force-pushed the fix-cinder-topology-translation branch 2 times, most recently from 3caacfe to 4010c88 Compare January 28, 2021 09:50
@Fedosin
Copy link
Contributor

Fedosin commented Jan 28, 2021

/test pull-kubernetes-e2e-kind-ipv6

@Fedosin
Copy link
Contributor

Fedosin commented Jan 28, 2021

/test pull-kubernetes-verify

@mandre
Copy link
Contributor

mandre commented Jan 28, 2021

@ramineni, you're right, I removed availability translation and added explicit unit tests it's not translated.

Can you update the PR description and commit message to reflect the change you just made?

@ramineni
Copy link
Contributor

@ramineni, you're right, I removed availability translation and added explicit unit tests it's not translated.

Still, migration to CSI was a great opportunity to drop the hack we had in Kubernetes StorageClasses and stop supporting two conflicting ways how to place volumes into zones. I did not find a clear statement if the CSI driver is GA or beta or alpha, is it too late to remove availability support from there? (If it's at least beta, then the answer is yes, it's too late).

@jsafrane we did consider once before, but there was some issue (something with volume AZ , node AZ can be different). Dont remember exactly, I suppose, I can do some digging again if we could remove the redundancy. Thanks

@jsafrane jsafrane force-pushed the fix-cinder-topology-translation branch from 4010c88 to 1070cbe Compare January 28, 2021 10:49
@jsafrane
Copy link
Member Author

Ok, this PR does not touch availability now. I updated the commit message with the last push. PTAL

@ramineni
Copy link
Contributor

Thanks.
/lgtm

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

/retest
This bot automatically retries jobs that failed/flaked on approved PRs (send feedback to fejta).

Review the full test history for this PR.

Silence the bot with an /lgtm cancel or /hold comment for consistent failures.

In-tree Cinder storage class must be translated to CSI:
- sc.params["fsType"] -> sc.params["csi.storage.k8s.io/fstype"]
- sc.allowedTopology (with in-tree topology keys) -> sc.allowedTopology
  (with CSI topology keys)
@jsafrane
Copy link
Member Author

Fixed gofmt

@jsafrane jsafrane force-pushed the fix-cinder-topology-translation branch from 1070cbe to 9032f5e Compare January 28, 2021 15:22
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 28, 2021
Copy link
Contributor

@Fedosin Fedosin left a comment

Choose a reason for hiding this comment

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

/lgtm

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Fedosin, jsafrane, msau42

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

@k8s-ci-robot k8s-ci-robot merged commit 5cd694b into kubernetes:master Jan 29, 2021
@k8s-ci-robot k8s-ci-robot added this to the v1.21 milestone Jan 29, 2021
k8s-ci-robot added a commit that referenced this pull request Feb 4, 2021
…98311-upstream-release-1.20

Automated cherry pick of #98311: Fix translation of Cinder storage classess to CSI
k8s-ci-robot added a commit that referenced this pull request Feb 4, 2021
…98311-upstream-release-1.18

Automated cherry pick of #98311: Fix translation of Cinder storage classess to CSI
k8s-ci-robot added a commit that referenced this pull request Feb 4, 2021
…98311-upstream-release-1.19

Automated cherry pick of #98311: Fix translation of Cinder storage classess to CSI
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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. 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/storage Categorizes an issue or PR as relevant to SIG Storage. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants