Merge pull request #74549 from yujuhong/pause-image

GCE: switch to using e2eteam/pause:3.1 for pause containers
pull/564/head
Kubernetes Prow Robot 2019-02-25 23:12:00 -08:00 committed by GitHub
commit 3fb6e77770
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 37 deletions

View File

@ -106,7 +106,6 @@ try {
Download-HelperScripts Download-HelperScripts
Create-DockerRegistryKey Create-DockerRegistryKey
Create-PauseImage
DownloadAndInstall-KubernetesBinaries DownloadAndInstall-KubernetesBinaries
Create-NodePki Create-NodePki
Create-KubeletKubeconfig Create-KubeletKubeconfig

View File

@ -45,7 +45,7 @@
# - Document functions using proper syntax: # - Document functions using proper syntax:
# https://technet.microsoft.com/en-us/library/hh847834(v=wps.620).aspx # https://technet.microsoft.com/en-us/library/hh847834(v=wps.620).aspx
$INFRA_CONTAINER = "kubeletwin/pause" $INFRA_CONTAINER = "e2eteam/pause:3.1"
$GCE_METADATA_SERVER = "169.254.169.254" $GCE_METADATA_SERVER = "169.254.169.254"
# The "management" interface is used by the kubelet and by Windows pods to talk # The "management" interface is used by the kubelet and by Windows pods to talk
# to the rest of the Kubernetes cluster *without NAT*. This interface does not # to the rest of the Kubernetes cluster *without NAT*. This interface does not
@ -287,41 +287,6 @@ function Get_ContainerVersionLabel {
"version label") "version label")
} }
# Builds the pause image with name $INFRA_CONTAINER.
function Create-PauseImage {
$win_version = $(Get-InstanceMetadataValue 'win-version')
if ($win_version -match '2019') {
# TODO(pjh): update this function to properly support 2019 vs. 1809 vs.
# future Windows versions. For example, Windows Server 2019 does not
# support the nanoserver container
# (https://blogs.technet.microsoft.com/virtualization/2018/11/13/windows-server-2019-now-available/).
Log_NotImplemented "Need to update Create-PauseImage for WS2019"
}
$version_label = Get_ContainerVersionLabel $win_version
$pause_dir = "${env:K8S_DIR}\pauseimage"
$dockerfile = "$pause_dir\Dockerfile"
mkdir -Force $pause_dir
if (ShouldWrite-File $dockerfile) {
New-Item -Force -ItemType file $dockerfile | Out-Null
Set-Content `
$dockerfile `
("FROM mcr.microsoft.com/windows/nanoserver:${version_label}`n`n" +
"CMD cmd /c ping -t localhost > nul")
}
if (($(docker images -a) -like "*${INFRA_CONTAINER}*") -and
(-not $REDO_STEPS)) {
Log-Output "Skip: ${INFRA_CONTAINER} already built"
return
}
docker build -t ${INFRA_CONTAINER} $pause_dir
if ($LastExitCode -ne 0) {
Log-Output -Fatal `
"docker build -t ${INFRA_CONTAINER} $pause_dir failed"
}
}
# Downloads the Kubernetes binaries from kube-env's NODE_BINARY_TAR_URL and # Downloads the Kubernetes binaries from kube-env's NODE_BINARY_TAR_URL and
# puts them in a subdirectory of $env:K8S_DIR. # puts them in a subdirectory of $env:K8S_DIR.
# #