Issue with configuring gRPC in Envoy: health check doesn’t work

I have 3 local grpc services with ports 50052, 50053,50054.
I only started 2 of them. I want envoy to detect the unstarted service and disconnect, but it doesn’t.
I want the endpoint that envoy can monitor to hang up and stop forwarding traffic to the corresponding endpoint.
What should i do?
Here is the envoy configuration file:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>static_resources:
listeners:
- name: grpc_listener
address:
socket_address:
address: 0.0.0.0
port_value: 5051
filter_chains:
- filters:
- name: envoy.filters.network.http_connection_manager
typed_config:
"@type": type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager
codec_type: AUTO
stat_prefix: grpc_proxy
route_config:
name: local_route
virtual_hosts:
- name: grpc_virtual_host
domains:
- "*"
routes:
- match:
prefix: "/"
route:
cluster: grpc_cluster
http_filters:
- name: envoy.filters.http.router
typed_config:
"@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router
clusters:
- name: grpc_cluster
connect_timeout: 1s
# type: STATIC
type: STRICT_DNS
lb_policy: ROUND_ROBIN
http2_protocol_options: {}
load_assignment:
cluster_name: grpc_cluster
endpoints:
- lb_endpoints:
- endpoint:
address:
socket_address:
address: 127.0.0.1
port_value: 50052
- endpoint:
address:
socket_address:
address: 127.0.0.1
port_value: 50053
- endpoint:
address:
socket_address:
address: 127.0.0.1
port_value: 50054
health_checks:
- timeout: 1s
interval: 5s
unhealthy_threshold: 1
healthy_threshold: 3
grpc_health_check: {}
event_log_path: "/tmp/grpc_health_check.log"
outlier_detection:
consecutive_5xx: 2
interval: 10s
base_ejection_time: 30s
typed_extension_protocol_options:
envoy.extensions.upstreams.http.v3.HttpProtocolOptions:
"@type": type.googleapis.com/envoy.extensions.upstreams.http.v3.HttpProtocolOptions
explicit_http_config:
http2_protocol_options: {}
</code>
<code>static_resources: listeners: - name: grpc_listener address: socket_address: address: 0.0.0.0 port_value: 5051 filter_chains: - filters: - name: envoy.filters.network.http_connection_manager typed_config: "@type": type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager codec_type: AUTO stat_prefix: grpc_proxy route_config: name: local_route virtual_hosts: - name: grpc_virtual_host domains: - "*" routes: - match: prefix: "/" route: cluster: grpc_cluster http_filters: - name: envoy.filters.http.router typed_config: "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router clusters: - name: grpc_cluster connect_timeout: 1s # type: STATIC type: STRICT_DNS lb_policy: ROUND_ROBIN http2_protocol_options: {} load_assignment: cluster_name: grpc_cluster endpoints: - lb_endpoints: - endpoint: address: socket_address: address: 127.0.0.1 port_value: 50052 - endpoint: address: socket_address: address: 127.0.0.1 port_value: 50053 - endpoint: address: socket_address: address: 127.0.0.1 port_value: 50054 health_checks: - timeout: 1s interval: 5s unhealthy_threshold: 1 healthy_threshold: 3 grpc_health_check: {} event_log_path: "/tmp/grpc_health_check.log" outlier_detection: consecutive_5xx: 2 interval: 10s base_ejection_time: 30s typed_extension_protocol_options: envoy.extensions.upstreams.http.v3.HttpProtocolOptions: "@type": type.googleapis.com/envoy.extensions.upstreams.http.v3.HttpProtocolOptions explicit_http_config: http2_protocol_options: {} </code>
static_resources:
  listeners:
  - name: grpc_listener
    address:
      socket_address:
        address: 0.0.0.0
        port_value: 5051 
    filter_chains:
    - filters:
      - name: envoy.filters.network.http_connection_manager
        typed_config:
          "@type": type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager
          codec_type: AUTO
          stat_prefix: grpc_proxy
          route_config:
            name: local_route
            virtual_hosts:
            - name: grpc_virtual_host
              domains:
              - "*" 
              routes:
              - match:
                  prefix: "/"  
                route:
                  cluster: grpc_cluster
          http_filters:
          - name: envoy.filters.http.router
            typed_config:
              "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router
  clusters:
  - name: grpc_cluster
    connect_timeout: 1s  
    # type: STATIC
    type: STRICT_DNS
    lb_policy: ROUND_ROBIN  
    http2_protocol_options: {}
    load_assignment:
      cluster_name: grpc_cluster
      endpoints:
      - lb_endpoints:
        - endpoint:
            address:
              socket_address:
                address: 127.0.0.1
                port_value: 50052 
        - endpoint:
            address:
              socket_address:
                address: 127.0.0.1
                port_value: 50053 
        - endpoint:
            address:
              socket_address:
                address: 127.0.0.1
                port_value: 50054  
    health_checks:
    - timeout: 1s
      interval: 5s
      unhealthy_threshold: 1
      healthy_threshold: 3
      grpc_health_check: {}
      event_log_path: "/tmp/grpc_health_check.log"

    outlier_detection:
      consecutive_5xx: 2  
      interval: 10s       
      base_ejection_time: 30s  
    typed_extension_protocol_options:
      envoy.extensions.upstreams.http.v3.HttpProtocolOptions:
        "@type": type.googleapis.com/envoy.extensions.upstreams.http.v3.HttpProtocolOptions
        explicit_http_config:
          http2_protocol_options: {}  

Here is the health check log in /tmp/grpc_health_check.log:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>{"health_checker_type":"GRPC","host":{"socket_address":{"protocol":"TCP","address":"127.0.0.1","port_value":50054,"resolver_name":"","ipv4_compat":false}},"cluster_name":"grpc_cluster","timestamp":"2024-12-16T07:34:39.843Z","health_check_failure_event":{"failure_type":"NETWORK","first_check":true},"metadata":{"filter_metadata":{},"typed_filter_metadata":{}},"locality":{"region":"","zone":"","sub_zone":""}}
{"health_checker_type":"GRPC","host":{"socket_address":{"protocol":"TCP","address":"127.0.0.1","port_value":50052,"resolver_name":"","ipv4_compat":false}},"cluster_name":"grpc_cluster","timestamp":"2024-12-16T07:34:39.852Z","health_check_failure_event":{"failure_type":"ACTIVE","first_check":true},"metadata":{"filter_metadata":{},"typed_filter_metadata":{}},"locality":{"region":"","zone":"","sub_zone":""}}
{"health_checker_type":"GRPC","host":{"socket_address":{"protocol":"TCP","address":"127.0.0.1","port_value":50053,"resolver_name":"","ipv4_compat":false}},"cluster_name":"grpc_cluster","timestamp":"2024-12-16T07:34:39.852Z","health_check_failure_event":{"failure_type":"ACTIVE","first_check":true},"metadata":{"filter_metadata":{},"typed_filter_metadata":{}},"locality":{"region":"","zone":"","sub_zone":""}}
</code>
<code>{"health_checker_type":"GRPC","host":{"socket_address":{"protocol":"TCP","address":"127.0.0.1","port_value":50054,"resolver_name":"","ipv4_compat":false}},"cluster_name":"grpc_cluster","timestamp":"2024-12-16T07:34:39.843Z","health_check_failure_event":{"failure_type":"NETWORK","first_check":true},"metadata":{"filter_metadata":{},"typed_filter_metadata":{}},"locality":{"region":"","zone":"","sub_zone":""}} {"health_checker_type":"GRPC","host":{"socket_address":{"protocol":"TCP","address":"127.0.0.1","port_value":50052,"resolver_name":"","ipv4_compat":false}},"cluster_name":"grpc_cluster","timestamp":"2024-12-16T07:34:39.852Z","health_check_failure_event":{"failure_type":"ACTIVE","first_check":true},"metadata":{"filter_metadata":{},"typed_filter_metadata":{}},"locality":{"region":"","zone":"","sub_zone":""}} {"health_checker_type":"GRPC","host":{"socket_address":{"protocol":"TCP","address":"127.0.0.1","port_value":50053,"resolver_name":"","ipv4_compat":false}},"cluster_name":"grpc_cluster","timestamp":"2024-12-16T07:34:39.852Z","health_check_failure_event":{"failure_type":"ACTIVE","first_check":true},"metadata":{"filter_metadata":{},"typed_filter_metadata":{}},"locality":{"region":"","zone":"","sub_zone":""}} </code>
{"health_checker_type":"GRPC","host":{"socket_address":{"protocol":"TCP","address":"127.0.0.1","port_value":50054,"resolver_name":"","ipv4_compat":false}},"cluster_name":"grpc_cluster","timestamp":"2024-12-16T07:34:39.843Z","health_check_failure_event":{"failure_type":"NETWORK","first_check":true},"metadata":{"filter_metadata":{},"typed_filter_metadata":{}},"locality":{"region":"","zone":"","sub_zone":""}}
{"health_checker_type":"GRPC","host":{"socket_address":{"protocol":"TCP","address":"127.0.0.1","port_value":50052,"resolver_name":"","ipv4_compat":false}},"cluster_name":"grpc_cluster","timestamp":"2024-12-16T07:34:39.852Z","health_check_failure_event":{"failure_type":"ACTIVE","first_check":true},"metadata":{"filter_metadata":{},"typed_filter_metadata":{}},"locality":{"region":"","zone":"","sub_zone":""}}
{"health_checker_type":"GRPC","host":{"socket_address":{"protocol":"TCP","address":"127.0.0.1","port_value":50053,"resolver_name":"","ipv4_compat":false}},"cluster_name":"grpc_cluster","timestamp":"2024-12-16T07:34:39.852Z","health_check_failure_event":{"failure_type":"ACTIVE","first_check":true},"metadata":{"filter_metadata":{},"typed_filter_metadata":{}},"locality":{"region":"","zone":"","sub_zone":""}}

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật