mirror of https://github.com/k3s-io/k3s
Merge pull request #74549 from yujuhong/pause-image
GCE: switch to using e2eteam/pause:3.1 for pause containerspull/564/head
commit
3fb6e77770
|
@ -106,7 +106,6 @@ try {
|
|||
Download-HelperScripts
|
||||
|
||||
Create-DockerRegistryKey
|
||||
Create-PauseImage
|
||||
DownloadAndInstall-KubernetesBinaries
|
||||
Create-NodePki
|
||||
Create-KubeletKubeconfig
|
||||
|
|
|
@ -45,7 +45,7 @@
|
|||
# - Document functions using proper syntax:
|
||||
# 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"
|
||||
# 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
|
||||
|
@ -287,41 +287,6 @@ function Get_ContainerVersionLabel {
|
|||
"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
|
||||
# puts them in a subdirectory of $env:K8S_DIR.
|
||||
#
|
||||
|
|
Loading…
Reference in New Issue