跳转到内容

Higress Values 配置参数详解

本文档详细说明 Higress Helm Chart 的 values.yaml 文件中各个配置参数的作用。

graph TD
    A[values.yaml] --> B[全局配置 global]
    A --> C[网关配置 gateway]
    A --> D[控制器配置 controller]
    A --> E[服务发现配置 pilot]
    A --> F[其他配置]
    B --> B1[网络与协议]
    B --> B2[资源限制]
    B --> B3[镜像配置]
    B --> B4[代理配置 proxy]
    B --> B5[多集群配置]

全局配置影响 Higress 的所有组件。

参数类型默认值说明
enableH3boolfalse是否启用 HTTP/3 协议支持
enableIPv6boolfalse是否启用 IPv6 支持
enableProxyProtocolboolfalse是否启用 Proxy Protocol,用于传递客户端真实 IP
disableAlpnH2boolfalse是否禁用 ALPN 中的 HTTP/2
参数类型默认值说明
enableLDSCacheboolfalse是否启用 LDS (Listener Discovery Service) 缓存
enablePushAllMCPClustersbooltrue是否推送所有 MCP (Mesh Configuration Protocol) 集群
liteMetricsboolfalse是否启用轻量级指标,减少指标数量
参数类型默认值说明
xdsMaxRecvMsgSizestring"104857600"XDS (Istio Discovery Service) 最大接收消息大小 (100MB)
defaultUpstreamConcurrencyThresholdint10000默认上游并发阈值
参数类型默认值说明
enableSRDSbooltrue是否启用 SRDS (Shared Route Discovery Service)
onDemandRDSboolfalse是否按需加载 RDS 配置
hostRDSMergeSubsetboolfalse是否合并主机级别的 RDS 子集
onlyPushRouteClusterbooltrue是否仅推送路由集群配置
参数类型默认值说明
enableRedisboolfalse是否启用 Redis (redis-stack-server)
enablePluginServerbooltrue是否启用插件服务器
参数类型默认值说明
ingressClassstring"higress"Ingress 类名,用于过滤监听的 Ingress 资源
watchNamespacestring""限制监听的命名空间,空值表示监听所有命名空间

特殊 ingressClass 值:

  • "nginx": 监听带有 nginx ingress class 或无 ingress class 的资源
  • "": 监听集群中所有 Ingress 资源
参数类型默认值说明
enableStatusbooltrue是否更新 Ingress 资源的 status 字段
enableIstioAPIbooltrue是否监听 Istio API 资源
enableGatewayAPIbooltrue是否监听 Gateway API 资源
参数类型默认值说明
localboolfalse是否为本地集群 (如 kind) 部署
autoscalingv2APIbooltrue是否使用 autoscaling/v2 HPA 模板
参数类型默认值说明
istioNamespacestring"istio-system"Istiod 所在的命名空间
enableAnalysisboolfalse是否启用分析功能
defaultPodDisruptionBudget:
enabled: false # 是否启用 PDB,用于确保控制平面组件的优雅升级
defaultResources:
requests:
cpu: 10m # 最小 CPU 请求,确保 HPA 正常工作

各组件可通过各自的 resources 配置覆盖这些默认值。

参数类型默认值说明
hubstringimage.midea.com/midea-middleware/higress镜像仓库地址
imagePullPolicystring""镜像拉取策略 (Always/IfNotPresent)
imagePullSecretslist[]私有仓库的镜像拉取密钥列表
参数类型默认值说明
logAsJsonboolfalse是否以 JSON 格式输出日志
logging.levelstring"default:info"日志级别,格式 <scope>:<level>
参数类型默认值说明
priorityClassNamestring""Pod 优先级类,防止被低优先级 Pod 驱逐

参数类型默认值说明
imagestring"proxyv2"Envoy 代理镜像名称
autoInjectstring"enabled"Sidecar 自动注入策略
参数类型默认值说明
clusterDomainstring"cluster.local"Kubernetes 集群域名
参数类型默认值说明
logLevelstring"warning"代理日志级别
componentLogLevelstring"misc:error"组件级日志级别

入站端口捕获:

excludeInboundPorts: "" # 排除的入站端口
includeInboundPorts: "*" # 包含的入站端口,* 表示全部

出站流量捕获:

includeIPRanges: "*" # 包含的 IP 范围,* 表示全部
excludeIPRanges: "" # 排除的 IP 范围
includeOutboundPorts: "" # 包含的出站端口
excludeOutboundPorts: "" # 排除的出站端口
参数类型默认值说明
privilegedboolfalse是否以特权模式运行
enableCoreDumpboolfalse是否启用核心转储
参数类型默认值说明
readinessFailureThresholdint30失败阈值
readinessSuccessThresholdint30成功阈值
readinessInitialDelaySecondsint1初始延迟 (秒)
readinessPeriodSecondsint2检查周期 (秒)
readinessTimeoutSecondsint3超时时间 (秒)
resources:
requests:
cpu: 100m
memory: 128Mi
limits:
cpu: 2000m
memory: 1024Mi
参数类型默认值说明
statusPortint15020健康检查端口,0 表示禁用
tracerstring""追踪器类型 (lightstep/datadog/stackdriver)
holdApplicationUntilProxyStartsboolfalse应用是否等待代理就绪后启动

3. 代理初始化配置 (global.proxy_init)

Section titled “3. 代理初始化配置 (global.proxy_init)”

用于配置 iptables 的初始化容器。

proxy_init:
image: proxyv2 # 初始化容器镜像
resources:
limits:
cpu: 2000m
memory: 1024Mi
requests:
cpu: 10m
memory: 10Mi

multiCluster:
enabled: true # 是否启用多集群
clusterName: "" # 当前集群名称
network: "" # 当前集群所属网络名称
meshNetworks: {} # 网格网络配置
meshID: "" # 网格唯一标识符
meshConfig:
rootNamespace: "" # 根命名空间
trustDomain: "cluster.local" # 信任域
enablePrometheusMerge: true # 是否合并 Prometheus 指标

参数类型默认值说明
caAddressstring""自定义 CA 地址
externalIstiodboolfalse是否使用外部 istiod
configClusterboolfalse是否为配置集群
pilotCertProviderstring"istiod"证书提供者 (kubernetes/istiod)

参数类型默认值说明
jwtPolicystring"third-party-jwt"JWT 验证策略
mountMtlsCertsboolfalse是否挂载 mTLS 证书
sds:
token:
aud: istio-ca # JWT token 的 aud 字段
sts:
servicePort: 0 # STS 服务端口,0 表示禁用

datadog:
address: "$(HOST_IP):8126" # Datadog Agent 地址
lightstep:
address: "" # 卫星池地址
accessToken: "" # 访问令牌
stackdriver:
debug: false
maxNumberOfMessageEvents: 200
maxNumberOfAnnotations: 200
maxNumberOfAttributes: 200

o11y:
enabled: false
promtail:
image:
repository: higress-registry.cn-hangzhou.cr.aliyuncs.com/higress/promtail
tag: "2.9.4"
port: 3101
resources:
limits:
cpu: 500m
memory: 2Gi

参数类型默认值说明
namestring"higress-gateway"Gateway 名称
replicasint1Pod 副本数
imagestring"gateway"Gateway 镜像
kindstring"Deployment"工作负载类型 (Deployment/DaemonSet)
hub: image.midea.com/midea-middleware/higress
tag: "" # 镜像标签,空值使用 Chart 默认值
revision: "" # Gateway 所属的 revision
参数类型默认值说明
httpPortint80HTTP 端口
httpsPortint443HTTPS 端口
参数类型默认值说明
hostNetworkboolfalse是否使用宿主机网络
rbac:
enabled: true # 是否创建访问证书的 RBAC 角色
serviceAccount:
create: true # 是否创建 ServiceAccount
annotations: {} # ServiceAccount 注解
name: "" # ServiceAccount 名称
labels: {} # 资源标签
annotations: {} # 资源注解
podLabels: {} # Pod 标签
podAnnotations: # Pod 注解
prometheus.io/port: "15020"
prometheus.io/scrape: "true"
prometheus.io/path: "/stats/prometheus"
sidecar.istio.io/inject: "false"
securityContext: ~ # Pod 安全上下文
containerSecurityContext: ~ # 容器安全上下文
unprivilegedPortSupported: ~ # 是否支持非特权端口
service:
type: LoadBalancer # 服务类型
ports:
- name: http2
port: 80
protocol: TCP
targetPort: 80
- name: https
port: 443
protocol: TCP
targetPort: 443
annotations: {}
loadBalancerIP: "" # 指定 LoadBalancer IP
loadBalancerClass: "" # LoadBalancer 类别
loadBalancerSourceRanges: [] # 源地址范围限制
externalTrafficPolicy: "" # 外部流量策略
rollingMaxSurge: 100% # 最大激增比例
rollingMaxUnavailable: 25% # 最大不可用比例
resources:
requests:
cpu: 2000m
memory: 2048Mi
limits:
cpu: 2000m
memory: 2048Mi
autoscaling:
enabled: false
minReplicas: 1
maxReplicas: 5
targetCPUUtilizationPercentage: 80
nodeSelector: {} # 节点选择器
tolerations: [] # 容忍度
affinity: {} # 亲和性配置
networkGateway: "" # 网络关配置
metrics:
enabled: false # 是否启用 PodMonitor/VMPodScrape
provider: monitoring.coreos.com # CRD 提供者
interval: ""
scrapeTimeout: ""
honorLabels: false
metricRelabelings: [] # Prometheus metric relabeling
relabelings: [] # Prometheus relabeling
metricRelabelConfigs: [] # VictoriaMetrics relabeling
relabelConfigs: [] # VictoriaMetrics relabeling
rawSpec: {} # 原始规格

参数类型默认值说明
namestring"higress-controller"Controller 名称
replicasint1Pod 副本数
imagestring"higress"Controller 镜像
hub: image.midea.com/midea-middleware/higress
tag: ""
probe:
httpGet:
path: /ready
port: 8888
initialDelaySeconds: 1
periodSeconds: 3
timeoutSeconds: 5
端口名端口协议说明
http8888TCPHTTP 服务端口
http-solver8889TCPHTTP 求解器端口
grpc15051TCPgRPC 服务端口
rbac:
create: true # 是否创建 RBAC 资源
serviceAccount:
create: true
annotations: {}
name: ""
resources:
requests:
cpu: 500m
memory: 2048Mi
limits:
cpu: 1000m
memory: 2048Mi
automaticHttps:
enabled: true
email: "" # Let's Encrypt 通知邮箱

参数类型默认值说明
autoscaleEnabledboolfalse是否启用自动扩缩容
autoscaleMinint1最小副本数
autoscaleMaxint5最大副本数
replicaCountint1副本数量
imagestring"pilot"Pilot 镜像
traceSamplingfloat1.0追踪采样率 (0.0-1.0)
rollingMaxSurge: 100%
rollingMaxUnavailable: 25%
resources:
requests:
cpu: 500m
memory: 2048Mi
cpu:
targetAverageUtilization: 80
env:
PILOT_SCOPE_GATEWAY_TO_NAMESPACE: "false"
PILOT_ENABLE_METADATA_EXCHANGE: "false"
PILOT_ENABLE_CROSS_CLUSTER_WORKLOAD_ENTRY: "false"
VALIDATION_ENABLED: "false"
enableProtocolSniffingForOutbound: true # 出站协议嗅探
enableProtocolSniffingForInbound: true # 入站协议嗅探
keepaliveMaxServerConnectionAge: 30m # 最大服务端连接存活时间
configSource:
subscribedResources: [] # 订阅的资源列表
jwksResolverExtraRootCA: "" # JWKS 解析器额外根证书
plugins: [] # Pilot 插件列表
configMap: true # 是否安装 mesh config map

tracing:
enable: false # 是否启用追踪
sampling: 100 # 追踪采样百分比
timeout: 500 # 追踪超时时间 (毫秒)
# skywalking:
# access_token: ""
# service: ""
# port: 11800
# zipkin:
# service: ""
# port: 9411

客户端到 Gateway 的连接配置。

downstream:
idleTimeout: 180 # 空闲超时 (秒)
maxRequestHeadersKb: 60 # 最大请求头大小 (KB)
connectionBufferLimits: 32768 # 连接缓冲区限制
http2:
maxConcurrentStreams: 100 # HTTP/2 最大并发流
initialStreamWindowSize: 65535 # 初始流窗口大小
initialConnectionWindowSize: 1048576 # 初始连接窗口大小
routeTimeout: 0 # 路由超时 (秒),0 表示禁用

Gateway 到后端服务的连接配置。

upstream:
idleTimeout: 10 # 空闲超时 (秒)
connectionBufferLimits: 10485760 # 连接缓冲区限制

gzip:
enable: true # 是否启用 Gzip
minContentLength: 1024 # 最小压缩内容长度
contentType: # 压缩的内容类型
- "text/html"
- "text/css"
- "text/plain"
- "text/xml"
- "application/json"
- "application/javascript"
- "application/xhtml+xml"
- "image/svg+xml"
disableOnEtagHeader: true # 存在 Etag 时禁用
memoryLevel: 5 # 内存级别 (1-9)
windowBits: 12 # 窗口大小 (8-15)
chunkSize: 4096 # 块大小
compressionLevel: "BEST_COMPRESSION" # 压缩级别
compressionStrategy: "DEFAULT_STRATEGY" # 压缩策略

redis:
redis:
name: redis-stack-server
image: "redis-stack-server"
tag: "7.4.0-v3"
replicas: 1
password: "" # 密码,空值表示无密码
service:
type: ClusterIP
port: 6379
resources: {}
nodeSelector: {}
tolerations: []
affinity: {}
persistence:
enabled: false
storageClass: ""
accessModes:
- ReadWriteOnce
size: 1Gi

pluginServer:
name: "higress-plugin-server"
replicas: 1 # 副本数,高可用推荐 2
image: higress-plugin-server
hub: image.midea.com/midea-middleware/higress
tag: "1.0.0"
imagePullSecrets: []
labels: {}
podLabels: {}
service:
port: 80 # 容器目标端口
resources:
requests:
cpu: 200m
memory: 128Mi
limits:
cpu: 500m
memory: 256Mi

revision: "" # 安装 revision
clusterName: "" # 集群名称
hub: image.midea.com/midea-middleware/higress

global:
enableProxyProtocol: true # 启用以获取客户端真实 IP
enableStatus: false # 避免覆盖 Nginx Ingress 状态
imagePullPolicy: "IfNotPresent"
gateway:
replicas: 2 # 高可用
resources:
requests:
cpu: 2000m
memory: 2048Mi
limits:
cpu: 4000m
memory: 4096Mi
autoscaling:
enabled: true
minReplicas: 2
maxReplicas: 10
targetCPUUtilizationPercentage: 70
controller:
replicas: 1 # 通常单副本足够
pilot:
replicaCount: 1 # 小规模环境
# 大规模环境启用自动扩缩容
autoscaleEnabled: true
autoscaleMin: 2
autoscaleMax: 5
pluginServer:
replicas: 2 # 高可用
gateway:
replicas: 1
resources:
requests:
cpu: 500m
memory: 512Mi
limits:
cpu: 1000m
memory: 1024Mi
controller:
replicas: 1
pilot:
replicaCount: 1
resources:
requests:
cpu: 200m
memory: 512Mi
pluginServer:
replicas: 1