Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could you add some examples about outlier_detection in the examples directory? #34861

Open
thousmile opened this issue Jun 24, 2024 · 5 comments

Comments

@thousmile
Copy link

I searched for a long time in the examples directory and docs and wanted to test the outlier_detection function.

But it never works, not sure where is wrong with the configuration! I hope you have an outlier_detection example in the examples directory.

The following configuration will not automatically kick the host out regardless of how many 500 errors the upstream http service has.

admin:
  address:
    socket_address:
      address: 0.0.0.0
      port_value: 8001

static_resources:

  listeners:
    - name: listener_0
      address:
        socket_address:
          address: 0.0.0.0
          port_value: 10000
      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: ingress_http
                upgrade_configs:
                  - upgrade_type: websocket
                access_log:
                  - name: envoy.access_loggers.stdout
                    typed_config:
                      "@type": type.googleapis.com/envoy.extensions.access_loggers.stream.v3.StdoutAccessLog
                route_config:
                  name: rc01
                  virtual_hosts:
                    - name: vh01
                      domains:
                        - "*"
                      routes:
                        - name: retry-route
                          match:
                            prefix: /
                            headers:
                              - name: "enable-retry"
                                exact_match: "y"
                          route:
                            cluster: envoy_rest_server
                            retry_policy:
                              retry_on: "connect-failure,refused-stream,reset,gateway-error"
                              num_retries: 3
                              per_try_timeout: 0.5s

                        - name: timeout-route
                          match:
                            prefix: /
                            headers:
                              - name: "enable-timeout"
                                exact_match: "y"
                          route:
                            cluster: envoy_rest_server
                            timeout: 0.5s

                        - name: default_route
                          match:
                            prefix: /
                          route:
                            cluster: envoy_rest_server

                http_filters:
                  - name: envoy.filters.http.router
                    typed_config:
                      "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router

  clusters:
    - name: envoy_rest_server
      connect_timeout: 0.25s

      outlier_detection:
        consecutive_5xx: 3
        interval: "10s"
        base_ejection_time: "30s"
        max_ejection_time: "30s"
        max_ejection_percent: 100
        enforcing_consecutive_5xx: 100

      type: STATIC
      load_assignment:
        cluster_name: envoy_rest_server
        endpoints:
          - priority: 0
            lb_endpoints:
              - endpoint:
                  address:
                    socket_address:
                      address: 192.168.0.35
                      port_value: 18081

          - priority: 1
            lb_endpoints:
              - endpoint:
                  address:
                    socket_address:
                      address: 192.168.0.35
                      port_value: 18082

          - priority: 2
            lb_endpoints:
              - endpoint:
                  address:
                    socket_address:
                      address: 192.168.0.35
                      port_value: 18083
@thousmile thousmile added the triage Issue requires triage label Jun 24, 2024
@mattklein123 mattklein123 added area/docs area/examples help wanted Needs help! and removed triage Issue requires triage labels Jun 25, 2024
@ogetysaisandeep
Copy link

Could you please confirm if the issue is still open for contributions? I'd like to proceed with further improvements if possible. Can you assign this task to me.

@thousmile
Copy link
Author

Could you please confirm if the issue is still open for contributions? I'd like to proceed with further improvements if possible. Can you assign this task to me.

If you can help me with this problem. It will be very much appreciated

@thousmile
Copy link
Author

Could you please confirm if the issue is still open for contributions? I'd like to proceed with further improvements if possible. Can you assign this task to me.

My request is that when the downstream service calls the upstream service and there are 3 consecutive 5xx errors, the service will be kicked out and no longer send requests to the upstream service within 30 seconds. Directly return "upstream service is unavailable". Just like istio.
Now: There are 3 consecutive 5xx errors, and the downstream service will still request the upstream service

@phlax
Copy link
Member

phlax commented Jul 26, 2024

hi @ogetysaisandeep work on this would definitely be appreciated

adding sandbox/examples can take quite a few iterations as there are a few moving parts

overall i would say the thing to understand is that while ~all the examples are tested and so function as a kind of integration test, they are "docs-first" - ie the walkthrough/steps that the end user can take from them is the most important part

if you are happy to take this on im happy to work with you and review

@ogetysaisandeep
Copy link

Sure @phlax let me review but can you assign this to me?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants