Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
f7a6b0a8
Unverified
Commit
f7a6b0a8
authored
Feb 21, 2019
by
Kubernetes Prow Robot
Committed by
GitHub
Feb 21, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #74103 from pjh/gce-windows-cluster-1809
Default to Windows Server version 1809 for Windows nodes.
parents
105c9c35
6d78f2b6
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
32 additions
and
25 deletions
+32
-25
config-default.sh
cluster/gce/config-default.sh
+2
-2
config-test.sh
cluster/gce/config-test.sh
+2
-2
util.sh
cluster/gce/util.sh
+2
-4
OWNERS
cluster/gce/windows/OWNERS
+0
-0
README-GCE-Windows-kube-up.md
cluster/gce/windows/README-GCE-Windows-kube-up.md
+1
-1
common.psm1
cluster/gce/windows/common.psm1
+0
-0
configure.ps1
cluster/gce/windows/configure.ps1
+0
-0
k8s-node-setup.psm1
cluster/gce/windows/k8s-node-setup.psm1
+21
-12
node-helper.sh
cluster/gce/windows/node-helper.sh
+4
-4
smoke-test.sh
cluster/gce/windows/smoke-test.sh
+0
-0
user-profile.psm1
cluster/gce/windows/user-profile.psm1
+0
-0
No files found.
cluster/gce/config-default.sh
View file @
f7a6b0a8
...
...
@@ -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
:-
win180
3
}
WINDOWS_NODE_OS_DISTRIBUTION
=
${
WINDOWS_NODE_OS_DISTRIBUTION
:-
win180
9
}
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=win
dows
:NoSchedule
}
"
WINDOWS_NODE_TAINTS
=
"
${
WINDOWS_NODE_TAINTS
:-
node
.kubernetes.io/os=win
1809
:NoSchedule
}
"
cluster/gce/config-test.sh
View file @
f7a6b0a8
...
...
@@ -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
:-
win180
3
}
WINDOWS_NODE_OS_DISTRIBUTION
=
${
WINDOWS_NODE_OS_DISTRIBUTION
:-
win180
9
}
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=win
dows
:NoSchedule
}
"
WINDOWS_NODE_TAINTS
=
"
${
WINDOWS_NODE_TAINTS
:-
node
.kubernetes.io/os=win
1809
:NoSchedule
}
"
cluster/gce/util.sh
View file @
f7a6b0a8
...
...
@@ -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"
...
...
cluster/gce/win
1803
/OWNERS
→
cluster/gce/win
dows
/OWNERS
View file @
f7a6b0a8
File moved
cluster/gce/win
1803
/README-GCE-Windows-kube-up.md
→
cluster/gce/win
dows
/README-GCE-Windows-kube-up.md
View file @
f7a6b0a8
...
...
@@ -99,7 +99,7 @@ Invoke this script to run a smoke test that verifies that the cluster has been
brought up correctly:
```
cluster/gce/win
1803
/smoke-test.sh
cluster/gce/win
dows
/smoke-test.sh
```
## Running tests against the cluster
...
...
cluster/gce/win
1803
/common.psm1
→
cluster/gce/win
dows
/common.psm1
View file @
f7a6b0a8
File moved
cluster/gce/win
1803
/configure.ps1
→
cluster/gce/win
dows
/configure.ps1
View file @
f7a6b0a8
File moved
cluster/gce/win
1803
/k8s-node-setup.psm1
→
cluster/gce/win
dows
/k8s-node-setup.psm1
View file @
f7a6b0a8
...
...
@@ -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.
# 'win180
3
') and returns the correct label to use for containers on this
# 'win180
9
') 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 m
icrosoft
/nanoserver:
${
version_label
}
`n`n
"
+
(
"FROM m
cr.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
...
...
cluster/gce/win
1803
/node-helper.sh
→
cluster/gce/win
dows
/node-helper.sh
View file @
f7a6b0a8
...
...
@@ -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
}
"
}
...
...
cluster/gce/win
1803
/smoke-test.sh
→
cluster/gce/win
dows
/smoke-test.sh
View file @
f7a6b0a8
File moved
cluster/gce/win
1803
/user-profile.psm1
→
cluster/gce/win
dows
/user-profile.psm1
View file @
f7a6b0a8
File moved
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment