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

feat(infrastructure/proxy): add readiness probes in envoy proxy deployments #1568

Merged
merged 5 commits into from
Jun 26, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,33 @@ envoyProxy:
ads: {}
resource_api_version: V3
static_resources:
listeners:
- name: envoy-gateway-proxy-ready-0.0.0.0-19001
address:
socket_address:
address: 0.0.0.0
port_value: 19001
protocol: TCP
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
stat_prefix: eg-ready-http
route_config:
name: local_route
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:
- name: ":path"
string_match:
exact: /ready
- name: envoy.filters.http.router
typed_config:
"@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router
clusters:
- connect_timeout: 10s
load_assignment:
Expand Down Expand Up @@ -426,6 +453,32 @@ xds:
ads: {}
resourceApiVersion: V3
staticResources:
listeners:
- name: envoy-gateway-proxy-ready-0.0.0.0-19001
address:
socketAddress:
address: 0.0.0.0
portValue: 19001
filterChains:
- filters:
- name: envoy.filters.network.http_connection_manager
typedConfig:
"@type": type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager
statPrefix: eg-ready-http
routeConfig:
name: local_route
httpFilters:
- name: envoy.filters.http.health_check
typedConfig:
"@type": type.googleapis.com/envoy.extensions.filters.http.health_check.v3.HealthCheck
passThroughMode: false
headers:
- name: ":path"
stringMatch:
exact: /ready
- name: envoy.filters.http.router
typedConfig:
"@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router
clusters:
- connectTimeout: 10s
loadAssignment:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,56 @@
]
},
"staticResources": {
"listeners": [
{
"name": "envoy-gateway-proxy-ready-0.0.0.0-19001",
"address": {
"socketAddress": {
"address": "0.0.0.0",
"portValue": 19001,
}
},
"filterChains": [
{
"filters": [
{
"name": "envoy.filters.network.http_connection_manager",
"typedConfig": {
"@type": "type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager",
"statPrefix": "eg-ready-http",
"routeConfig": {
"name": "local_route"
},
"httpFilters": [
{
"name": "envoy.filters.http.health_check",
"typedConfig": {
"@type": "type.googleapis.com/envoy.extensions.filters.http.health_check.v3.HealthCheck",
"passThroughMode": false,
"headers": [
{
"name": ":path",
"stringMatch": {
"exact": "/ready"
}
}
]
}
},
{
"name": "envoy.filters.http.router",
"typedConfig": {
"@type": "type.googleapis.com/envoy.extensions.filters.http.router.v3.Router"
}
}
]
}
}
]
}
]
}
],
"clusters": [
{
"connectTimeout": "10s",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,32 @@ xds:
ads: {}
resourceApiVersion: V3
staticResources:
listeners:
- name: envoy-gateway-proxy-ready-0.0.0.0-19001
address:
socketAddress:
address: 0.0.0.0
portValue: 19001
filterChains:
- filters:
- name: envoy.filters.network.http_connection_manager
typedConfig:
"@type": type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager
statPrefix: eg-ready-http
routeConfig:
name: local_route
httpFilters:
- name: envoy.filters.http.health_check
typedConfig:
"@type": type.googleapis.com/envoy.extensions.filters.http.health_check.v3.HealthCheck
passThroughMode: false
headers:
- name: ":path"
stringMatch:
exact: /ready
- name: envoy.filters.http.router
typedConfig:
"@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router
clusters:
- connectTimeout: 10s
loadAssignment:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,32 @@ xds:
ads: {}
resourceApiVersion: V3
staticResources:
listeners:
- name: envoy-gateway-proxy-ready-0.0.0.0-19001
address:
socketAddress:
address: 0.0.0.0
portValue: 19001
filterChains:
- filters:
- name: envoy.filters.network.http_connection_manager
typedConfig:
"@type": type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager
statPrefix: eg-ready-http
routeConfig:
name: local_route
httpFilters:
- name: envoy.filters.http.health_check
typedConfig:
"@type": type.googleapis.com/envoy.extensions.filters.http.health_check.v3.HealthCheck
passThroughMode: false
headers:
- name: ":path"
stringMatch:
exact: /ready
- name: envoy.filters.http.router
typedConfig:
"@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router
clusters:
- connectTimeout: 10s
loadAssignment:
Expand Down
9 changes: 9 additions & 0 deletions internal/infrastructure/kubernetes/proxy/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"strings"

corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/util/intstr"
"k8s.io/utils/pointer"

egcfgv1a1 "github.com/envoyproxy/gateway/api/config/v1alpha1"
Expand Down Expand Up @@ -154,6 +155,14 @@ func expectedProxyContainers(infra *ir.ProxyInfra, deploymentConfig *egcfgv1a1.K
VolumeMounts: expectedContainerVolumeMounts(deploymentConfig),
TerminationMessagePolicy: corev1.TerminationMessageReadFile,
TerminationMessagePath: "/dev/termination-log",
ReadinessProbe: &corev1.Probe{
ProbeHandler: corev1.ProbeHandler{
HTTPGet: &corev1.HTTPGetAction{
Path: bootstrap.EnvoyReadinessPath,
Port: intstr.IntOrString{Type: intstr.Int, IntVal: bootstrap.EnvoyReadinessPort},
},
},
},
},
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ spec:
requests:
cpu: 100m
memory: 512Mi
readinessProbe:
httpGet:
path: /ready
port: 19001
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
volumeMounts:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ spec:
requests:
cpu: 100m
memory: 512Mi
readinessProbe:
httpGet:
path: /ready
port: 19001
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
volumeMounts:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,33 @@ spec:
ads: {}
resource_api_version: V3
static_resources:
listeners:
- name: envoy-gateway-proxy-ready-0.0.0.0-19001
address:
socket_address:
address: 0.0.0.0
port_value: 19001
protocol: TCP
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
stat_prefix: eg-ready-http
route_config:
name: local_route
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:
- name: ":path"
string_match:
exact: /ready
- name: envoy.filters.http.router
typed_config:
"@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router
clusters:
- connect_timeout: 10s
load_assignment:
Expand Down Expand Up @@ -138,6 +165,10 @@ spec:
requests:
cpu: 200m
memory: 1Gi
readinessProbe:
httpGet:
path: /ready
port: 19001
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
securityContext:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,33 @@ spec:
ads: {}
resource_api_version: V3
static_resources:
listeners:
- name: envoy-gateway-proxy-ready-0.0.0.0-19001
address:
socket_address:
address: 0.0.0.0
port_value: 19001
protocol: TCP
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
stat_prefix: eg-ready-http
route_config:
name: local_route
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:
- name: ":path"
string_match:
exact: /ready
- name: envoy.filters.http.router
typed_config:
"@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router
clusters:
- connect_timeout: 10s
load_assignment:
Expand Down Expand Up @@ -138,6 +165,10 @@ spec:
requests:
cpu: 200m
memory: 1Gi
readinessProbe:
httpGet:
path: /ready
port: 19001
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
securityContext:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,33 @@ spec:
ads: {}
resource_api_version: V3
static_resources:
listeners:
- name: envoy-gateway-proxy-ready-0.0.0.0-19001
address:
socket_address:
address: 0.0.0.0
port_value: 19001
protocol: TCP
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
stat_prefix: eg-ready-http
route_config:
name: local_route
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:
- name: ":path"
string_match:
exact: /ready
- name: envoy.filters.http.router
typed_config:
"@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router
clusters:
- connect_timeout: 10s
load_assignment:
Expand Down Expand Up @@ -133,6 +160,10 @@ spec:
requests:
cpu: 100m
memory: 512Mi
readinessProbe:
httpGet:
path: /ready
port: 19001
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
volumeMounts:
Expand Down
Loading