安装 Alauda Container Platform API Refiner

Alauda Container Platform API Refiner 是一个过滤 Kubernetes API 响应数据的平台服务。它提供按项目、集群和命名空间的过滤能力,并支持 API 响应中的字段排除、包含和脱敏。

目录

通过控制台安装

  1. 进入 管理员
  2. 在左侧导航栏点击 Marketplace > 集群插件
  3. 在顶部导航栏选择 global 集群
  4. 搜索 Alauda Container Platform API Refiner 并点击查看详情
  5. 点击 安装 部署插件

通过 YAML 安装

1. 检查可用版本

确保插件已发布,通过检查 global 集群中的 ModulePlugin 和 ModuleConfig 资源:

# kubectl get moduleplugins apirefiner
NAME      AGE
apirefiner   4d20h

# kubectl get moduleconfigs -l cpaas.io/module-name=apirefiner
NAME             AGE
apirefiner-v4.0.4   4d21h

这表示集群中存在 ModulePlugin apirefiner,且版本 v4.0.4 已发布。

2. 创建 ModuleInfo

创建一个 ModuleInfo 资源以安装插件,无需任何配置参数:

apiVersion: cluster.alauda.io/v1alpha1
kind: ModuleInfo
metadata:
  annotations:
    cpaas.io/display-name: apirefiner
    cpaas.io/module-name: '{"en": "Alauda Container Platform API Refiner", "zh": "Alauda
      Container Platform API Refiner"}'
  labels:
    cpaas.io/cluster-name: global		 		
    cpaas.io/module-name: apirefiner
    cpaas.io/module-type: plugin
    cpaas.io/product: Platform-Center
  name: apirefiner-global					 	
spec:
  version: v4.2.0-default.1.g8f0543e4 				

字段说明:

  • name:集群插件的临时名称。平台会根据内容在创建后重命名,格式为 <cluster-name>-<内容哈希>,例如 global-ee98c9991ea1464aaa8054bdacbab313
  • label cpaas.io/cluster-name:API Refiner 只能安装在 global 集群,此字段保持为 global。
  • label cpaas.io/module-name:插件名称,必须与 ModulePlugin 资源匹配。
  • label cpaas.io/module-type:固定字段,必须为 plugin;缺少此字段会导致安装失败。
  • .spec.config:如果对应的 ModuleConfig 为空,此字段可留空。
  • .spec.version:指定要安装的插件版本,必须与 ModuleConfig 中的 .spec.version 匹配。

卸载流程

  1. 按安装流程的步骤 1-4 定位插件
  2. 点击 卸载 移除插件

默认配置

过滤的资源

默认过滤以下资源:

资源API 版本
namespacesv1
projectsauth.alauda.io/v1
clustermodulescluster.alauda.io/v1alpha2
clustersclusterregistry.k8s.io/v1alpha1

字段脱敏

默认脱敏以下字段:

  • metadata.annotations.cpaas.io/creator