-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Minimize manual creation of manifest files at deployment #50
Conversation
Signed-off-by: rustyclock <rustyclock@protonmail.com>
Signed-off-by: rustyclock <rustyclock@protonmail.com>
Signed-off-by: rustyclock <rustyclock@protonmail.com>
resources: | ||
- secrets | ||
verbs: | ||
- get |
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.
- get | |
- get | |
resourceNames: | |
- spanner-autoscaler-service-account |
The downside is that the spanner-autoscaler-controller will have read access to all the secrets.
I have a feeling this will solve the problem. Is there any problem?
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.
This is a good idea. I have now restricted the default access only the secrets named spanner-autoscaler-gcp-sa
.
Thanks for the suggestion!
b479e57
to
44b4b92
Compare
* Provide default read access to secret named `spanner-autoscaler-gcp-sa` * Update documentation with the correct secret name and information Signed-off-by: rustyclock <rustyclock@protonmail.com>
44b4b92
to
9c105b8
Compare
Signed-off-by: rustyclock <rustyclock@protonmail.com>
9c105b8
to
a556f5f
Compare
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!
What this PR does / Why we need it
ClusterRole
forevents
: Provide default access to the controller for publishing events so that a separateRole
andRoleBinding
does not need to be created separately at the deployment time by the user (through steps provided in README). The current additional step of creating these two resources adds more complexity to the deployment process and does not provide any additional benefits in terms of security.I think that having default permissions to publish events should be fine because it does not grant access to any confidential data like secrets etc.
ClusterRole
forsecrets
: The current process for the user is to create a secret, and then additionally create aRole
/RoleBinding
pair for providing access to controller for that secret. The controller will need access to the secrets if some of the users choose to use the GCP-service-account key for access. So, if we provide the controllerread
access to k8ssecrets
, it will simplify the deployment process for the user, because they only have to create thesecret
and theSpannerAutoscaler
CRD then. No more additional custom written yaml files.The downside is that the
spanner-autoscaler-controller
will haveread
access toall
the secrets. But I think this permission can not be misused by thespanner-autoscaler-controller
as is visible from the source code that it will try to read only the secret name which is provided in theSpannerAutoscaler
CRD. And more advanced users will anyways create their own manifest files for deployment, and can remove access toe secrets in the clusterrole.I think it would be better to keep the default
read
access tosecrets
(for majority of the users). And we can add a note about how advanced users can choose to not provide this access by modifying the default RBAC files. Let me know what you think about this.