Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

decoupling using K8s ci binaries and different versions of containerd for ci windows templates #2335

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 20 additions & 12 deletions templates/test/ci/cluster-template-prow-ci-version.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions templates/test/ci/cluster-template-prow.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
- op: add
path: /spec/template/spec/files/-
value:
content: |
$ErrorActionPreference = 'Stop'

$$CONTAINERD_URL="${WINDOWS_CONTAINERD_URL}"
if($$CONTAINERD_URL -ne ""){
# Kubelet service depends on contianerd service so make a best effort attempt to stop it
Stop-Service kubelet -Force -ErrorAction SilentlyContinue
Stop-Service containerd -Force
echo "downloading containerd: $$CONTAINERD_URL"
curl.exe --retry 10 --retry-delay 5 -L "$$CONTAINERD_URL" --output "c:/k/containerd.tar.gz"
tar.exe -zxvf c:/k/containerd.tar.gz -C "c:/Program Files/containerd" --strip-components 1

Start-Service containerd
}

containerd.exe --version
containerd-shim-runhcs-v1.exe --version
path: C:/replace-containerd.ps1
permissions: "0744"
- op: add
path: /spec/template/spec/preKubeadmCommands/-
value:
powershell C:/replace-containerd.ps1
2 changes: 1 addition & 1 deletion templates/test/ci/prow-ci-version/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ patches:
kind: KubeadmConfigTemplate
name: .*-md-win
namespace: default
path: patches/kubeadm-bootstrap-windows.yaml
path: patches/kubeadm-bootstrap-windows-k8s-ci-binaries.yaml
- target:
group: controlplane.cluster.x-k8s.io
version: v1beta1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,6 @@
}
}

$$CONTAINERD_URL="${WINDOWS_CONTAINERD_URL}"
if($$CONTAINERD_URL -ne ""){
Stop-Service containerd -Force
echo "downloading containerd: $$CONTAINERD_URL"
curl.exe --retry 10 --retry-delay 5 -L "$$CONTAINERD_URL" --output "c:/k/containerd.tar.gz"
tar.exe -zxvf c:/k/containerd.tar.gz -C "c:/Program Files/containerd" --strip-components 1

Start-Service containerd
}

# Tag it to the ci version. The image knows how to use the copy locally with the configmap
# that is applied at at this stage (windows-kubeproxy-ci.yaml)
ctr.exe -n k8s.io images pull docker.io/sigwindowstools/kube-proxy:v1.23.1-calico-hostprocess
Expand All @@ -37,8 +27,6 @@
kubectl.exe version --client=true --short=true
kubelet.exe --version
kube-proxy.exe --version
containerd.exe --version
containerd-shim-runhcs-v1.exe --version
path: C:/replace-ci-binaries.ps1
permissions: "0744"
- op: add
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ patches:
kind: KubeadmConfig
name: .*-mp-win
namespace: default
path: patches/kubeadm-bootstrap-windows.yaml
path: patches/kubeadm-bootstrap-windows-k8s-ci-binaries.yaml
configMapGenerator:
- name: cni-${CLUSTER_NAME}-calico
behavior: merge
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
path: /spec/files/-
value:
content: |
$ErrorActionPreference = 'Stop'

Stop-Service kubelet -Force

$$CI_VERSION="${CI_VERSION}"
Expand Down
7 changes: 7 additions & 0 deletions templates/test/ci/prow/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,13 @@ patches:
name: .*-md-win
namespace: default
path: ../patches/windows-tmp-folder.yaml
- target:
group: bootstrap.cluster.x-k8s.io
version: v1beta1
kind: KubeadmConfigTemplate
name: .*-md-win
namespace: default
path: ../patches/kubeadm-bootstrap-windows-containerd.yaml
configMapGenerator:
- name: cni-${CLUSTER_NAME}-calico
files:
Expand Down
37 changes: 25 additions & 12 deletions templates/test/dev/cluster-template-custom-builds.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion templates/test/dev/custom-builds/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ patches:
kind: KubeadmConfigTemplate
name: .*-md-win
namespace: default
path: patches/kubeadm-bootstrap-windows.yaml
path: ../../ci/prow-ci-version/patches/kubeadm-bootstrap-windows-k8s-ci-binaries.yaml
configMapGenerator:
- name: cni-${CLUSTER_NAME}-calico
behavior: merge
Expand Down
Loading