GKE 集群的 RBAC
RBAC for GKE cluster
我正在尝试在我的 GKE 集群中使用 RBAC 策略,因此我需要对一个组强制执行视图角色,对另一个组强制执行管理员角色。我为 RBAC 策略创建了 2 个组 abc@example.com 和 def@example.com,我能否在我的 ClusterRoleBinding yaml 文件中直接引用它们,例如:
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: view-role
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: view
subjects:
- apiGroup: rbac.authorization.k8s.io
kind: Group
name: "abc@example.com"
或者我应该启用“Google RBAC 组”并创建一个组“gke-security-groups@YOUR_DOMAIN”(https://cloud.google.com/kubernetes-engine/docs/how-to/role-based-access-control#rolebinding) 并将上述组添加到其中然后在 GKE 集群中创建 RBAC 规则 ?
我创建了上面的 ClusterRoleBinding 没有任何改变(没有启用“Google RBAC 组”),请告诉我如何将 RBAC 访问应用于 GKE 集群中的组?
我的假设是您已经 created/set 建立了 google 组。如果没有,请参阅 link 到 Configure Google Groups for RBAC 并且您必须更新集群以启用 RBAC 功能。
要将现有集群更新到 Enable the Google Groups for RBAC feature,请在 Google Cloud Console 中执行以下步骤:
转到 Cloud Console 中的 Google Kubernetes Engine 页面。
转到Google Kubernetes Engine
在您要编辑的集群旁边,单击 more_vert 操作,然后单击编辑。
在“详细信息”选项卡下,对于“Google RBAC 组”字段,单击编辑“编辑 Google RBAC 组”。
Select 为 RBAC 复选框启用 Google 组。
输入您的安全组名称。
单击“保存更改”。
我正在尝试在我的 GKE 集群中使用 RBAC 策略,因此我需要对一个组强制执行视图角色,对另一个组强制执行管理员角色。我为 RBAC 策略创建了 2 个组 abc@example.com 和 def@example.com,我能否在我的 ClusterRoleBinding yaml 文件中直接引用它们,例如:
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: view-role
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: view
subjects:
- apiGroup: rbac.authorization.k8s.io
kind: Group
name: "abc@example.com"
或者我应该启用“Google RBAC 组”并创建一个组“gke-security-groups@YOUR_DOMAIN”(https://cloud.google.com/kubernetes-engine/docs/how-to/role-based-access-control#rolebinding) 并将上述组添加到其中然后在 GKE 集群中创建 RBAC 规则 ?
我创建了上面的 ClusterRoleBinding 没有任何改变(没有启用“Google RBAC 组”),请告诉我如何将 RBAC 访问应用于 GKE 集群中的组?
我的假设是您已经 created/set 建立了 google 组。如果没有,请参阅 link 到 Configure Google Groups for RBAC 并且您必须更新集群以启用 RBAC 功能。
要将现有集群更新到 Enable the Google Groups for RBAC feature,请在 Google Cloud Console 中执行以下步骤:
转到 Cloud Console 中的 Google Kubernetes Engine 页面。
转到Google Kubernetes Engine
在您要编辑的集群旁边,单击 more_vert 操作,然后单击编辑。
在“详细信息”选项卡下,对于“Google RBAC 组”字段,单击编辑“编辑 Google RBAC 组”。
Select 为 RBAC 复选框启用 Google 组。
输入您的安全组名称。
单击“保存更改”。