Skip to content

Commit

Permalink
Fix ClusterRing example in docs (#102)
Browse files Browse the repository at this point in the history
  • Loading branch information
timebertt authored Jan 17, 2024
1 parent 4ab32b3 commit 69df8a9
Showing 1 changed file with 2 additions and 14 deletions.
16 changes: 2 additions & 14 deletions docs/implement-sharding.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,20 @@ As an example, let's consider a subset of kube-controller-manager's controllers:
- The `Deployment` controller reconciles the `deployments` resource and controls `replicasets`.
- The `ReplicaSet` controller reconciles the `replicaset` resource and controls `pods`.

The corresponding `ClusterRing` would need to be configured like this:
The corresponding `ClusterRing` for the `Deployment` controller would need to be configured like this:

```yaml
apiVersion: sharding.timebertt.dev/v1alpha1
kind: ClusterRing
metadata:
name: kube-controller-manager
name: kube-controller-manager-deployment
spec:
resources:
- group: apps
resource: deployments
controlledResources:
- group: apps
resource: replicasets
- group: apps
resource: replicasets
controlledResources:
- group: ""
resource: pods
```
To allow the sharder to reassign the sharded objects during rebalancing, we need to grant the corresponding permissions.
Expand All @@ -53,13 +48,6 @@ rules:
verbs:
- list
- patch
- apiGroups:
- ""
resources:
- pods
verbs:
- list
- patch
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
Expand Down

0 comments on commit 69df8a9

Please sign in to comment.