Skip to content

Removed TokenClient and use CSI token propagation #1749

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

micahhausler
Copy link
Member

What type of PR is this?

/kind feature
/kind cleanup

What this PR does / why we need it:

Which issue(s) this PR fixes:
Fixes #585

Special notes for your reviewer:

  • I made the remount behavior dependent on whether requiresRequblish is set in the CSI driver. The default is false, which preserves existing behavior and won't issue new Mount() calls to plugins.
  • The driver already had RBAC permissions to get/list/watch its own CSI Driver resource by name, so no new K8s permissions are needed.
  • Given that 1.24 has been EOL for years, I thought it'd be safe to drop the TokenClient everywhere.
  • By removing the need to create any service account token on all nodes, this is a huge security win: the driver will only propagate the token provided by Kubelet on to the plugins.

TODOs:

  • squashed commits
  • includes documentation
  • adds unit tests

@k8s-ci-robot k8s-ci-robot added kind/feature Categorizes issue or PR as related to a new feature. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Feb 10, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: micahhausler
Once this PR has been reviewed and has the lgtm label, please assign aramase for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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 size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Feb 10, 2025
@codecov-commenter
Copy link

codecov-commenter commented Feb 10, 2025

Codecov Report

Attention: Patch coverage is 62.79070% with 16 lines in your changes missing coverage. Please review.

Project coverage is 34.85%. Comparing base (87f51ec) to head (2470bb1).
Report is 120 commits behind head on main.

Files with missing lines Patch % Lines
cmd/secrets-store-csi-driver/main.go 0.00% 5 Missing ⚠️
pkg/secrets-store/nodeserver.go 42.85% 3 Missing and 1 partial ⚠️
pkg/k8s/driver.go 88.00% 2 Missing and 1 partial ⚠️
pkg/rotation/reconciler.go 0.00% 2 Missing ⚠️
pkg/secrets-store/secrets-store.go 50.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1749      +/-   ##
==========================================
- Coverage   35.83%   34.85%   -0.99%     
==========================================
  Files          63       62       -1     
  Lines        3759     4344     +585     
==========================================
+ Hits         1347     1514     +167     
- Misses       2268     2693     +425     
+ Partials      144      137       -7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@micahhausler micahhausler force-pushed the csi-token-rotate branch 7 times, most recently from b792cc2 to 54d78c3 Compare February 10, 2025 20:50
@enj
Copy link
Contributor

enj commented Feb 20, 2025

@micahhausler is this trying to redo #1622 which is almost complete or are they separate?

@micahhausler
Copy link
Member Author

I hadn't seen #1622 and wanted an excuse to try Cursor. I'm happy to close this and review #1622

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 8, 2025
@k8s-ci-robot
Copy link
Contributor

PR needs rebase.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@k8s-ci-robot
Copy link
Contributor

@micahhausler: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-secrets-store-csi-driver-image-scan 2470bb1 link false /test pull-secrets-store-csi-driver-image-scan
pull-secrets-store-csi-driver-e2e-provider-k8s-1-30-10 2470bb1 link true /test pull-secrets-store-csi-driver-e2e-provider-k8s-1-30-10
pull-secrets-store-csi-driver-e2e-provider-k8s-1-32-3 2470bb1 link true /test pull-secrets-store-csi-driver-e2e-provider-k8s-1-32-3
pull-secrets-store-csi-driver-e2e-provider-k8s-1-31-6 2470bb1 link true /test pull-secrets-store-csi-driver-e2e-provider-k8s-1-31-6

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@enj enj moved this to Subprojects - Needs Triage in SIG Auth Apr 29, 2025
@enj enj added this to SIG Auth Apr 29, 2025
@aramase aramase moved this from Subprojects - Needs Triage to In Review in SIG Auth May 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. kind/feature Categorizes issue or PR as related to a new feature. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Using RequiresRepublish for rotation
4 participants