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

feat: initial implementation of secrets sync controller #1466

Conversation

mandreap
Copy link

What type of PR is this?
/kind feature

What this PR does / why we need it:
This PR proposes an implementation for the Secret Sync Controller. This proposal is a diversion from the current design of the CSI driver. Based on feedback, some of the users want the CSI driver to sync the secret store objects as Kubernetes secrets without the mount instead of the tight coupling between the mount and the sync as it is today.

To support this, we could extract the sync controller from the CSI driver and have it as a standalone deployment. Just syncing as Kubernetes secrets is a cluster-scope operation and doesn’t require the controller or CSI pods to be run on all nodes. The controller would need to watch for Create/Update events for the SS (Secret Sync) and create the Kubernetes secrets by making an RPC call to the provider.

For more information, see the design proposal.

  • squashed commits
  • includes documentation
  • adds unit tests

dependabot bot added 2 commits March 12, 2024 17:02
Bumps [k8s.io/klog/v2](https://github.com/kubernetes/klog) from 2.100.1 to 2.120.1.
- [Release notes](https://github.com/kubernetes/klog/releases)
- [Changelog](https://github.com/kubernetes/klog/blob/main/RELEASE.md)
- [Commits](kubernetes/klog@v2.100.1...v2.120.1)

---
updated-dependencies:
- dependency-name: k8s.io/klog/v2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Bumps [actions/dependency-review-action](https://github.com/actions/dependency-review-action) from 3.1.5 to 4.0.0.
- [Release notes](https://github.com/actions/dependency-review-action/releases)
- [Commits](actions/dependency-review-action@c74b580...4901385)

---
updated-dependencies:
- dependency-name: actions/dependency-review-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
@k8s-ci-robot k8s-ci-robot added kind/feature Categorizes issue or PR as related to a new feature. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Mar 12, 2024
@k8s-ci-robot
Copy link
Contributor

Hi @mandreap. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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/test-infra repository.

@k8s-ci-robot k8s-ci-robot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Mar 12, 2024
@k8s-ci-robot k8s-ci-robot requested review from nilekhc and tam7t March 12, 2024 18:35
@aramase
Copy link
Member

aramase commented Mar 12, 2024

/retitle feat: initial implementation of secrets sync controller
/assign aramase enj

@k8s-ci-robot k8s-ci-robot changed the title Mandrea/secret sync controller feat: initial implementation of secrets sync controller Mar 12, 2024
@mandreap mandreap force-pushed the mandrea/secret-sync-controller branch 3 times, most recently from 0c1db60 to fd62f2b Compare March 15, 2024 17:58
Copy link
Member

@aramase aramase left a comment

Choose a reason for hiding this comment

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

These comments are based on some initial testing. I haven't done a complete review yet of the changes in this PR.

I've a gist with the steps documented: https://gist.github.com/aramase/46bd3d4270d9c44b59e8c2afe56fbc09

@mandreap mandreap force-pushed the mandrea/secret-sync-controller branch 2 times, most recently from e22f2dc to 18b99da Compare March 18, 2024 16:06
@mandreap mandreap requested a review from aramase March 21, 2024 11:19
@mandreap mandreap force-pushed the mandrea/secret-sync-controller branch from 18b99da to 87b14a4 Compare March 21, 2024 16:47
Copy link
Member

@aramase aramase left a comment

Choose a reason for hiding this comment

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

Review part 1 on the manifests and charts

Going to review the controller implementation next.

secret-sync-controller/Dockerfile Show resolved Hide resolved
secret-sync-controller/Makefile Outdated Show resolved Hide resolved
secret-sync-controller/PROJECT Outdated Show resolved Hide resolved
secret-sync-controller/api/v1alpha1/groupversion_info.go Outdated Show resolved Hide resolved
secret-sync-controller/charts/index.yaml Outdated Show resolved Hide resolved
secret-sync-controller/config/prometheus/monitor.yaml Outdated Show resolved Hide resolved
secret-sync-controller/controllers/conditions.go Outdated Show resolved Hide resolved
Copy link
Member

@aramase aramase left a comment

Choose a reason for hiding this comment

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

The previous review was only for the controller implementation. Still need to look at all the files that are after controller.

@mandreap mandreap requested a review from aramase April 12, 2024 19:17
@mandreap mandreap force-pushed the mandrea/secret-sync-controller branch from 139775a to 7625c37 Compare April 15, 2024 10:37
Copy link
Member

@aramase aramase left a comment

Choose a reason for hiding this comment

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

Another round of review for controller and token manager implementation.

secret-sync-controller/Dockerfile Outdated Show resolved Hide resolved
secret-sync-controller/Makefile Outdated Show resolved Hide resolved
secret-sync-controller/Makefile Outdated Show resolved Hide resolved
secret-sync-controller/api/v1alpha1/groupversion_info.go Outdated Show resolved Hide resolved
secret-sync-controller/api/v1alpha1/secretsync_types.go Outdated Show resolved Hide resolved
secret-sync-controller/pkg/k8s/token.go Outdated Show resolved Hide resolved
secret-sync-controller/pkg/k8s/token.go Outdated Show resolved Hide resolved
secret-sync-controller/pkg/k8s/token.go Outdated Show resolved Hide resolved
secret-sync-controller/pkg/k8s/token.go Outdated Show resolved Hide resolved
secret-sync-controller/pkg/k8s/token.go Outdated Show resolved Hide resolved
@mandreap mandreap force-pushed the mandrea/secret-sync-controller branch 2 times, most recently from 213c6e0 to aa8476a Compare May 2, 2024 09:54
@mandreap mandreap force-pushed the mandrea/secret-sync-controller branch from aa8476a to 7137c90 Compare May 2, 2024 09:59
@enj enj removed their assignment May 7, 2024
@enj
Copy link
Contributor

enj commented May 7, 2024

/assign nilekhc

Copy link
Member

@aramase aramase left a comment

Choose a reason for hiding this comment

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

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels May 13, 2024
Copy link
Member

@aramase aramase left a comment

Choose a reason for hiding this comment

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

@mandreap Only comment to fix the licenses before we can merge.

The previous comments I added have mostly been addressed. I'm ok with merging this PR to the feature branch as-is (after the license is fixed) in an effort to make progress on moving these changes to https://github.com/kubernetes-sigs/secrets-store-sync-controller.

Comment on lines 1 to 15
/*
Copyright 2023.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
Copy link
Member

Choose a reason for hiding this comment

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

@mandreap mandreap force-pushed the mandrea/secret-sync-controller branch from b4154ee to 3f27b06 Compare May 13, 2024 17:08
Copy link
Member

@aramase aramase left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

Thank you for the pre-alpha implementation.

The next step for this feature is going to be moving to the new repo and targetting the alpha release so users can try it out!

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: aramase, mandreap

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 May 13, 2024
@k8s-ci-robot k8s-ci-robot merged commit a4ed0fb into kubernetes-sigs:feature/secrets-sync-controller May 13, 2024
2 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. kind/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. 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.

5 participants