higress icon indicating copy to clipboard operation
higress copied to clipboard

higress如何支持健康检查和路由权重、会话保持

Open SandyLing opened this issue 2 years ago • 4 comments

我使用了0.2.0控制台 发现不支持higress控制台不支持健康检查和路由权重、会话保持。 zty说可以用istio api和ingress 注解实现。 istio api 我还没有使用过,需要研究一些。

还有一点是higress 有提供自己的api吗

SandyLing avatar Apr 11 '23 01:04 SandyLing

Admin API 有的,不过这块后面还会做调整,现阶段对接集成要考虑未来的兼容性问题,所以目前还未正式公开,加入钉钉开发群可以看到群文档。

权重路由是控制台后续会做的,目前 ingress 注解是支持的可以参考:https://github.com/alibaba/higress/blob/main/samples/nacos-discovery/multi-destination.yaml

健康检查可以基于 istio envoyfilter 来实现,可以参考下这个issue comment,对应 higress 上的可以 work 的配置:

注意需要先开启 istio api的支持:https://higress.io/zh-cn/docs/ops/deploy-by-helm#%E6%94%AF%E6%8C%81-istio-crd%E5%8F%AF%E9%80%89

apiVersion: networking.istio.io/v1alpha3
kind: EnvoyFilter
metadata:
  name: health-check
  namespace: higress-system
spec:
  configPatches:
  - applyTo: CLUSTER
    match:
      context: GATEWAY
      cluster:
        # 这里就是服务列表里展示的服务名(不带端口)
        service: my-ip.static
    patch:
      operation: MERGE
      value:
        health_checks:
        - timeout: 2s
          interval: 2s
          #  Rather useful for debugging params
          always_log_health_check_failures: true
          event_log_path: /dev/stdout
          http_health_check:
            path: /healthz

envoy配置:https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/core/v3/health_check.proto#envoy-v3-api-msg-config-core-v3-healthcheck

会话保持可以参考这里:https://higress.io/zh-cn/docs/user/annotation-use-case#cookie%E4%BA%B2%E5%92%8C%E6%80%A7-%E4%BC%9A%E8%AF%9D%E4%BF%9D%E6%8C%81

johnlanni avatar Apr 11 '23 02:04 johnlanni

控制台能支持配置健康检查吗

SandyLing avatar Aug 07 '23 06:08 SandyLing

@SandyLing 目前还没有这个功能,可以到这里提个issue:https://github.com/higress-group/higress-console/issues

johnlanni avatar Aug 07 '23 06:08 johnlanni

@johnlanni 上面的yaml配置文件里,需要将health_threshold和unhealth_threshold字段加进来。 image

llahu avatar Feb 26 '24 10:02 llahu