mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-22 03:11:40 +00:00
GCE Windows: Set TCP/IP parameters to keep idle connections alive on GCE.
This commit is contained in:
parent
ce8b7afc8a
commit
7839668877
@ -129,6 +129,9 @@ try {
|
||||
$kube_env = Fetch-KubeEnv
|
||||
Set-EnvironmentVars
|
||||
|
||||
# Set the TCP/IP Parameters to keep idle connections alive.
|
||||
Set-WindowsTCPParameters
|
||||
|
||||
# Install Docker if the select CRI is not containerd and docker is not already
|
||||
# installed.
|
||||
if (${env:CONTAINER_RUNTIME} -ne "containerd") {
|
||||
|
@ -1438,6 +1438,25 @@ function Configure_Dockerd {
|
||||
Restart-Service Docker
|
||||
}
|
||||
|
||||
# Configures the TCP/IP parameters to be in sync with the GCP recommendation.
|
||||
# Not setting these values correctly can cause network issues for connections
|
||||
# that live longer than 10 minutes.
|
||||
# See: https://cloud.google.com/compute/docs/troubleshooting/general-tips#idle-connections
|
||||
function Set-WindowsTCPParameters {
|
||||
Set-ItemProperty -Force -Confirm:$false -Path `
|
||||
'HKLM:\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters' `
|
||||
-Name 'KeepAliveInterval' -Type Dword -Value 1000
|
||||
Set-ItemProperty -Force -Confirm:$false `
|
||||
-Path 'HKLM:\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters' `
|
||||
-Name 'KeepAliveTime' -Type Dword -Value 60000
|
||||
Set-ItemProperty -Force -Confirm:$false `
|
||||
-Path 'HKLM:\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters' `
|
||||
-Name 'TcpMaxDataRetransmissions' -Type Dword -Value 10
|
||||
|
||||
Log-Output 'TCP/IP Parameters'
|
||||
Get-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters'
|
||||
}
|
||||
|
||||
# Writes a CNI config file under $env:CNI_CONFIG_DIR for containerd.
|
||||
#
|
||||
# Prerequisites:
|
||||
|
Loading…
Reference in New Issue
Block a user