forked from karmada-io/karmada
-
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.
Merge pull request karmada-io#5586 from B1F030/karmada-operator-rbac
minimize the rbac permissions for karmada-operator
- Loading branch information
Showing
6 changed files
with
91 additions
and
17 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRole | ||
metadata: | ||
name: karmada-operator | ||
labels: | ||
karmada-app: karmada-operator | ||
rules: | ||
- apiGroups: ["coordination.k8s.io"] | ||
resources: ["leases"] # karmada-operator requires access to the Lease resource for leader election | ||
verbs: ["get", "create", "update"] | ||
- apiGroups: ["operator.karmada.io"] | ||
resources: ["karmadas"] # to manage karmada instances | ||
verbs: ["get", "list", "watch", "update"] | ||
- apiGroups: ["operator.karmada.io"] | ||
resources: ["karmadas/status"] # to update the status subresource of karmada instances | ||
verbs: ["update"] | ||
- apiGroups: [""] | ||
resources: ["events"] # allows karmada-operator to record events in the kubernetes api-server | ||
verbs: ["create"] | ||
- apiGroups: [""] | ||
resources: ["nodes", "pods"] # list cluster nodes and pods to get node information and for health checks | ||
verbs: ["list"] | ||
- apiGroups: [""] | ||
resources: ["namespaces"] # to get information about namespaces, and deploy resources into specific namespaces | ||
verbs: ["get"] | ||
- apiGroups: [""] | ||
resources: ["secrets", "services"] # to manage secrets which might contain sensitive data like credentials and services to expose applications within the cluster | ||
verbs: ["get", "create", "update", "delete"] | ||
- apiGroups: ["apps"] | ||
resources: ["statefulsets", "deployments"] # to manage statefulsets, e.g. etcd, and deployments, e.g. karmada-operator | ||
verbs: ["get", "create", "update", "delete"] | ||
- nonResourceURLs: ["/healthz"] # used to check whether the karmada apiserver is health | ||
verbs: ["get"] |
14 changes: 14 additions & 0 deletions
14
operator/config/deploy/karmada-operator-clusterrolebinding.yaml
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,14 @@ | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRoleBinding | ||
metadata: | ||
name: karmada-operator | ||
labels: | ||
karmada-app: karmada-operator | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: ClusterRole | ||
name: karmada-operator | ||
subjects: | ||
- kind: ServiceAccount | ||
name: karmada-operator | ||
namespace: karmada-system |
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,7 @@ | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: karmada-operator | ||
namespace: karmada-system | ||
labels: | ||
karmada-app: karmada-operator |