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

Add OS topology key to node segments map #1950

Merged
merged 1 commit into from
Mar 1, 2024

Conversation

torredil
Copy link
Member

What is this PR about? / Why do we need it?

This PR introduces the addition of an (OS) topology key to the node segments map returned by NodeGetInfo within the node service.

The change enables scoping down a StorageClass using the allowedTopologies attribute to an OS type. It is backward compatible and should not impact existing deployments. Nodes will simply start reporting additional topology information post-update.

Fixes #1946

What testing is done?

make test && manual testing && CI e2e

Example StorageClass:

apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  name: ebs-sc
provisioner: ebs.csi.aws.com
volumeBindingMode: WaitForFirstConsumer
allowedTopologies:
- matchLabelExpressions:
  - key: kubernetes.io/os
    values:
    - windows
  - key: topology.ebs.csi.aws.com/zone
    values:
    - us-east-2c

Without this patch:

  Warning  ProvisioningFailed    4s (x4 over 11s)  ebs.csi.aws.com_ebs-csi-controller-56bfc45bc5-5ckcz_d0df82a6-2e08-4622-b0ec-dbe4927673e0  failed to provision volume with StorageClass "ebs-sc": error generating accessibility requirements: topology map[topology.ebs.csi.aws.com/zone:us-east-2c topology.kubernetes.io/zone:us-east-2c] from selected node "ip-192-168-28-75.us-east-2.compute.internal" is not in requisite: [map[kubernetes.io/os:linux topology.ebs.csi.aws.com/zone:us-east-2c]]

With this patch:

  Normal   ProvisioningSucceeded  17s                ebs.csi.aws.com_ebs-csi-controller-7bf457699-8b7gk_ead7e79a-c4ee-4ad9-a66e-bf02e146c62b   Successfully provisioned volume pvc-8f101bfd-d76a-45a7-88d3-05091814375c

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Feb 28, 2024
@k8s-ci-robot k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Feb 28, 2024
Copy link

Code Coverage Diff

This PR does not change the code coverage

Copy link
Contributor

@AndrewSirenko AndrewSirenko left a comment

Choose a reason for hiding this comment

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

Thanks for this paper-cut alleviation!

pkg/driver/driver.go Outdated Show resolved Hide resolved
pkg/driver/driver.go Outdated Show resolved Hide resolved
@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 29, 2024
pkg/driver/driver.go Outdated Show resolved Hide resolved
pkg/driver/driver.go Outdated Show resolved Hide resolved
pkg/driver/driver.go Outdated Show resolved Hide resolved
@ConnorJC3
Copy link
Contributor

/lgtm

Agree on renaming TopologyKey/WellKnownTopologyKey, would recommend name of ZoneTopologyKey over AZ, as "zone" is the terminology generally used by upstream k8s.

@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed lgtm "Looks good to me", indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Feb 29, 2024
@ConnorJC3
Copy link
Contributor

ConnorJC3 commented Feb 29, 2024

/lgtm

(might need gofmt pass?)

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 29, 2024
@torredil
Copy link
Member Author

torredil commented Mar 1, 2024

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: torredil

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 added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 1, 2024
@k8s-ci-robot k8s-ci-robot merged commit 68aea20 into kubernetes-sigs:master Mar 1, 2024
19 checks passed
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. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Include "kubernetes.io/os" in topology key
4 participants