-
Notifications
You must be signed in to change notification settings - Fork 63
Refactor NodeServer to eliminate Linode API dependency and support isolated driver roles #415
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
Conversation
1a5d390 to
89f69d9
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #415 +/- ##
==========================================
+ Coverage 73.65% 74.01% +0.35%
==========================================
Files 23 24 +1
Lines 2775 2763 -12
==========================================
+ Hits 2044 2045 +1
+ Misses 594 586 -8
+ Partials 137 132 -5 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Related To: #417 |
0f9e85c to
7361046
Compare
7361046 to
ebfd4ca
Compare
ebfd4ca to
c66838b
Compare
komer3
left a comment
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.
Just one small thing. Apart from that everything looks good to me!
1913f4f to
68d9865
Compare
This change decouples the NodeServer from the Linode API by replacing disk enumeration logic with local system inspection. A DRIVER_ROLE environment variable is introduced to distinguish Controller and NodeServer modes. When set to 'nodeserver', cloud API credentials are no longer required. Sanity tests for Controller and NodeServer are now executed independently to reflect this separation. update helm chart node-server daemonset and remove the need of LINODE_TOKEN to be set. remove LINODE_TOKEN from node-server kustomize manifests add lsblk as a dependency in the Dockerfile exclude non block devices from lsblk output remove linode api testing from node_server test TestNodeGetInfo added methods to detect the number of attached disks add hardwareinfo package and update attachedVolumeCount upodate mocks remove linode client dependency from node-server add driver role either controller or nodeserver this controls if the LINODE_TOKEN is required or not. skip some csi-sanity checks that requre linodeapi access fix golangci-lint remove unused functions fix golanci-lint errors fix TestNodeGetInfo so that it uses mockhw. fix: logic to detect attached disks. Move from counting disks with valid partitions to disk bus type. update deployment documentation Added section about driver_role env variables
In order for the node-server sanity checks to pass we have to: 1. Add Linode token and api to the nodeserver daemonset There's a need for the nodeserver to have linode api access because sanity checks require CreateVolume and ListVolume. By patching the node-server Daemonset and injecting the LINODE_TOKEN The Controller Code Path is able to be initialized with a proper client. This is not needed for normal nodeserver operation, however the sanity-checks expect the ability for the nodeserver to also perform controller functions. E2E tests pass without the need of LINODE_TOKEN in the nodeserver
- Specify that `DRIVER_ROLE=controller` requires `LINODE_TOKEN` and initializes the CSI Controller with Linode API access. - Specify that `DRIVER_ROLE=nodeserver` does not require `LINODE_TOKEN` and only launches the NodeServer, operating without any Linode API calls.
68d9865 to
d36f902
Compare
komer3
left a comment
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.
LGTM!
General:
Pull Request Guidelines:
This PR removes the dependency on the Linode API from the NodeServer component of the CSI driver.
Disk enumeration logic previously relying on the Linode API has been refactored to use local system information instead.
CSI Sanity tests are now executed independently for the Controller and NodeServer roles to reflect their distinct responsibilities.
A new DRIVER_ROLE environment variable has been introduced to explicitly define the driver's operational mode.
When DRIVER_ROLE=nodeserver, Linode API credentials are no longer required, enabling the NodeServer to run in environments where cloud API access is restricted or unnecessary.