Skip to content

Commit

Permalink
net-kourier update for graceful shutdown
Browse files Browse the repository at this point in the history
  • Loading branch information
skonto committed May 14, 2024
1 parent 3832f60 commit 4c12740
Showing 1 changed file with 24 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,15 @@ data:
exact: GET
route:
cluster: service_stats
- match:
safe_regex:
regex: '/drain_listeners'
headers:
- name: ':method'
string_match:
exact: POST
route:
cluster: service_stats
clusters:
- name: service_stats
connect_timeout: 0.250s
Expand All @@ -107,8 +116,9 @@ data:
lb_endpoints:
endpoint:
address:
pipe:
path: /tmp/envoy.admin
socket_address:
address: 127.0.0.1
port_value: 9901
- name: xds_cluster
# This keepalive is recommended by envoy docs.
# https://www.envoyproxy.io/docs/envoy/latest/api-docs/xds_protocol
Expand Down Expand Up @@ -137,8 +147,9 @@ data:
typed_config:
"@type": type.googleapis.com/envoy.extensions.access_loggers.stream.v3.StdoutAccessLog
address:
pipe:
path: /tmp/envoy.admin
socket_address:
address: 127.0.0.1
port_value: 9901
---
# Copyright 2021 The Knative Authors
#
Expand Down Expand Up @@ -462,8 +473,13 @@ spec:
- --base-id 1
- -c /tmp/config/envoy-bootstrap.yaml
- --log-level info
- --drain-time-s $(DRAIN_TIME_SECONDS)
- --drain-strategy immediate
command:
- /usr/local/bin/envoy
env:
- name: DRAIN_TIME_SECONDS
value: "15"
image: TO_BE_REPLACED
name: kourier-gateway
ports:
Expand Down Expand Up @@ -497,7 +513,7 @@ spec:
lifecycle:
preStop:
exec:
command: ["/bin/sh","-c","curl -X POST --unix /tmp/envoy.admin http://localhost/healthcheck/fail; sleep 15"]
command: ["/bin/sh","-c","curl -X POST http://localhost:9901/drain_listeners?graceful; sleep $DRAIN_TIME_SECONDS"]
readinessProbe:
httpGet:
httpHeaders:
Expand Down Expand Up @@ -527,6 +543,9 @@ spec:
limits:
cpu: "1"
memory: 800Mi

# to ensure a graceful drain, terminationGracePeriodSeconds must be greater than DRAIN_TIME_SECONDS environment variable
terminationGracePeriodSeconds: 30
volumes:
- name: config-volume
configMap:
Expand Down

0 comments on commit 4c12740

Please sign in to comment.