From c84eb123573095c5bb51729cfa1d530e5190f715 Mon Sep 17 00:00:00 2001 From: Yang Lu Date: Thu, 11 Jun 2020 05:10:26 -0700 Subject: [PATCH] Flush cache to disk to persist setup status --- cluster/gce/windows/configure.ps1 | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cluster/gce/windows/configure.ps1 b/cluster/gce/windows/configure.ps1 index 8a556590ae3..af24ff9395d 100644 --- a/cluster/gce/windows/configure.ps1 +++ b/cluster/gce/windows/configure.ps1 @@ -152,6 +152,9 @@ try { Configure-LoggingAgent Restart-LoggingAgent } + # Flush cache to disk before starting kubelet & kube-proxy services + # to make metadata server route and stackdriver service more persistent. + Write-Volumecache C -PassThru Start-WorkerServices Log-Output 'Waiting 15 seconds for node to join cluster.' Start-Sleep 15 @@ -162,6 +165,8 @@ try { Schedule-LogRotation -Pattern '.*\.log$' -Path ${env:LOGS_DIR} -RepetitionInterval $(New-Timespan -Hour 1) -Config $config Pull-InfraContainer + # Flush cache to disk to persist the setup status + Write-Volumecache C -PassThru } catch { Write-Host 'Exception caught in script:'