diff --git a/k8s/helm-charts/seldon-core-v2-setup/templates/seldon-v2-components.yaml b/k8s/helm-charts/seldon-core-v2-setup/templates/seldon-v2-components.yaml index e2f86913ea..160f4d240e 100644 --- a/k8s/helm-charts/seldon-core-v2-setup/templates/seldon-v2-components.yaml +++ b/k8s/helm-charts/seldon-core-v2-setup/templates/seldon-v2-components.yaml @@ -944,6 +944,15 @@ spec: image: '{{ .Values.envoy.image.registry }}/{{ .Values.envoy.image.repository }}:{{ .Values.envoy.image.tag }}' imagePullPolicy: '{{ .Values.envoy.image.pullPolicy }}' + lifecycle: + preStop: + exec: + command: + - /bin/sh + - -c + - | + echo -ne "POST /healthcheck/fail HTTP/1.1\r\nHost: localhost\r\nConnection: close\r\n\r\n" > /dev/tcp/localhost/9901 + sleep 30 name: envoy ports: - containerPort: 9000 diff --git a/k8s/kustomize/helm-components-sc/patch_envoy.yaml b/k8s/kustomize/helm-components-sc/patch_envoy.yaml index 9890054886..a8c8b94ce9 100644 --- a/k8s/kustomize/helm-components-sc/patch_envoy.yaml +++ b/k8s/kustomize/helm-components-sc/patch_envoy.yaml @@ -39,3 +39,12 @@ spec: name: '{{ .Values.security.controlplane.ssl.client.serverValidationSecret }}' key: ca.crt optional: true + lifecycle: + preStop: + exec: + command: + - /bin/sh + - -c + - | + echo -ne "POST /healthcheck/fail HTTP/1.1\r\nHost: localhost\r\nConnection: close\r\n\r\n" > /dev/tcp/localhost/9901 + sleep 30 diff --git a/k8s/yaml/components.yaml b/k8s/yaml/components.yaml index a49a752018..62e229debc 100644 --- a/k8s/yaml/components.yaml +++ b/k8s/yaml/components.yaml @@ -785,6 +785,15 @@ spec: optional: true image: 'docker.io/seldonio/seldon-envoy:latest' imagePullPolicy: 'IfNotPresent' + lifecycle: + preStop: + exec: + command: + - /bin/sh + - -c + - | + echo -ne "POST /healthcheck/fail HTTP/1.1\r\nHost: localhost\r\nConnection: close\r\n\r\n" > /dev/tcp/localhost/9901 + sleep 30 name: envoy ports: - containerPort: 9000 diff --git a/scheduler/config/envoy-compose.yaml b/scheduler/config/envoy-compose.yaml index 70f52d8732..176ec87746 100644 --- a/scheduler/config/envoy-compose.yaml +++ b/scheduler/config/envoy-compose.yaml @@ -39,6 +39,13 @@ static_resources: port_value: 9003 filter_chains: - filters: + - name: envoy.filters.http.health_check + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.health_check.v3.HealthCheck + pass_through_mode: false + headers: + - exact_match: /ready + name: :path - name: envoy.http_connection_manager typed_config: "@type": type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager @@ -57,10 +64,6 @@ static_resources: prefix: /stats route: cluster: admin_interface_cluster - - match: - prefix: /ready - route: - cluster: admin_interface_cluster dynamic_resources: ads_config: api_type: DELTA_GRPC diff --git a/scheduler/config/envoy-local.yaml b/scheduler/config/envoy-local.yaml index eaca4c95b2..965db82c4b 100644 --- a/scheduler/config/envoy-local.yaml +++ b/scheduler/config/envoy-local.yaml @@ -39,6 +39,13 @@ static_resources: port_value: 9003 filter_chains: - filters: + - name: envoy.filters.http.health_check + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.health_check.v3.HealthCheck + pass_through_mode: false + headers: + - exact_match: /ready + name: :path - name: envoy.http_connection_manager typed_config: "@type": type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager @@ -57,10 +64,6 @@ static_resources: prefix: /stats route: cluster: admin_interface_cluster - - match: - prefix: /ready - route: - cluster: admin_interface_cluster dynamic_resources: ads_config: api_type: DELTA_GRPC diff --git a/scheduler/config/envoy-tls.yaml b/scheduler/config/envoy-tls.yaml index ae0d9f1f28..6042a7d326 100644 --- a/scheduler/config/envoy-tls.yaml +++ b/scheduler/config/envoy-tls.yaml @@ -52,6 +52,13 @@ static_resources: port_value: 9003 filter_chains: - filters: + - name: envoy.filters.http.health_check + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.health_check.v3.HealthCheck + pass_through_mode: false + headers: + - exact_match: /ready + name: :path - name: envoy.http_connection_manager typed_config: "@type": type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager @@ -70,10 +77,6 @@ static_resources: prefix: /stats route: cluster: admin_interface_cluster - - match: - prefix: /ready - route: - cluster: admin_interface_cluster dynamic_resources: ads_config: api_type: DELTA_GRPC diff --git a/scheduler/config/envoy.yaml b/scheduler/config/envoy.yaml index f02c20aec7..e8d7c14678 100644 --- a/scheduler/config/envoy.yaml +++ b/scheduler/config/envoy.yaml @@ -44,6 +44,13 @@ static_resources: "@type": type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager stat_prefix: util_endpoint_http http_filters: + - name: envoy.filters.http.health_check + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.health_check.v3.HealthCheck + pass_through_mode: false + headers: + - exact_match: /ready + name: :path - name: envoy.filters.http.router typed_config: "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router @@ -57,10 +64,6 @@ static_resources: prefix: /stats route: cluster: admin_interface_cluster - - match: - prefix: /ready - route: - cluster: admin_interface_cluster dynamic_resources: ads_config: api_type: DELTA_GRPC diff --git a/scheduler/k8s/envoy/envoy.yaml b/scheduler/k8s/envoy/envoy.yaml index 2d8d431add..6d0592320a 100644 --- a/scheduler/k8s/envoy/envoy.yaml +++ b/scheduler/k8s/envoy/envoy.yaml @@ -47,4 +47,4 @@ spec: containerPort: 9000 - name: envoy-stats containerPort: 9003 - terminationGracePeriodSeconds: 5 + terminationGracePeriodSeconds: 120