vshn / appcat-service-postgresql

AppCat Service Provider for PostgreSQL
https://vshn.github.io/appcat-service-postgresql/
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Set explicit RBAC rules for provider-helm instead of cluster-admin #63

Closed ccremer closed 2 years ago

ccremer commented 2 years ago

Summary

The provider-helm by default has only essential RBAC permissions for accessing CRDs in 'helm.crossplane.io'. It cannot deploy additional resources. In order to grant those additional permissions we previously gave cluster-admin role. This is suboptimal as that grants more than necessary. Now we give only the required permissions and set a dedicated service account.

The reason we create a new service account (instead of granting/aggregating additional permissions) is that the service account managed by Crossplane has a name with some hash value. This value is difficult to guess and makes deployment via ArgoCD impossible since ArgoCD would have to somewhat discover this name. I've read Design Doc RBAC manager, but AFAICT there's no way for platform operators to aggregate to the provider's service account. Luckily the ControllerConfig allows us to set a different service account name.

Note: This currently only affects the local environment with kind, since the operator basically expects that provider-helm has all necessary permissions to deploy charts. However, in tutorials or in component-crossplane we need to grant those additional permissions as well (outside of scope here).

Checklist