Skip to content

Commit 5c32b4b

Browse files
committed
Windows GCE nodes: pull infra/pause container image during node setup
1 parent c14106a commit 5c32b4b

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

cluster/gce/windows/configure.ps1

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ try {
116116

117117
Create-DockerRegistryKey
118118
Configure-Dockerd
119+
Pull-InfraContainer
119120
DownloadAndInstall-KubernetesBinaries
120121
Create-NodePki
121122
Create-KubeletKubeconfig

cluster/gce/windows/k8s-node-setup.psm1

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
# - Document functions using proper syntax:
5252
# https://technet.microsoft.com/en-us/library/hh847834(v=wps.620).aspx
5353

54-
$INFRA_CONTAINER = "e2eteam/pause:3.1"
54+
$INFRA_CONTAINER = 'mcr.microsoft.com/k8s/core/pause:1.0.0'
5555
$GCE_METADATA_SERVER = "169.254.169.254"
5656
# The "management" interface is used by the kubelet and by Windows pods to talk
5757
# to the rest of the Kubernetes cluster *without NAT*. This interface does not
@@ -1038,6 +1038,23 @@ function Verify-WorkerServices {
10381038
Log_Todo "run more verification commands."
10391039
}
10401040

1041+
# Pulls the infra/pause container image onto the node so that it will be
1042+
# immediately available when the kubelet tries to run pods.
1043+
# TODO(pjh): downloading the container container image may take a few minutes;
1044+
# figure out how to run this in the background while perform the rest of the
1045+
# node startup steps!
1046+
function Pull-InfraContainer {
1047+
$name, $label = $INFRA_CONTAINER -split ':',2
1048+
if (-not ("$(& docker image list)" -match "$name.*$label")) {
1049+
& docker pull $INFRA_CONTAINER
1050+
if (!$?) {
1051+
throw "Error running 'docker pull $INFRA_CONTAINER'"
1052+
}
1053+
}
1054+
$inspect = "$(& docker inspect $INFRA_CONTAINER | Out-String)"
1055+
Log-Output "Infra/pause container:`n$inspect"
1056+
}
1057+
10411058
# Add a registry key for docker in EventLog so that log messages are mapped
10421059
# correctly. This is a workaround since the key is missing in the base image.
10431060
# https://github.com/MicrosoftDocs/Virtualization-Documentation/pull/503

0 commit comments

Comments
 (0)