mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-22 19:31:44 +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
|
$kube_env = Fetch-KubeEnv
|
||||||
Set-EnvironmentVars
|
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
|
# Install Docker if the select CRI is not containerd and docker is not already
|
||||||
# installed.
|
# installed.
|
||||||
if (${env:CONTAINER_RUNTIME} -ne "containerd") {
|
if (${env:CONTAINER_RUNTIME} -ne "containerd") {
|
||||||
|
@ -1438,6 +1438,25 @@ function Configure_Dockerd {
|
|||||||
Restart-Service Docker
|
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.
|
# Writes a CNI config file under $env:CNI_CONFIG_DIR for containerd.
|
||||||
#
|
#
|
||||||
# Prerequisites:
|
# Prerequisites:
|
||||||
|
Loading…
Reference in New Issue
Block a user