-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
250 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
Our intention is that our experiments improve Kubernetes for everyone, by improving CRDs and scaling resource watching, and enabling more, better controllers for everyone, whether you're using Kubernetes as a container orchestrator or not. | ||
|
||
|
||
|
||
kcp, which serves a Kubernetes-style API with a minimum of built-in types. | ||
cluster-controller, which along with the Cluster CRD allows kcp to connect to other full-featured Kubernetes clusters, and includes these components: | ||
syncer, which runs on Kubernetes clusters registered with the cluster-controller, and watches kcp for resources assigned to the cluster | ||
deployment-splitter, which demonstrates a controller that can split a Deployment object into multiple "virtual Deployment" objects across multiple clusters. | ||
crd-puller which demonstrates mirroring CRDs from a cluster back to kcp | ||
|
||
|
||
|
||
Multi-Cluster Kubernetes? | ||
|
||
kcp could be useful for multi-cluster scenarios, by running kcp as a control plane outside of any of your workload clusters. | ||
Multi-Tenant Kubernetes? | ||
|
||
kcp could be useful for multi-tenancy scenarios, by allowing multiple tenant clusters inside a cluster to be managed by a single kcp control plane. | ||
Local Kubernetes Development? | ||
|
||
kcp could be useful for local development scenarios, where you don't necessarily care about all of Kubernetes' many built-in resources and their reconciling controllers. | ||
Embedded/low-resource scenarios? | ||
|
||
kcp could be useful for environments where resources are scarce, by limiting the number of controllers that need to run. Kubernetes' asynchronous reconciliation pattern can also be very powerful in disconnected or intermittently connected environments, regardless of how workloads actually run. | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# I will show the RBAC around managedClusterset. | ||
I will have a demo for that. | ||
In the demo, we define some persona, gurney, he is cluster-admin, | ||
and we have a team, server-foundation, in this team, we have three members, le,jian,dangpeng, | ||
le and jian are team-admin, dangpeng is team-view. we will use these persona to login to ocp and acm-ui to explain the rbac around mangedclusters. | ||
|
||
|
||
|
||
1. let's login to OCM ui as gurney, | ||
and , let's create a managedclusterset named server-foundation-clusterset, it's used for server-foundation team | ||
|
||
then, | ||
2. let's switch to ocp ui as gurney. | ||
3. we have define two group server-foundation-admin server-foundation-view | ||
|
||
in server-foundation-admin, there are two users, le-taem-admin, jian-team-admin | ||
in server-foundation-view there is one user, dangpeng-team-view | ||
|
||
|
||
then, let's create some clusterrolr-binding to grant managedclusterset permission to server-foundation team. | ||
1. for each managedclusterset, we will auto generate two clusterrole, one for managedclusterset admin, another is manageclusterset view. | ||
|
||
1. we need to give the server-foundation-admin group server-foundation-clusterset admin permission | ||
2. let's give server-foundation-vewi group server-foundation-clusterset view permission | ||
|
||
for each team-admin, they should provision cluster by them selves. so we should give the self-provisioner permission to server-foubdaiton-admin group. | ||
|
||
|
||
|
||
# let's login to openshift ui as le-team-admin, then create a project named "server-foundation" | ||
|
||
then login to ocm ui as le-team-admin and provision some clusters. | ||
|
||
1. let's create a managedcluster managedcluster1, as non-cluster-admin, he must select managedclusterset, or the create request will fail. | ||
2. let's create a clusterpool named "server-foundation-clusterpool", same as mangedclusters, he must select managedclusterset. | ||
3. then he can claim the clusterpool. | ||
4. in clusterset, we can see these resources. | ||
|
||
|
||
|
||
|
||
# login to ocm ui as jian-team-admin | ||
1. he also has admin permissions to the resources which created by le-team-admin. | ||
2. let's try to add one label for mangaedcluster1 | ||
3. let's try to add a lable for clusterpool. | ||
|
||
|
||
# login to ocm ui as dangpeng-team-view | ||
1. he has view permissions to the resources which created by le-team-admin. | ||
2. he can see these resources, but he can not update it. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
# RBAC model around ManagedClusterset in Red Hat Advanced Cluster Management for Kubernetes | ||
|
||
In this blog, we introduce the RBAC model around managedclusterset in Red Hat Advanced Cluster Management for Kubernetes that is availabel in version 2.3. | ||
|
||
[Red Hat Advanced Cluster Management for Kubernetes](https://www.redhat.com/en/technologies/management/advanced-cluster-management) provides end-to-end visibility and control to manage your Kubernetes clusters, and controls your application lifecycle across the hybrid clouds. There are a couple of resources defined in Red Hat Advanced Cluster Management for Kubernetes, like managedclusterset, managedcluster, clusterpool, clusterclaim, clusterdeployment. | ||
|
||
some resources has direct relationship, but the permissions could be segregate. it will cause confuse. | ||
currentlly, when a managedcluster created, we will auto create a cluster namespace, many resources can be created in this ns. for a user, he can be grant permission to the mangedcluster and ns separatelly. it will cause confuse for each model. | ||
|
||
same as clusterpool, clustercalim, clusterdeployment. | ||
if clusteradmin want to give permission to these resources, he must create rolebinding to these resources one by one. it is complex. | ||
|
||
So we use managedclusterset to solve this problem. | ||
|
||
|
||
## Managedclusterset: | ||
ManagedClusterSet resources allow the grouping of cluster related resources, which enables role-based access control management across all of the resources in the group. | ||
|
||
the following resources can be add to set by set label "a=b". | ||
| Resource Type | ResourceGroup | Description | | ||
| ---- | ---- | --- | | ||
| ManagedClusterset | | we define it as a resource group. administrator can set permission to it. | ||
| ManagedCluster | | can be add to managedclusterset | ||
| Resources in ManagedCluster Namespace || | ||
| ClusterDeployment|| | ||
| Clusterpool|| | ||
| ClusterClaim|| | ||
|
||
ManagedClusters/clusterdeployment... can be add to managedclusterset by set label:... | ||
|
||
|
||
When clusterset created, we will auto create two clusterrole for this clusterset, one is clusterset admin, another is view. | ||
|
||
ClusterRole: | ||
clusterset-admin | ||
clusterset-view | ||
|
||
user could have clusterset admin or view permission by bind admin or view role. with this role, user will also have admin/view permission to resources which list in up tables wich has this clusterset label. | ||
|
||
# expect action | ||
we define three role for env. and list some expect action on them. | ||
|
||
|
||
## cluster-admin | ||
has all administrator permissions for OCM resources. | ||
1. should create clusterset for each team, | ||
2. give team-admin and team-view permissions for this set. | ||
3. give self-provisioner permission to team admin, so he can provison cluster by himself. | ||
|
||
## As team-admin | ||
1. could create project, | ||
2. could create a new cluster in cloud providers, or import an existing cluster. | ||
3. could create a clusterpool and claim the cluster in this pool | ||
4. could access the clusterpool's cluster. | ||
5. could get/update/delete all clusters/clusterpool/clustercliams in the set. | ||
|
||
## As team-view | ||
1. could get all clusters/clusterpool/clustercliams in the set. | ||
2. could not update/delete/ clusters/clusterpool/clustercliams in the set. | ||
|
||
|
||
|
||
# Best practice: | ||
scenarios: | ||
|
||
cluster-admin: gurney | ||
team: server-foundation | ||
server-foundation team admin: le, jian | ||
server-foundation team view: dang | ||
|
||
|
||
## Gurney: | ||
1. create a managedclusterset, bind the admin permission to server-foundation-admin, bind the view permission to server-foundation-view | ||
2. create a project(server-foundation) for server-foundation team. bind the admin permission to server-foundation-admin. | ||
|
||
Notes: cluster-admin can also give the self-provisioner permissions to server-foundation team-admin, then the team-admin can create it by themselves. | ||
|
||
## Le: | ||
1. create a managedclusters c1 | ||
2. create a clusterpool | ||
3. create a clusterclaim | ||
|
||
## jian: | ||
1. can get/update/delete managedclusters | ||
2. can get/update/delete clusterpool | ||
3. can get/update/delete clusterclaim | ||
|
||
### dang: | ||
1. can view ... |