mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-21 19:01:49 +00:00
Default to Windows Server version 1809 for Windows nodes.
Removes all references to 1803, including moving "win1803" directory to just "windows". A single Windows directory suffices for now, if necessary in the future we can shard it into directories for each Windows version. We've been running tests with Windows 1809 nodes for a couple days in our fork without major problems: https://testgrid.k8s.io/google-windows#windows-prototype&width=20. Testing on Azure is already using 1809: https://testgrid.k8s.io/sig-windows#Conformance%20acs-engine%20on%20Azure&width=20.
This commit is contained in:
parent
ec1d83b82d
commit
6d78f2b666
@ -65,7 +65,7 @@ MIG_WAIT_UNTIL_STABLE_TIMEOUT=${MIG_WAIT_UNTIL_STABLE_TIMEOUT:-1800}
|
||||
|
||||
MASTER_OS_DISTRIBUTION=${KUBE_MASTER_OS_DISTRIBUTION:-${KUBE_OS_DISTRIBUTION:-gci}}
|
||||
NODE_OS_DISTRIBUTION=${KUBE_NODE_OS_DISTRIBUTION:-${KUBE_OS_DISTRIBUTION:-gci}}
|
||||
WINDOWS_NODE_OS_DISTRIBUTION=${WINDOWS_NODE_OS_DISTRIBUTION:-win1803}
|
||||
WINDOWS_NODE_OS_DISTRIBUTION=${WINDOWS_NODE_OS_DISTRIBUTION:-win1809}
|
||||
|
||||
if [[ "${MASTER_OS_DISTRIBUTION}" == "cos" ]]; then
|
||||
MASTER_OS_DISTRIBUTION="gci"
|
||||
@ -478,4 +478,4 @@ fi
|
||||
|
||||
# Taint Windows nodes by default to prevent Linux workloads from being
|
||||
# scheduled onto them.
|
||||
WINDOWS_NODE_TAINTS="${WINDOWS_NODE_TAINTS:-node.kubernetes.io/os=windows:NoSchedule}"
|
||||
WINDOWS_NODE_TAINTS="${WINDOWS_NODE_TAINTS:-node.kubernetes.io/os=win1809:NoSchedule}"
|
||||
|
@ -68,7 +68,7 @@ MIG_WAIT_UNTIL_STABLE_TIMEOUT=${MIG_WAIT_UNTIL_STABLE_TIMEOUT:-1800}
|
||||
|
||||
MASTER_OS_DISTRIBUTION=${KUBE_MASTER_OS_DISTRIBUTION:-${KUBE_OS_DISTRIBUTION:-gci}}
|
||||
NODE_OS_DISTRIBUTION=${KUBE_NODE_OS_DISTRIBUTION:-${KUBE_OS_DISTRIBUTION:-gci}}
|
||||
WINDOWS_NODE_OS_DISTRIBUTION=${WINDOWS_NODE_OS_DISTRIBUTION:-win1803}
|
||||
WINDOWS_NODE_OS_DISTRIBUTION=${WINDOWS_NODE_OS_DISTRIBUTION:-win1809}
|
||||
|
||||
if [[ "${MASTER_OS_DISTRIBUTION}" == "cos" ]]; then
|
||||
MASTER_OS_DISTRIBUTION="gci"
|
||||
@ -498,4 +498,4 @@ fi
|
||||
|
||||
# Taint Windows nodes by default to prevent Linux workloads from being
|
||||
# scheduled onto them.
|
||||
WINDOWS_NODE_TAINTS="${WINDOWS_NODE_TAINTS:-node.kubernetes.io/os=windows:NoSchedule}"
|
||||
WINDOWS_NODE_TAINTS="${WINDOWS_NODE_TAINTS:-node.kubernetes.io/os=win1809:NoSchedule}"
|
||||
|
@ -32,7 +32,7 @@ else
|
||||
exit 1
|
||||
fi
|
||||
|
||||
source "${KUBE_ROOT}/cluster/gce/${WINDOWS_NODE_OS_DISTRIBUTION}/node-helper.sh"
|
||||
source "${KUBE_ROOT}/cluster/gce/windows/node-helper.sh"
|
||||
|
||||
if [[ "${MASTER_OS_DISTRIBUTION}" == "trusty" || "${MASTER_OS_DISTRIBUTION}" == "gci" || "${MASTER_OS_DISTRIBUTION}" == "ubuntu" ]]; then
|
||||
source "${KUBE_ROOT}/cluster/gce/${MASTER_OS_DISTRIBUTION}/master-helper.sh"
|
||||
@ -87,9 +87,7 @@ function set-linux-node-image() {
|
||||
# WINDOWS_NODE_IMAGE_PROJECT
|
||||
function set-windows-node-image() {
|
||||
WINDOWS_NODE_IMAGE_PROJECT="windows-cloud"
|
||||
if [[ "${WINDOWS_NODE_OS_DISTRIBUTION}" == "win1803" ]]; then
|
||||
WINDOWS_NODE_IMAGE_FAMILY="windows-1803-core-for-containers"
|
||||
elif [[ "${WINDOWS_NODE_OS_DISTRIBUTION}" == "win2019" ]]; then
|
||||
if [[ "${WINDOWS_NODE_OS_DISTRIBUTION}" == "win2019" ]]; then
|
||||
WINDOWS_NODE_IMAGE_FAMILY="windows-2019-core-for-containers"
|
||||
elif [[ "${WINDOWS_NODE_OS_DISTRIBUTION}" == "win1809" ]]; then
|
||||
WINDOWS_NODE_IMAGE_FAMILY="windows-1809-core-for-containers"
|
||||
|
@ -99,7 +99,7 @@ Invoke this script to run a smoke test that verifies that the cluster has been
|
||||
brought up correctly:
|
||||
|
||||
```
|
||||
cluster/gce/win1803/smoke-test.sh
|
||||
cluster/gce/windows/smoke-test.sh
|
||||
```
|
||||
|
||||
## Running tests against the cluster
|
@ -27,10 +27,10 @@
|
||||
[Net.ServicePointManager]::SecurityProtocol = `
|
||||
[Net.SecurityProtocolType]::Tls12
|
||||
Invoke-WebRequest `
|
||||
https://github.com/kubernetes/kubernetes/raw/windows-up/cluster/gce/win1803/k8s-node-setup.psm1 `
|
||||
https://github.com/kubernetes/kubernetes/raw/master/cluster/gce/windows/k8s-node-setup.psm1 `
|
||||
-OutFile C:\k8s-node-setup.psm1
|
||||
Invoke-WebRequest `
|
||||
https://github.com/kubernetes/kubernetes/raw/windows-up/cluster/gce/win1803/configure.ps1 `
|
||||
https://github.com/kubernetes/kubernetes/raw/master/cluster/gce/windows/configure.ps1 `
|
||||
-OutFile C:\configure.ps1
|
||||
Import-Module -Force C:\k8s-node-setup.psm1 # -Force to override existing
|
||||
# Execute functions manually or run configure.ps1.
|
||||
@ -111,8 +111,8 @@ function WaitFor_GceMetadataServerRouteToBeRemoved {
|
||||
|
||||
# Adds a route to the GCE metadata server to every network interface.
|
||||
function Add_GceMetadataServerRoute {
|
||||
# Before setting up HNS the 1803 VM has a "vEthernet (nat)" interface and a
|
||||
# "Ethernet" interface, and the route to the metadata server exists on the
|
||||
# Before setting up HNS the Windows VM has a "vEthernet (nat)" interface and
|
||||
# a "Ethernet" interface, and the route to the metadata server exists on the
|
||||
# Ethernet interface. After adding the HNS network a "vEthernet (Ethernet)"
|
||||
# interface is added, and it seems to subsume the routes of the "Ethernet"
|
||||
# interface (trying to add routes on the Ethernet interface at this point just
|
||||
@ -259,17 +259,14 @@ function Download-HelperScripts {
|
||||
}
|
||||
|
||||
# Takes the Windows version string from the cluster bash scripts (e.g.
|
||||
# 'win1803') and returns the correct label to use for containers on this
|
||||
# 'win1809') and returns the correct label to use for containers on this
|
||||
# version of Windows. Returns $null if $WinVersion is unknown.
|
||||
function Get_ContainerVersionLabel {
|
||||
param (
|
||||
[parameter(Mandatory=$true)] [string]$WinVersion
|
||||
)
|
||||
# -match does regular expression matching.
|
||||
if ($WinVersion -match '1803') {
|
||||
return '1803'
|
||||
}
|
||||
elseif ($WinVersion -match '1809') {
|
||||
if ($WinVersion -match '1809') {
|
||||
return '1809'
|
||||
}
|
||||
elseif ($WinVersion -match '2019') {
|
||||
@ -281,8 +278,16 @@ function Get_ContainerVersionLabel {
|
||||
|
||||
# Builds the pause image with name $INFRA_CONTAINER.
|
||||
function Create-PauseImage {
|
||||
$version_label = Get_ContainerVersionLabel `
|
||||
$(Get-InstanceMetadataValue 'win-version')
|
||||
$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
|
||||
@ -290,7 +295,7 @@ function Create-PauseImage {
|
||||
New-Item -Force -ItemType file $dockerfile | Out-Null
|
||||
Set-Content `
|
||||
$dockerfile `
|
||||
("FROM microsoft/nanoserver:${version_label}`n`n" +
|
||||
("FROM mcr.microsoft.com/windows/nanoserver:${version_label}`n`n" +
|
||||
"CMD cmd /c ping -t localhost > nul")
|
||||
}
|
||||
|
||||
@ -300,6 +305,10 @@ function Create-PauseImage {
|
||||
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
|
@ -24,10 +24,10 @@ function get-windows-node-instance-metadata-from-file {
|
||||
# To get startup script output run "gcloud compute instances
|
||||
# get-serial-port-output <instance>" from the location where you're running
|
||||
# kube-up.
|
||||
metadata+="windows-startup-script-ps1=${KUBE_ROOT}/cluster/gce/${WINDOWS_NODE_OS_DISTRIBUTION}/configure.ps1,"
|
||||
metadata+="common-psm1=${KUBE_ROOT}/cluster/gce/${WINDOWS_NODE_OS_DISTRIBUTION}/common.psm1,"
|
||||
metadata+="k8s-node-setup-psm1=${KUBE_ROOT}/cluster/gce/${WINDOWS_NODE_OS_DISTRIBUTION}/k8s-node-setup.psm1,"
|
||||
metadata+="user-profile-psm1=${KUBE_ROOT}/cluster/gce/${WINDOWS_NODE_OS_DISTRIBUTION}/user-profile.psm1,"
|
||||
metadata+="windows-startup-script-ps1=${KUBE_ROOT}/cluster/gce/windows/configure.ps1,"
|
||||
metadata+="common-psm1=${KUBE_ROOT}/cluster/gce/windows/common.psm1,"
|
||||
metadata+="k8s-node-setup-psm1=${KUBE_ROOT}/cluster/gce/windows/k8s-node-setup.psm1,"
|
||||
metadata+="user-profile-psm1=${KUBE_ROOT}/cluster/gce/windows/user-profile.psm1,"
|
||||
metadata+="${NODE_EXTRA_METADATA}"
|
||||
echo "${metadata}"
|
||||
}
|
Loading…
Reference in New Issue
Block a user