安装 KServe

前提条件

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

所需依赖

依赖项类型描述
Alauda build of Envoy Gateway install_envoy_gateway_operatorOperator为 AI 服务提供底层网关功能。仅支持 v1.5.x;其他版本与此 KServe 依赖不兼容。
Alauda Build of Envoy AI GatewayOperator提供 AI 专用网关能力
Alauda Build of LeaderWorkerSet集群插件为 AI 工作负载提供 leader-worker set 功能
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 Alauda Build of KServe 窗口。

  4. 保持 Channel 不变。

  5. 检查 Version 是否与要安装的 Alauda Build of KServe 版本一致。

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

  7. Upgrade Strategy 中选择 Manual

  8. 点击 Install

验证

确认 Alauda Build of KServe 卡片显示以下状态之一:

  • Installing:安装正在进行中;等待其变为 Installed
  • Installed:安装已完成。

创建 KServe 实例

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

切换到 YAML 视图 并应用以下配置,然后根据你的环境调整 callout 字段:

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 namespace。默认值:kserve
  2. global.clusterName — 在平台中注册的集群名称。示例:business-1
  3. global.deployFlavor — 非 HA 场景使用 single-node,生产环境 HA 使用 ha-cluster
  4. global.platformAddress — Alauda Container Platform 管理端点地址。示例:https://192.168.131.112
  5. preset.GIE — 用于增强 AI 能力的内置 Gateway API Inference Extension。请参见 GIE 配置
  6. preset.envoy_ai_gateway — 用于智能路由和策略强制执行的 AI 专用网关。请参见 Envoy AI Gateway 配置
  7. preset.envoy_gateway — 底层基于 Envoy 的网关基础设施。请参见 Envoy Gateway 配置
  8. preset.kserve_gateway — 用于 KServe inference services 的入口网关。请参见 KServe Gateway 配置
  9. global.registry.address — 目标集群(global.clusterName)用于拉取 KServe 基础设施和运行时镜像的 container registry 端点。 示例:registry.alauda.cn:60070
  10. kserve.controller.deploymentMode — 对于 scale-to-zero 等无服务器特性设置为 Knative,对于原生 Kubernetes 部署设置为 Standard
  11. kserve.controller.gateway.domain — 用于公开 inference service 端点的入口网关域名。使用泛域名,例如 *.example.com
  12. kserve.storage.caBundleConfigMapName — 包含存储连接所需 CA bundle 的 ConfigMap 名称。

验证

检查 KServe 资源的状态:

kubectl get kserve default-kserve -n kserve-operator

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

Envoy Gateway 配置

字段描述默认值
preset.envoy_gateway.service_accountEnvoy Gateway 使用的 service account 名称。envoy-gateway
preset.envoy_gateway.sa_namespaceEnvoy Gateway service account 所在的 namespace。envoy-gateway-system
preset.envoy_gateway.create_instance创建一个 Envoy Gateway 实例以使用随附扩展管理 inference 流量。true
preset.envoy_gateway.instance_name要创建的 Envoy Gateway 实例名称。aieg

Envoy AI Gateway 配置

字段描述默认值
preset.envoy_ai_gateway.serviceEnvoy AI Gateway 的 Kubernetes service 名称。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.namespace部署 KServe Gateway 的 namespace。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 Inference Extension。如果集群中已单独安装 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