-
Notifications
You must be signed in to change notification settings - Fork 138
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 secret permissions to clusterrole, annotations to Helm chart. #162
Conversation
@danmancuso @joebaro |
plz approve and merge @joebaro @danmancuso @simonmarty |
Also in need of this PR , currently vendoring the chart to compensate. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #162 +/- ##
=======================================
Coverage 49.67% 49.67%
=======================================
Files 9 9
Lines 781 781
=======================================
Hits 388 388
Misses 383 383
Partials 10 10 ☔ View full report in Codecov by Sentry. |
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.
There are a few problems here. First I can not reproduce the original issue (more on that below). Second, it is not the AWS plugin that updates the K8s secrets, that is done by the CSI driver itself running under a different service account. Also, the CSI driver is already setting up these permission on their role when sync is turned on. We also would not set these permission globally for all installations as they don't all use K8s secrets (which is why the CSI driver does them conditionally).
I suspect what may have happened is an older version of the CSI driver was not setting the role permission correctly on upgrade or something was set by hand interfering with it. When I upgrade the sync option on the latest CSI driver I do see the cluster role setup correctly:
$ helm install -n kube-system csi-secrets-store secrets-store-csi-driver/secrets-store-csi-driver
$ kubectl -o yaml -n kube-system get clusterroles secretprovidersyncing-role
Error from server (NotFound): clusterroles.rbac.authorization.k8s.io "secretprovidersyncing-role" not found
$ helm upgrade -n kube-system csi-secrets-store secrets-store-csi-driver/secrets-store-csi-driver --set syncSecret.enabled=true
$ kubectl -o yaml -n kube-system get clusterroles secretprovidersyncing-role
...
- apiGroups:
- ""
resources:
- secrets
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
As to the annotation on the service account, this is the service account for the AWS provider daemonset, there is no IAM role associated with it. The role association and annotation should be on the application SA, and this is typically done for each application pod using eksctl create iamserviceaccount
.
Pull request was closed
Issue #, if available:
#92
Description of changes:
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.