AI网关-Higress部署

AI网关-Higress部署

Posted by vxiaozhi on March 23, 2025

部署方式

1. 云原生部署

支持 部署到 Kubernetes,或者 本地k8s, 如 Kind。具体参考

2. Docker-Compose部署

参考

3. All-In-One部署

及将所有服务全部打包到一个容器中,并通过 Supervisord 管理。 参考:

实例:

1
2
3
4
mkdir higress; cd higress
docker run -d --rm --name higress-ai -v ${PWD}:/data \
        -p 8001:8001 -p 8080:8080 -p 8443:8443  \
        higress-registry.cn-hangzhou.cr.aliyuncs.com/higress/all-in-one:latest

4. 命令行工具:hgctl 部署

hgctl 是一个命令行工具,用于管理 Higress 的配置,如:

  • 提供多种安装方式,简化安装过程,支持本地部署,Kubernetes 部署,以及 Docker Compose 部署。
  • 除了提供安装功能外,也支持插件管理,配置查看等。

参考:

部署实践

关于 Higress Chat 包的信息。

如何知道 Higress Chat 包有哪些版本

1
2
helm repo add higress.io https://higress.io/helm-charts
helm search repo  higress.io/higress  --versions

higress 当前最新版本为:2.0.7

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
% helm search repo   higress.io/higress  --versions
NAME                      	CHART VERSION	APP VERSION	DESCRIPTION
higress.io/higress        	2.0.7        	2.0.7      	Helm chart for deploying Higress gateways
higress.io/higress        	2.0.6        	2.0.6      	Helm chart for deploying Higress gateways
higress.io/higress        	2.0.5        	2.0.5      	Helm chart for deploying Higress gateways
higress.io/higress        	2.0.4        	2.0.4      	Helm chart for deploying Higress gateways
higress.io/higress        	2.0.3        	2.0.3      	Helm chart for deploying Higress gateways
higress.io/higress        	2.0.2        	2.0.2      	Helm chart for deploying Higress gateways
higress.io/higress        	2.0.1        	2.0.1      	Helm chart for deploying Higress gateways
higress.io/higress        	2.0.0        	2.0.0      	Helm chart for deploying Higress gateways
higress.io/higress        	1.4.2        	1.4.2      	Helm chart for deploying Higress gateways
higress.io/higress        	1.4.1        	1.4.1      	Helm chart for deploying Higress gateways
higress.io/higress        	1.4.0        	1.4.0      	Helm chart for deploying Higress gateways
higress.io/higress        	1.3.6        	1.3.6      	Helm chart for deploying Higress gateways
higress.io/higress        	1.3.5        	1.3.5      	Helm chart for deploying Higress gateways
higress.io/higress        	1.3.4        	1.3.4      	Helm chart for deploying Higress gateways
higress.io/higress        	1.3.3        	1.3.3      	Helm chart for deploying Higress gateways
higress.io/higress        	1.3.2        	1.3.2      	Helm chart for deploying Higress gateways
higress.io/higress        	1.3.1        	1.3.1      	Helm chart for deploying Higress gateways
higress.io/higress        	1.3.0        	1.3.0      	Helm chart for deploying Higress gateways
higress.io/higress        	1.2.0        	1.2.0      	Helm chart for deploying Higress gateways
higress.io/higress        	1.1.2        	1.1.2      	Helm chart for deploying Higress gateways
higress.io/higress        	1.1.1        	1.1.1      	Helm chart for deploying Higress gateways
higress.io/higress        	1.1.0        	1.1.0      	Helm chart for deploying Higress gateways
higress.io/higress        	1.0.1        	1.0.1      	Helm chart for deploying Higress gateways
higress.io/higress        	1.0.0        	1.0.0      	Helm chart for deploying Higress gateways
higress.io/higress        	0.7.4        	0.7.4      	Helm chart for deploying Higress gateways
higress.io/higress        	0.7.3        	0.7.3      	Helm chart for deploying higress gateways
higress.io/higress        	0.7.2        	0.7.2      	Helm chart for deploying higress gateways
higress.io/higress        	0.7.1        	0.7.1      	Helm chart for deploying higress gateways
higress.io/higress        	0.7.0        	0.7.0      	Helm chart for deploying higress gateways
higress.io/higress        	0.6.2        	0.6.2      	Helm chart for deploying higress gateways
higress.io/higress        	0.6.1        	0.6.1      	Helm chart for deploying higress gateways
higress.io/higress-console	2.0.4        	2.0.4      	Management console for Higress
higress.io/higress-console	2.0.3        	2.0.3      	Management console for Higress
higress.io/higress-console	2.0.2        	2.0.2      	Management console for Higress
higress.io/higress-console	2.0.1        	2.0.1      	Management console for Higress
higress.io/higress-console	2.0.0        	2.0.0      	Management console for Higress
higress.io/higress-console	1.4.6        	1.4.6      	Management console for Higress
higress.io/higress-console	1.4.5        	1.4.5      	Management console for Higress
higress.io/higress-console	1.4.4        	1.4.4      	Management console for Higress
higress.io/higress-console	1.4.3        	1.4.3      	Management console for Higress
higress.io/higress-console	1.4.2        	1.4.2      	Management console for Higress
higress.io/higress-console	1.4.1        	1.4.1      	Management console for Higress
higress.io/higress-console	1.4.0        	1.4.0      	Management console for Higress
higress.io/higress-console	1.3.3        	1.3.3      	Management console for Higress
higress.io/higress-console	1.3.2        	1.3.2      	Management console for Higress
higress.io/higress-console	1.3.1        	1.3.1      	Management console for Higress
higress.io/higress-console	1.3.0        	1.3.0      	Management console for Higress
higress.io/higress-console	1.2.0        	1.2.0      	Management console for Higress
higress.io/higress-console	1.1.2        	1.1.2      	Management console for Higress
higress.io/higress-console	1.1.1        	1.1.1      	Management console for Higress
higress.io/higress-console	1.1.0        	1.1.0      	Management console for Higress
higress.io/higress-console	1.0.2        	1.0.2      	Management console for Higress
higress.io/higress-console	1.0.1        	1.0.1      	Management console for Higress
higress.io/higress-console	1.0.0        	1.0.0      	Management console for Higress
higress.io/higress-console	0.2.0        	0.2.0      	Management console for Higress
higress.io/higress-console	0.1.1        	0.1.1      	Management console for Higress
higress.io/higress-console	0.1.0        	0.1.0      	Management console for Higress
higress.io/higress-console	0.0.3        	0.0.3      	Management console for Higress
higress.io/higress-console	0.0.2        	0.0.2      	Management console for Higress
higress.io/higress-core   	2.0.7        	2.0.7      	Helm chart for deploying higress gateways
higress.io/higress-core   	2.0.6        	2.0.6      	Helm chart for deploying higress gateways
higress.io/higress-core   	2.0.5        	2.0.5      	Helm chart for deploying higress gateways
higress.io/higress-core   	2.0.4        	2.0.4      	Helm chart for deploying higress gateways
higress.io/higress-core   	2.0.3        	2.0.3      	Helm chart for deploying higress gateways
higress.io/higress-core   	2.0.2        	2.0.2      	Helm chart for deploying higress gateways
higress.io/higress-core   	2.0.1        	2.0.1      	Helm chart for deploying higress gateways
higress.io/higress-core   	2.0.0        	2.0.0      	Helm chart for deploying higress gateways
higress.io/higress-core   	1.4.2        	1.4.2      	Helm chart for deploying higress gateways
higress.io/higress-core   	1.4.1        	1.4.1      	Helm chart for deploying higress gateways
higress.io/higress-core   	1.4.0        	1.4.0      	Helm chart for deploying higress gateways
higress.io/higress-core   	1.3.6        	1.3.6      	Helm chart for deploying higress gateways
higress.io/higress-core   	1.3.5        	1.3.5      	Helm chart for deploying higress gateways
higress.io/higress-core   	1.3.4        	1.3.4      	Helm chart for deploying higress gateways
higress.io/higress-core   	1.3.3        	1.3.3      	Helm chart for deploying higress gateways
higress.io/higress-core   	1.3.2        	1.3.2      	Helm chart for deploying higress gateways
higress.io/higress-core   	1.3.1        	1.3.1      	Helm chart for deploying higress gateways
higress.io/higress-core   	1.3.0        	1.3.0      	Helm chart for deploying higress gateways
higress.io/higress-core   	1.2.0        	1.2.0      	Helm chart for deploying higress gateways
higress.io/higress-core   	1.1.2        	1.1.2      	Helm chart for deploying higress gateways
higress.io/higress-core   	1.1.1        	1.1.1      	Helm chart for deploying higress gateways
higress.io/higress-core   	1.1.0        	1.1.0      	Helm chart for deploying higress gateways
higress.io/higress-core   	1.0.1        	1.0.1      	Helm chart for deploying higress gateways
higress.io/higress-core   	1.0.0        	1.0.0      	Helm chart for deploying higress gateways
higress.io/higress-core   	0.7.4        	0.7.4      	Helm chart for deploying higress gateways
higress.io/higress-core   	0.7.3        	0.7.3      	Helm chart for deploying higress gateways
higress.io/higress-core   	0.7.2        	0.7.2      	Helm chart for deploying higress gateways
higress.io/higress-core   	0.7.1        	0.7.1      	Helm chart for deploying higress gateways
higress.io/higress-core   	0.7.0        	0.7.0      	Helm chart for deploying higress gateways
higress.io/higress-local  	0.6.1        	0.6.1      	Helm chart for deploying higress gateways

如何查看Higress Chart包内容

1
2
3
4
5
6
7
8
# 先从私有仓库拉取(需先添加仓库)
helm repo add higress.io https://higress.io/helm-charts

# 拉取Chart
helm pull higress.io/higress --version <版本号> --untar  # --untar参数自动解压

# 如:
helm pull  higress.io/higress --version 2.0.7

以hgctl部署higress到k8s为例

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# 安装hgctl
curl -Ls https://raw.githubusercontent.com/alibaba/higress/main/tools/hack/get-hgctl.sh | bash

# 查看默认 profile
hgctl profile dump k8s -o ./k8s.yaml

# 安装, 更多values 参考:https://github.com/alibaba/higress/blob/main/helm/core/values.yaml
hgctl upgrade --set profile=k8s --set gateway.httpPort=80 --set gateway.httpsPort=443 --set global.namespace=higress-gateway --set chart.higress.version=2.0.7 --kubeconfig ./kube_config_xxx.yaml --context xxx \
--set values.higress-core.gateway.hub=mirrors.xxx.com/xxx/higress --set values.higress-core.gateway.tag=2.0.7 \
--set values.higress-core.controller.hub=mirrors.xxx.com/xxx/higress --set values.higress-core.controller.tag=2.0.7 \
--set values.higress-core.pilot.hub=mirrors.xxx.com/xxx/higress --set values.higress-core.pilot.tag=2.0.7 \
--set values.higress-console.image.repository=mirrors.xxx.com/xxx/higress/console --set values.higress-console.image.tag=2.0.4

# 更新, 参数 flags 同 hgctl install
hgctl upgrade [flags]

# Uninstall higress, istioAPI and GatewayAPI from a cluster
hgctl uninstall --purge-resources  --context string --kubeconfig string

以 Helm 部署higress到k8s为例

1
2
3
4
5
6
helm --kubeconfig ./kube_config_xxx.yaml repo add higress.io https://higress.io/helm-charts

helm upgrade --install --kubeconfig ./kube_config_xxx.yaml higress higress.io/higress   --version 2.0.7  -n higress-gateway-test \
--set global.watchNamespace="higress-gateway-test" --set global.ingressClass="higress-test" --set higress-core.gateway.hub=mirrors.xxx.com/xxx/higress \
 --set higress-core.gateway.tag=2.0.7 --set higress-core.controller.hub=mirrors.xxx.com/xxx/higress --set higress-core.controller.tag=2.0.7 \
 --set higress-core.pilot.hub=mirrors.xxx.com/xxx/higress --set higress-core.pilot.tag=2.0.7 

注意: global.ingressClass global.watchNamespace 这两个参数, 如果要在 一个集群中的多个 namespace 中部署 higress 实例, 那么这两个参数必需设置值,不能使用默认值。

调试技巧

  • 如何查看 Envoy 展开配置

Envoy 启动是, 会在 localhost:15000 监听,用于 Admin 管理, 通过以下命令dump Envoy 配置。

1
curl http://127.0.0.1:15000/config_dump

Higress Console 中各项配置与 K8s 资源的对应关系

  • 服务来源
  • 服务列表
  • 路由配置: 每条路由对应 Ingress 下的一个资源对象。
  • 域名管理
  • 消费者管理
  • 插件
  • AI 流量入口管理