如果您需要通过API方式来管理ASM实例,需要建立kubectl命令行客户端与ASM实例的连接。
背景信息
kubectl是Kubernetes集群的命令行工具,通过kubectl能够对集群本身进行管理,并能够在集群上进行容器化应用的安装部署,同时还可以对服务网格进行管理。
服务网格ASM基于Kubernetes提供的RBAC(基于角色的访问权限控制)机制,提供了预定义RBAC角色,可向用户授予访问服务网格的权限范围。
- 提供对控制平面侧命名空间的管理,支持的操作包括create、delete、get、list、patch、update、watch。
- 提供对所有Istio资源类型的管理,支持的操作包括create、delete、get、list、patch、update、watch。
- 提供对
istiogateways.istio.alibabacloud.com
类型资源的管理,用于定义入口网关服务,支持的操作包括create、delete、get、list、patch、update、watch - 提供对
istio.alibabacloud.com
类型资源的只读操作,包括get、list。
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: istio-admin
rules:
- apiGroups: [""]
resources: ["namespaces"]
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- config.istio.io
- networking.istio.io
- authentication.istio.io
- rbac.istio.io
- security.istio.io
resources: ["*"]
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- istio.alibabacloud.com
resources: ["istiogateways"]
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- istio.alibabacloud.com
resources: ["*"]
verbs:
- get
- list