安装 KServe

前提条件

在安装 Alauda Build of KServe 之前,您需要确保已安装以下依赖项:

必需的依赖项

依赖项类型描述
Alauda build of Envoy Gateway install_envoy_gateway_operatoroperator为 AI 服务提供底层网关功能
Alauda Build of Envoy AI Gateway集群插件提供 AI 专用的网关能力
Alauda Build of LeaderWorkerSet集群插件为 AI 工作负载提供 leader-worker 集功能
GIE (gateway-api-inference-extension)内置默认随 Alauda Build of KServe 一起打包。如果集群中已安装 GIE,可通过 operator 配置中的 gie.builtIn 参数禁用内置安装。
INFO

Alauda build of Envoy Gateway 已原生集成于 ACP 4.2 版本。对于运行较早版本(包括 ACP 4.0 和 4.1)的环境,请联系客户支持获取兼容性和安装指导。

安装注意事项

  1. 必需依赖项:安装 Alauda Build of KServe 之前,必须先安装所有必需依赖项。
  2. GIE 集成:GIE 默认随包启用。如果您的环境中已单独安装 GIE,请在 operator 配置中将 gie.builtIn 设置为 false 以禁用内置安装。

上传 Operator

下载 Alauda Build of KServe Operator 安装包(例如 kserve-operator.ALL.xxxx.tgz)。

使用 violet 命令将其发布到平台仓库:

violet push --platform-address=<platform-access-address> --platform-username=<platform-admin> --platform-password=<platform-admin-password> kserve-operator.ALL.xxxx.tgz

安装 Operator

管理员 视图中:

  1. 点击 Marketplace / OperatorHub

  2. 在控制台顶部,从 Cluster 下拉列表中选择要安装 KServe Operator 的目标集群。

  3. 搜索并选择 Alauda Build of KServe,然后点击 Install

    将弹出 Install Alauda Build of KServe 窗口。

  4. 保持 Channel 不变。

  5. 检查 Version 是否与您要安装的 Alauda Build of KServe 版本匹配。

  6. 保持 Installation Location 不变,默认应为 kserve-operator

  7. 选择 Manual 作为 Upgrade Strategy

  8. 点击 Install

验证

确认 Alauda Build of KServe 磁贴显示以下状态之一:

  • Installing:安装进行中;请等待状态变为 Installed
  • Installed:安装完成。

创建 KServe 实例

Operator 安装完成后,创建一个 KServe 自定义资源以部署 KServe 实例。

切换到 YAML 视图,应用以下配置,并根据您的环境调整标注字段:

apiVersion: components.aml.dev/v1alpha1
kind: KServe
metadata:
  name: default-kserve
spec:
  namespace: kserve
  values:
    global:
      clusterName: <cluster-name>
      deployFlavor: single-node
      platformAddress: <platform-address>
      preset:
        GIE:
          enabled: true
        envoy_ai_gateway:
          port: 1063
          service: ai-gateway-controller
        envoy_gateway:
          create_instance: true
          deploy_type: ControllerNamespace
          instance_name: aieg
          sa_namespace: envoy-gateway-system
          service_account: envoy-gateway
        kserve_gateway:
          enabled: true
          gateway_class: ""
          name: kserve-ingress-gateway
          namespace: kserve
          port: 80
      registry:
        address: <registry-address>
    kserve:
      controller:
        deploymentMode: Knative
        gateway:
          domain: <inference-domain>
      storage:
        caBundleConfigMapName: aml-global-ca-bundle
  1. spec.namespace — 部署 KServe 组件的 Kubernetes 命名空间。默认值:kserve
  2. global.clusterName — 平台中注册的集群名称。例如:business-1
  3. global.deployFlavorsingle-node 表示非高可用,ha-cluster 表示生产环境高可用。
  4. global.platformAddress — Alauda Container Platform 管理端点地址。例如:https://192.168.131.112
  5. preset.GIE — 内置的 Gateway API 推理扩展,增强 AI 能力。详见 GIE Configuration
  6. preset.envoy_ai_gateway — AI 专用网关,用于智能路由和策略执行。详见 Envoy AI Gateway Configuration
  7. preset.envoy_gateway — 基于 Envoy 的底层网关基础设施。详见 Envoy Gateway Configuration
  8. preset.kserve_gateway — KServe 推理服务的入口网关。详见 KServe Gateway Configuration
  9. global.registry.address — 目标集群(global.clusterName)用于拉取 KServe 基础设施和运行时镜像的容器镜像仓库地址。例如:registry.alauda.cn:60070
  10. kserve.controller.deploymentMode — 设置为 Knative 以启用无服务器特性(如零实例扩缩),或 Standard 以使用原生 Kubernetes 部署。
  11. kserve.controller.gateway.domain — 入口网关用于暴露推理服务端点的域名。使用泛域名,例如 *.example.com
  12. kserve.storage.caBundleConfigMapName — 存储连接所用 CA 证书的 ConfigMap 名称。

验证

检查 KServe 资源状态:

kubectl get kserve default-kserve -n kserve-operator

当状态显示 DEPLOYED: True 时,实例即已准备就绪。

Envoy Gateway 配置

字段描述默认值
preset.envoy_gateway.service_accountEnvoy Gateway 使用的服务账户名称。envoy-gateway
preset.envoy_gateway.sa_namespaceEnvoy Gateway 服务账户所在的命名空间。envoy-gateway-system
preset.envoy_gateway.create_instance创建 Envoy Gateway 实例以管理带有内置扩展的推理流量。true
preset.envoy_gateway.instance_name要创建的 Envoy Gateway 实例名称。aieg

Envoy AI Gateway 配置

字段描述默认值
preset.envoy_ai_gateway.serviceEnvoy AI Gateway 的 Kubernetes 服务名称。ai-gateway-controller
preset.envoy_ai_gateway.portEnvoy AI Gateway 使用的端口号。1063

KServe Gateway 配置

字段描述默认值
preset.kserve_gateway.enabled是否部署用于 InferenceService 流量的 KServe Gateway 实例。true
preset.kserve_gateway.nameKServe Gateway 的名称。kserve-ingress-gateway
preset.kserve_gateway.namespaceKServe Gateway 部署所在的命名空间。kserve
preset.kserve_gateway.gateway_class可选的自定义 GatewayClass 名称。为空时,默认由 {namespace}-{name} 生成。""
preset.kserve_gateway.portKServe Gateway 使用的端口号。80

GIE (gateway-api-inference-extension) 配置

字段描述默认值
preset.GIE.enabled启用内置的 Gateway API 推理扩展。如果集群中已单独安装 GIE,请设置为 falsetrue

升级 Alauda Build of KServe

  1. 使用 violet 工具上传新版本的 Alauda Build of KServe operator 包。
  2. 进入 Administrator -> Marketplace -> OperatorHub 页面,找到 Alauda Build of KServe,点击 Confirm 应用新版本。

验证

升级后,确认 Alauda Build of KServe 磁贴显示为 Installed,并检查 KServe 实例状态:

kubectl get kserve default-kserve -n kserve-operator