Questions (add to docs?) #232
-
|
Hello! This looks really cool! It's terrible that HNC died, so I'm really happy to find a replacement. I read through the docs but there were some gaps that would be really helpful to fill:
A full example showing creating a namespace, a role, and a sub-namespace using the role with full YAML would be extremely helpful. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 6 replies
-
|
Hey @andrewbaxter, and thanks for your interest in Accurate! We use it at scale in our clusters, and I would be happy to answer any questions you might have. 😸 If you can submit PRs to update our docs, that would be super helpful!
It is pretty straightforward. We grant RBAC to manage subnamespaces to the Kubernetes user-facing aggregated cluster roles, which is also supported by the Helm chart installation: apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
labels:
rbac.authorization.k8s.io/aggregate-to-edit: "true"
name: accurate-subnamespace-editor-role
rules:
- apiGroups:
- accurate.cybozu.com
resources:
- subnamespaces
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- accurate.cybozu.com
resources:
- subnamespaces/status
verbs:
- get
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
labels:
rbac.authorization.k8s.io/aggregate-to-view: "true"
name: accurate-subnamespace-viewer-role
rules:
- apiGroups:
- accurate.cybozu.com
resources:
- subnamespaces
verbs:
- get
- list
- watch
- apiGroups:
- accurate.cybozu.com
resources:
- subnamespaces/status
verbs:
- get
As you would with any other Kubernetes resource:
This is a bug in the documentation. The v1 (and v2alpha1) versions of the API are deprecated and will be removed. So please use v2 of the SubNamespace API. Related: #228
This is not a simple question to answer. The controller is granted the additional RBAC that you decide to allow propagation of resources. Sub-namespace annotations/labels have to be allow-listed (we use this a lot). I would also advise you to configure a regex for sub-namespace naming. In that way, the cluster becomes kinda sharded - based on the tenant root namespace name.
There is some usage documentation, but as always, the documentation can be improved. 😆
Yes, agreed. |
Beta Was this translation helpful? Give feedback.
Now I've lost you. 😆 Why do you want to replicate a service? We typically use propagation to fix cross-cutting concerns. Example:
This role binding will ensure all users in the team-foo group have access to the whole foo namespace hierarchy.
And the same goes for GitOps service accounts and role bindings. If you omit the namespace from the service account role binding subject, you will use the SA in the…