Skip to content

Commit

Permalink
add support for windows ci version
Browse files Browse the repository at this point in the history
  • Loading branch information
jsturtevant committed May 24, 2021
1 parent 50fa187 commit 05c3993
Show file tree
Hide file tree
Showing 8 changed files with 1,461 additions and 18 deletions.
1,380 changes: 1,380 additions & 0 deletions templates/test/ci/cluster-template-prow-ci-version-windows.yaml

Large diffs are not rendered by default.

19 changes: 19 additions & 0 deletions templates/test/ci/prow-ci-version-windows/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: default
resources:
- ../prow-windows
patchesStrategicMerge:
- patches/windows-image-update.yaml
- ../patches/control-plane-ci-version.yaml
- ../patches/controller-manager.yaml
- ../prow-ci-version/patches/machine-deployment-ci-version.yaml
patchesJson6902:
- target:
group: bootstrap.cluster.x-k8s.io
version: v1alpha4
kind: KubeadmConfigTemplate
name: ${CLUSTER_NAME}-md-win
namespace: default
path: patches/machine-deployment-ci-version.yaml

Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
- op: add
path: /spec/template/spec/files/-
value:
content: |
Stop-Service kubelet -Force
$$CI_VERSION="${CI_VERSION}"
if($$CI_VERSION -ne "")
{
$$binaries=@("kubeadm", "kubectl", "kubelet", "kube-proxy")
$$ci_url="https://storage.googleapis.com/kubernetes-release-dev/ci/$$CI_VERSION/bin/windows/amd64"
foreach ( $$binary in $$binaries )
{
echo "downloading binary: $$ci_url/$$binary.exe"
curl.exe --retry 10 --retry-delay 5 "$$ci_url/$$binary.exe" --output "c:/k/$$binary.exe"
}
}
kubeadm.exe version -o=short
kubectl.exe version --client=true --short=true
kubelet.exe --version
#kubeproxy.exe --version
path: C:/replace-k8s-binaries.ps1
permissions: "0744"
- op: add
path: /spec/template/spec/preKubeadmCommands/-
value:
powershell C:/replace-k8s-binaries.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4
kind: AzureMachineTemplate
metadata:
name: "${CLUSTER_NAME}-md-win"
spec:
template:
spec:
image:
# we use the 1.18.13 image as a workaround there is no published marketplace image for k8s CI versions.
# 1.18.13 binaries and images will get replaced to the desired version by the script above.
marketplace:
publisher: cncf-upstream
offer: capi-windows
sku: k8s-1dot18dot13-windows-2019
version: "2020.12.11"
17 changes: 7 additions & 10 deletions templates/test/dev/cluster-template-custom-builds-windows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ spec:
spec:
image:
marketplace:
offer: capi
offer: capi-windows
publisher: cncf-upstream
sku: k8s-1dot18dot13-windows-2019
version: 2020.12.11
Expand Down Expand Up @@ -375,22 +375,19 @@ spec:
permissions: "0744"
- content: |
Stop-Service kubelet -Force
Stop-Service kubeproxy -Force
$binaries=("kubeadm" "kubectl" "kubelet" "kube-proxy")
foreach ( $binary in $binaries )
$$binaries=@("kubeadm", "kubectl", "kubelet", "kube-proxy")
$$ci_url="https://${AZURE_STORAGE_ACCOUNT}.blob.core.windows.net/${JOB_NAME}/${KUBE_GIT_VERSION}/bin/windows/amd64"
foreach ( $$binary in $$binaries )
{
echo "* installing package: $binary ${KUBE_GIT_VERSION}"
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"
echo "installing package: $$binary ${KUBE_GIT_VERSION}"
curl.exe --retry 10 --retry-delay 5 "$$ci_url/$$binary.exe" --output "c:/k/$$binary.exe"
}
kubeadm.exe version -o=short
kubectl.exe version --client=true --short=true
kubelet.exe --version
kubeproxy.exe --version
Start-Service kubelet -Force
Start-Service kubeproxy -Force
#kubeproxy.exe --version
path: C:/replace-k8s-binaries.ps1
permissions: "0744"
joinConfiguration:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,18 @@
content: |
Stop-Service kubelet -Force
$binaries=("kubeadm" "kubectl" "kubelet" "kube-proxy")
foreach ( $binary in $binaries )
$$binaries=@("kubeadm", "kubectl", "kubelet", "kube-proxy")
$$ci_url="https://${AZURE_STORAGE_ACCOUNT}.blob.core.windows.net/${JOB_NAME}/${KUBE_GIT_VERSION}/bin/windows/amd64"
foreach ( $$binary in $$binaries )
{
echo "* installing package: $binary ${KUBE_GIT_VERSION}"
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"
echo "installing package: $$binary ${KUBE_GIT_VERSION}"
curl.exe --retry 10 --retry-delay 5 "$$ci_url/$$binary.exe" --output "c:/k/$$binary.exe"
}
kubeadm.exe version -o=short
kubectl.exe version --client=true --short=true
kubelet.exe --version
kubeproxy.exe --version
Start-Service kubelet -Force
#kubeproxy.exe --version
path: C:/replace-k8s-binaries.ps1
permissions: "0744"
- op: add
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ spec:
# 1.18.13 binaries and images will get replaced to the desired version by the script above.
marketplace:
publisher: cncf-upstream
offer: capi
offer: capi-windows
sku: k8s-1dot18dot13-windows-2019
version: "2020.12.11"
4 changes: 4 additions & 0 deletions test/e2e/config/azure-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,12 @@ providers:
targetName: "cluster-template-private.yaml"
- sourcePath: "${PWD}/templates/test/ci/cluster-template-prow-ci-version.yaml"
targetName: "cluster-template-conformance-ci-artifacts.yaml"
- sourcePath: "${PWD}/templates/test/ci/cluster-template-prow-ci-version-windows.yaml"
targetName: "cluster-template-conformance-ci-artifacts-windows.yaml"
- sourcePath: "${PWD}/templates/test/dev/cluster-template-custom-builds.yaml"
targetName: "cluster-template-conformance-presubmit-artifacts.yaml"
- sourcePath: "${PWD}/templates/test/dev/cluster-template-custom-builds-windows.yaml"
targetName: "cluster-template-conformance-presubmit-artifacts-windows.yaml"
- sourcePath: "${PWD}/templates/test/ci/cluster-template-prow-multi-tenancy.yaml"
targetName: "cluster-template-multi-tenancy.yaml"
- sourcePath: "${PWD}/templates/test/ci/cluster-template-prow-windows.yaml"
Expand Down

0 comments on commit 05c3993

Please sign in to comment.