Skip to content

Commit 468217b

Browse files
committed
add support for windows ci version
1 parent 5e7069a commit 468217b

8 files changed

+1461
-18
lines changed

templates/test/ci/cluster-template-prow-ci-version-windows.yaml

+1,380
Large diffs are not rendered by default.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
apiVersion: kustomize.config.k8s.io/v1beta1
2+
kind: Kustomization
3+
namespace: default
4+
resources:
5+
- ../prow-windows
6+
patchesStrategicMerge:
7+
- patches/windows-image-update.yaml
8+
- ../patches/control-plane-ci-version.yaml
9+
- ../patches/controller-manager.yaml
10+
- ../prow-ci-version/patches/machine-deployment-ci-version.yaml
11+
patchesJson6902:
12+
- target:
13+
group: bootstrap.cluster.x-k8s.io
14+
version: v1alpha4
15+
kind: KubeadmConfigTemplate
16+
name: ${CLUSTER_NAME}-md-win
17+
namespace: default
18+
path: patches/machine-deployment-ci-version.yaml
19+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
- op: add
2+
path: /spec/template/spec/files/-
3+
value:
4+
content: |
5+
Stop-Service kubelet -Force
6+
7+
$$CI_VERSION="${CI_VERSION}"
8+
if($$CI_VERSION -ne "")
9+
{
10+
$$binaries=@("kubeadm", "kubectl", "kubelet", "kube-proxy")
11+
$$ci_url="https://storage.googleapis.com/kubernetes-release-dev/ci/$$CI_VERSION/bin/windows/amd64"
12+
foreach ( $$binary in $$binaries )
13+
{
14+
echo "downloading binary: $$ci_url/$$binary.exe"
15+
curl.exe --retry 10 --retry-delay 5 "$$ci_url/$$binary.exe" --output "c:/k/$$binary.exe"
16+
}
17+
}
18+
19+
kubeadm.exe version -o=short
20+
kubectl.exe version --client=true --short=true
21+
kubelet.exe --version
22+
#kubeproxy.exe --version
23+
path: C:/replace-k8s-binaries.ps1
24+
permissions: "0744"
25+
- op: add
26+
path: /spec/template/spec/preKubeadmCommands/-
27+
value:
28+
powershell C:/replace-k8s-binaries.ps1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4
3+
kind: AzureMachineTemplate
4+
metadata:
5+
name: "${CLUSTER_NAME}-md-win"
6+
spec:
7+
template:
8+
spec:
9+
image:
10+
# we use the 1.18.13 image as a workaround there is no published marketplace image for k8s CI versions.
11+
# 1.18.13 binaries and images will get replaced to the desired version by the script above.
12+
marketplace:
13+
publisher: cncf-upstream
14+
offer: capi-windows
15+
sku: k8s-1dot18dot13-windows-2019
16+
version: "2020.12.11"

templates/test/dev/cluster-template-custom-builds-windows.yaml

+7-10
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ spec:
332332
spec:
333333
image:
334334
marketplace:
335-
offer: capi
335+
offer: capi-windows
336336
publisher: cncf-upstream
337337
sku: k8s-1dot18dot13-windows-2019
338338
version: 2020.12.11
@@ -375,22 +375,19 @@ spec:
375375
permissions: "0744"
376376
- content: |
377377
Stop-Service kubelet -Force
378-
Stop-Service kubeproxy -Force
379378
380-
$binaries=("kubeadm" "kubectl" "kubelet" "kube-proxy")
381-
foreach ( $binary in $binaries )
379+
$$binaries=@("kubeadm", "kubectl", "kubelet", "kube-proxy")
380+
$$ci_url="https://${AZURE_STORAGE_ACCOUNT}.blob.core.windows.net/${JOB_NAME}/${KUBE_GIT_VERSION}/bin/windows/amd64"
381+
foreach ( $$binary in $$binaries )
382382
{
383-
echo "* installing package: $binary ${KUBE_GIT_VERSION}"
384-
curl.exe --retry 10 --retry-delay 5 "https://${AZURE_STORAGE_ACCOUNT}.blob.core.windows.net/${JOB_NAME}/${KUBE_GIT_VERSION}/bin/windows/amd64/$${BINARY}.exe" --output "c:/k/$${BINARY}.exe"
383+
echo "installing package: $$binary ${KUBE_GIT_VERSION}"
384+
curl.exe --retry 10 --retry-delay 5 "$$ci_url/$$binary.exe" --output "c:/k/$$binary.exe"
385385
}
386386
387387
kubeadm.exe version -o=short
388388
kubectl.exe version --client=true --short=true
389389
kubelet.exe --version
390-
kubeproxy.exe --version
391-
392-
Start-Service kubelet -Force
393-
Start-Service kubeproxy -Force
390+
#kubeproxy.exe --version
394391
path: C:/replace-k8s-binaries.ps1
395392
permissions: "0744"
396393
joinConfiguration:

templates/test/dev/custom-builds-windows/patches/custom-builds-windows.yaml

+6-7
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,18 @@
44
content: |
55
Stop-Service kubelet -Force
66
7-
$binaries=("kubeadm" "kubectl" "kubelet" "kube-proxy")
8-
foreach ( $binary in $binaries )
7+
$$binaries=@("kubeadm", "kubectl", "kubelet", "kube-proxy")
8+
$$ci_url="https://${AZURE_STORAGE_ACCOUNT}.blob.core.windows.net/${JOB_NAME}/${KUBE_GIT_VERSION}/bin/windows/amd64"
9+
foreach ( $$binary in $$binaries )
910
{
10-
echo "* installing package: $binary ${KUBE_GIT_VERSION}"
11-
curl.exe --retry 10 --retry-delay 5 "https://${AZURE_STORAGE_ACCOUNT}.blob.core.windows.net/${JOB_NAME}/${KUBE_GIT_VERSION}/bin/windows/amd64/$${BINARY}.exe" --output "c:/k/$${BINARY}.exe"
11+
echo "installing package: $$binary ${KUBE_GIT_VERSION}"
12+
curl.exe --retry 10 --retry-delay 5 "$$ci_url/$$binary.exe" --output "c:/k/$$binary.exe"
1213
}
1314
1415
kubeadm.exe version -o=short
1516
kubectl.exe version --client=true --short=true
1617
kubelet.exe --version
17-
kubeproxy.exe --version
18-
19-
Start-Service kubelet -Force
18+
#kubeproxy.exe --version
2019
path: C:/replace-k8s-binaries.ps1
2120
permissions: "0744"
2221
- op: add

templates/test/dev/custom-builds-windows/patches/windows-image-update.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ spec:
1111
# 1.18.13 binaries and images will get replaced to the desired version by the script above.
1212
marketplace:
1313
publisher: cncf-upstream
14-
offer: capi
14+
offer: capi-windows
1515
sku: k8s-1dot18dot13-windows-2019
1616
version: "2020.12.11"

test/e2e/config/azure-dev.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,12 @@ providers:
7171
targetName: "cluster-template-private.yaml"
7272
- sourcePath: "${PWD}/templates/test/ci/cluster-template-prow-ci-version.yaml"
7373
targetName: "cluster-template-conformance-ci-artifacts.yaml"
74+
- sourcePath: "${PWD}/templates/test/ci/cluster-template-prow-ci-version-windows.yaml"
75+
targetName: "cluster-template-conformance-ci-artifacts-windows.yaml"
7476
- sourcePath: "${PWD}/templates/test/dev/cluster-template-custom-builds.yaml"
7577
targetName: "cluster-template-conformance-presubmit-artifacts.yaml"
78+
- sourcePath: "${PWD}/templates/test/dev/cluster-template-custom-builds-windows.yaml"
79+
targetName: "cluster-template-conformance-presubmit-artifacts-windows.yaml"
7680
- sourcePath: "${PWD}/templates/test/ci/cluster-template-prow-multi-tenancy.yaml"
7781
targetName: "cluster-template-multi-tenancy.yaml"
7882
- sourcePath: "${PWD}/templates/test/ci/cluster-template-prow-windows.yaml"

0 commit comments

Comments
 (0)