From 5afa02878b2be3226389ebffa54779f7f4b9c0bd Mon Sep 17 00:00:00 2001 From: "nastassia.dailidava" Date: Wed, 27 Dec 2023 19:21:18 +0100 Subject: [PATCH] Added keepalive settings --- .../envoycontrol/snapshot/SnapshotProperties.kt | 3 +++ .../snapshot/resource/clusters/EnvoyClustersFactory.kt | 9 +++------ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/envoy-control-core/src/main/kotlin/pl/allegro/tech/servicemesh/envoycontrol/snapshot/SnapshotProperties.kt b/envoy-control-core/src/main/kotlin/pl/allegro/tech/servicemesh/envoycontrol/snapshot/SnapshotProperties.kt index 0a2c76202..403f427e9 100644 --- a/envoy-control-core/src/main/kotlin/pl/allegro/tech/servicemesh/envoycontrol/snapshot/SnapshotProperties.kt +++ b/envoy-control-core/src/main/kotlin/pl/allegro/tech/servicemesh/envoycontrol/snapshot/SnapshotProperties.kt @@ -293,6 +293,9 @@ class EgressProperties { var hostHeaderRewriting = HostHeaderRewritingProperties() var headersToRemove = mutableListOf() var domains = mutableListOf() + var keepAliveTime = 7200 + var keepAliveProbes = 9 + var keepAliveInterval = 75 } class IngressProperties { diff --git a/envoy-control-core/src/main/kotlin/pl/allegro/tech/servicemesh/envoycontrol/snapshot/resource/clusters/EnvoyClustersFactory.kt b/envoy-control-core/src/main/kotlin/pl/allegro/tech/servicemesh/envoycontrol/snapshot/resource/clusters/EnvoyClustersFactory.kt index ba27f432d..e891d2e43 100644 --- a/envoy-control-core/src/main/kotlin/pl/allegro/tech/servicemesh/envoycontrol/snapshot/resource/clusters/EnvoyClustersFactory.kt +++ b/envoy-control-core/src/main/kotlin/pl/allegro/tech/servicemesh/envoycontrol/snapshot/resource/clusters/EnvoyClustersFactory.kt @@ -78,9 +78,6 @@ class EnvoyClustersFactory( private val clustersForJWT: List = properties.jwt.providers.values.mapNotNull(this::clusterForOAuthProvider) - private val keepAliveTime = 7200 - private val keepAliveProbes = 9 - private val keepAliveInterval = 75 companion object { private val logger by logger() @@ -274,9 +271,9 @@ class EnvoyClustersFactory( ).toBuilder() .setUpstreamConnectionOptions(UpstreamConnectionOptions.newBuilder() .setTcpKeepalive(TcpKeepalive.newBuilder() - .setKeepaliveTime(UInt32Value.of(keepAliveTime)) - .setKeepaliveProbes(UInt32Value.of(keepAliveProbes)) - .setKeepaliveInterval(UInt32Value.of(keepAliveInterval)) + .setKeepaliveTime(UInt32Value.of(properties.egress.keepAliveTime)) + .setKeepaliveProbes(UInt32Value.of(properties.egress.keepAliveProbes)) + .setKeepaliveInterval(UInt32Value.of(properties.egress.keepAliveInterval)) .build()) .build()) .build()