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

[controller] Add node selectors for csi components #58

Open
wants to merge 36 commits into
base: main
Choose a base branch
from

Conversation

AleksZimin
Copy link
Member

@AleksZimin AleksZimin commented Dec 24, 2024

Description

This PR introduces a nodeSelector setting in ModuleConfig that allows users to specify which nodes can run the csi-nfs components. Only on these selected nodes will be able to mount NFS shares into pods as volumes. The implementation includes safeguards to ensure that the removal of components does not disrupt active workloads.

Why do we need it, and what problem does it solve?

The addition of nodeSelector provides finer control over where csi-nfs components are deployed, ensuring NFS shares are only accessible on specific nodes. This setup improves operational control and resource utilization.

Without safeguard, changes to the nodeSelector could unintentionally disrupt workloads by prematurely removing csi-nfs components. The implemented checks prevent this by:

  1. Verifying that no pods with mounted NFS shares exist on a node before removing csi-nfs components from it.
  2. Ensuring that if the csi-controller is present on an excluded node, no volumesnapshot or PVC with the provisioner nfs.csi.k8s.io is in a Pending state.

What is the expected result?

  • csi-nfs components are deployed only on nodes matching the nodeSelector criteria.
  • Removal of csi-nfs components from nodes happens only when:
    • There are no pods with mounted NFS shares on the node.
    • For nodes running the csi-controller, there are no Pending volumesnapshot or PVC resources for the provisioner nfs.csi.k8s.io.
  • NFS functionality remains stable and operational during nodeSelector changes.

Checklist

  • The code is covered by unit tests.
  • e2e tests passed.
  • Documentation updated according to the changes.
  • Changes were tested in the Kubernetes cluster manually.

@AleksZimin AleksZimin marked this pull request as draft December 24, 2024 19:53
@AleksZimin AleksZimin self-assigned this Dec 24, 2024
@AleksZimin AleksZimin added the enhancement New feature or request label Dec 24, 2024
@AleksZimin AleksZimin changed the title [controller] add node selectors [controller] Add node selectors for csi components Dec 25, 2024
@AleksZimin AleksZimin marked this pull request as ready for review December 26, 2024 07:13
@AleksZimin AleksZimin requested a review from astef December 26, 2024 07:13
Signed-off-by: Aleksandr Zimin <alexandr.zimin@flant.com>
Signed-off-by: Aleksandr Zimin <alexandr.zimin@flant.com>
Signed-off-by: Aleksandr Zimin <alexandr.zimin@flant.com>
Signed-off-by: Aleksandr Zimin <alexandr.zimin@flant.com>
Signed-off-by: Aleksandr Zimin <alexandr.zimin@flant.com>
Signed-off-by: Aleksandr Zimin <alexandr.zimin@flant.com>
Signed-off-by: Aleksandr Zimin <alexandr.zimin@flant.com>
Signed-off-by: Aleksandr Zimin <alexandr.zimin@flant.com>
Signed-off-by: Aleksandr Zimin <alexandr.zimin@flant.com>
Signed-off-by: Aleksandr Zimin <alexandr.zimin@flant.com>
Signed-off-by: Aleksandr Zimin <alexandr.zimin@flant.com>
Signed-off-by: Aleksandr Zimin <alexandr.zimin@flant.com>
Signed-off-by: Aleksandr Zimin <alexandr.zimin@flant.com>
Signed-off-by: Aleksandr Zimin <alexandr.zimin@flant.com>
Signed-off-by: Aleksandr Zimin <alexandr.zimin@flant.com>
Signed-off-by: Aleksandr Zimin <alexandr.zimin@flant.com>
Signed-off-by: Aleksandr Zimin <alexandr.zimin@flant.com>
Signed-off-by: Aleksandr Zimin <alexandr.zimin@flant.com>
Signed-off-by: Aleksandr Zimin <alexandr.zimin@flant.com>
Signed-off-by: Aleksandr Zimin <alexandr.zimin@flant.com>
Signed-off-by: Aleksandr Zimin <alexandr.zimin@flant.com>
Signed-off-by: Aleksandr Zimin <alexandr.zimin@flant.com>
Signed-off-by: Aleksandr Zimin <alexandr.zimin@flant.com>
Signed-off-by: Aleksandr Zimin <alexandr.zimin@flant.com>
Signed-off-by: Aleksandr Zimin <alexandr.zimin@flant.com>
Signed-off-by: Aleksandr Zimin <alexandr.zimin@flant.com>
Signed-off-by: Aleksandr Zimin <alexandr.zimin@flant.com>
Signed-off-by: Aleksandr Zimin <alexandr.zimin@flant.com>
2
Signed-off-by: Aleksandr Zimin <alexandr.zimin@flant.com>
@AleksZimin AleksZimin force-pushed the add-node-selectors branch 3 times, most recently from a166493 to aa38b1a Compare January 2, 2025 11:39
Signed-off-by: Aleksandr Zimin <alexandr.zimin@flant.com>
@AleksZimin AleksZimin force-pushed the add-node-selectors branch 4 times, most recently from 7094221 to 951d9ad Compare January 8, 2025 21:25
Signed-off-by: Aleksandr Zimin <alexandr.zimin@flant.com>
Signed-off-by: Aleksandr Zimin <alexandr.zimin@flant.com>
Signed-off-by: Aleksandr Zimin <alexandr.zimin@flant.com>
This reverts commit 56691c6.

Signed-off-by: Aleksandr Zimin <alexandr.zimin@flant.com>
Signed-off-by: Aleksandr Zimin <alexandr.zimin@flant.com>
@astef astef self-requested a review January 9, 2025 12:20
@astef astef mentioned this pull request Jan 10, 2025
Signed-off-by: Aleksandr Stefurishin <aleksandr.stefurishin@flant.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
  NODES
COMMUNITY 2
Project 5
USERS 2
Verify 1