leader election needs to operate configmaps and leases (#260)

Signed-off-by: haoqing0110 <qhao@redhat.com>
This commit is contained in:
Qing Hao
2022-07-05 14:44:35 +08:00
committed by GitHub
parent 855199ea43
commit 5ffe3b8a8b
2 changed files with 9 additions and 2 deletions

View File

@@ -6,7 +6,14 @@ metadata:
name: open-cluster-management:management:{{ .KlusterletName }}-registration:agent
namespace: {{ .AgentNamespace }}
rules:
# leader election needs to operate configmaps, create hub-kubeconfig external-managed-registration/work secrets
# leader election needs to operate configmaps and leases
- apiGroups: [""]
resources: ["configmaps"]
verbs: ["get", "list", "watch", "create", "delete", "update", "patch"]
- apiGroups: ["coordination.k8s.io"]
resources: ["leases"]
verbs: ["create", "get", "list", "update", "watch", "patch"]
# create hub-kubeconfig external-managed-registration/work secrets
# TODO(zhujian7): may be replaced by a clusterrole to grant secret operation for others namespaces when addon
# agents are supported running on the management cluster
- apiGroups: [""]

View File

@@ -6,7 +6,7 @@ metadata:
name: open-cluster-management:management:{{ .KlusterletName }}-work:agent
namespace: {{ .AgentNamespace }}
rules:
# leader election needs to operate configmaps
# leader election needs to operate configmaps and leases
- apiGroups: [""]
resources: ["configmaps"]
verbs: ["get", "list", "watch", "create", "delete", "update", "patch"]