Merge pull request #93765 from jeremyje/restartsd

Configure StackdriverLogging Windows service to restart on failure.
This commit is contained in:
Kubernetes Prow Robot 2020-11-12 23:26:23 -08:00 committed by GitHub
commit 84d15ca322
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1180,7 +1180,7 @@ function Start-WorkerServices {
"--cluster-cidr=$(${kube_env}['CLUSTER_IP_RANGE'])", "--cluster-cidr=$(${kube_env}['CLUSTER_IP_RANGE'])",
"--hostname-override=${instance_name}" "--hostname-override=${instance_name}"
) )
$kubeproxy_args = ${default_kubeproxy_args} + ${kubeproxy_args} $kubeproxy_args = ${default_kubeproxy_args} + ${kubeproxy_args}
Log-Output "Final kubeproxy_args: ${kubeproxy_args}" Log-Output "Final kubeproxy_args: ${kubeproxy_args}"
@ -1626,7 +1626,7 @@ function Install-LoggingAgent {
Log-Output ("Skip: Fluentbit logging agent is already installed") Log-Output ("Skip: Fluentbit logging agent is already installed")
return return
} }
DownloadAndInstall-LoggingAgents DownloadAndInstall-LoggingAgents
Create-LoggingAgentServices Create-LoggingAgentServices
} }
@ -1699,7 +1699,7 @@ $FLUENTBIT_CONFIG = @'
Log_File /var/log/fluentbit.log Log_File /var/log/fluentbit.log
Daemon off Daemon off
Parsers_File parsers.conf Parsers_File parsers.conf
HTTP_Server off HTTP_Server off
HTTP_Listen 0.0.0.0 HTTP_Listen 0.0.0.0
HTTP_PORT 2020 HTTP_PORT 2020
plugins_file plugins.conf plugins_file plugins.conf
@ -1753,7 +1753,7 @@ $FLUENTBIT_CONFIG = @'
# Channels Setup,Windows PowerShell # Channels Setup,Windows PowerShell
Channels application,system,security Channels application,system,security
Tag winevent.raw Tag winevent.raw
DB winlog.sqlite # DB winlog.sqlite #
# Json Log Example: # Json Log Example:
@ -1767,9 +1767,9 @@ $FLUENTBIT_CONFIG = @'
Mem_Buf_Limit 5MB Mem_Buf_Limit 5MB
Skip_Long_Lines On Skip_Long_Lines On
Refresh_Interval 5 Refresh_Interval 5
DB flb_kube.db DB flb_kube.db
# Settings from fluentd missing here. # Settings from fluentd missing here.
# tag reform.* # tag reform.*
# format json # format json
# time_key time # time_key time
@ -2037,6 +2037,11 @@ function Configure-StackdriverAgent {
$config = $FLUENTD_CONFIG.replace('NODE_NAME', (hostname)) $config = $FLUENTD_CONFIG.replace('NODE_NAME', (hostname))
$config | Out-File -FilePath $fluentd_config_file -Encoding ASCII $config | Out-File -FilePath $fluentd_config_file -Encoding ASCII
Log-Output "Wrote fluentd logging config to $fluentd_config_file" Log-Output "Wrote fluentd logging config to $fluentd_config_file"
# Configure StackdriverLogging to automatically restart on failure after 10
# seconds. The logging agent may die die to various disruptions but can be
# resumed.
sc.exe failure StackdriverLogging reset= 0 actions= restart/1000/restart/10000
} }
# The NODE_NAME placeholder must be replaced with the node's name (hostname). # The NODE_NAME placeholder must be replaced with the node's name (hostname).