capi: install CNI plugins from upstream tarballs by default - #2098
capi: install CNI plugins from upstream tarballs by default#2098MaxRink wants to merge 7 commits into
Conversation
|
Skipping CI for Draft Pull Request. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
drew-viles
left a comment
There was a problem hiding this comment.
Looks good. It's a heck of a jump on the CNI version but I am also using the latest on mine so I think it's something that's just fallen behind. Unless there is a reason it's currently locked to that of which I am unaware.
I'll prod @mboersma as a follow up to confirm my thinking.
/ok-to-test
|
@drew-viles As far as i can see 1.2.0 never was the effective version that ended up in an Image. Ive updated the PR description above to indicate the actual versions that ended up on images |
|
#2106 would be a port of how we handle this downstream |
b00846d to
b236b38
Compare
|
Really nice work, the One thing to work through before this lands, since it changes every provider's default image. The default is
Ordering is safe, the tarball always wins. Should we document this explicitly, or scope the http-CNI default to the http-Kubernetes path where kubelet isn't a package? |
b236b38 to
f55871d
Compare
8901632 to
3a824dd
Compare
|
/retest |
|
/label tide/merge-method-squash |
892b274 to
223264d
Compare
e128aa5 to
1760bb7
Compare
…lidate CNI source type Address review feedback on the CNI tarball default PR: - Move kubernetes-cni package installation (repo setup + package install) into cni-pkg.yml so it runs whenever kubernetes_cni_source_type == "pkg", independent of kubernetes_source_type. Previously the CNI package install tasks lived inside debian.yml/redhat.yml/azurelinux.yml/photon.yml, which are only imported when kubernetes_source_type == "pkg", so setting kubernetes_source_type=http with kubernetes_cni_source_type=pkg silently skipped CNI installation and failed validation. - Add an early assert task that kubernetes_cni_source_type is one of "http" or "pkg" before the CNI import tasks run, so an unsupported/typo'd value (e.g. "htpp") fails the build clearly instead of silently matching neither branch and skipping CNI installation and validation entirely.
The kubernetes-cni package install task moved into cni-pkg.yml when CNI package installation was decoupled from kubernetes_source_type. The existing kubernetes/tasks/photon.yml no-changed-when ignore entry covers the same tdnf install pattern but doesn't apply to the new file path, so pull-lint failed on the moved task.
…path Address review feedback from mboersma: on the default kubernetes_source_type=pkg path, kubelet's own package dependency still pulls in the distro kubernetes-cni package, which the http CNI tarball install (kubernetes_cni_source_type=http, the new default) then overlays. The tarball always wins on disk, so image behavior is unaffected, but dpkg --verify/rpm -V will flag the plugin binaries as modified since the package metadata no longer matches. Document this explicitly rather than changing default behavior.
The CNI package install task moves from debian.yml to cni-pkg.yml in this pull request. This commit gives it the apt lock retry loop from kubernetes-sigs#2130 and kubernetes-sigs#2136.
092d40a to
b4367db
Compare
mboersma
left a comment
There was a problem hiding this comment.
Could we finish separating Kubernetes and CNI installation before merging? url.yml still installs the CNI tarball whenever Kubernetes uses HTTP, so http/http installs it twice and http/pkg overlays a package installation on top of tarball files. Please remove the CNI work from url.yml and install it only through cni-url.yml or cni-pkg.yml.
It would also be good to validate both source-type variables before installation starts, explicitly reject package CNI on Flatcar, make the HTTP Goss checks independent of the CNI source, and retain the existing download retries.
Change description
Switch the default CNI plugin install path from Kubernetes
kubernetes-cnipackages to upstreamcontainernetworking/pluginsrelease tarballs.The package-based Kubernetes paths still install
kubelet,kubeadm, andkubectlfrom distro packages, but CNI plugins now use the existing HTTP/tarball source by default. The CNI tarball tasks are split out from the Kubernetes binary URL tasks so they can be used with package-based Kubernetes installs. The legacykubernetes_cni_source_type=pkgpath still installs thekubernetes-cnipackage when explicitly selected.Related issues
Notes
kubernetes_cni_semveris updated tov1.9.1, which matches the currentcontainernetworking/pluginsrelease and the Kubernetesrelease-1.36CNI package metadata. The oldv1.2.0value was only the lower-bound dependency declared by kubelet, not the effective package version installed from recentpkgs.k8s.iominor repositories.Effective
kubernetes-cnipackage versions from the current minor repositories:Validation run locally:
ansible-lint --profile min images/capi/ansible/roles/kubernetespython3 -m py_compile images/capi/hack/generate-goss-specs.pypython3 images/capi/hack/generate-goss-specs.py --provider amazon --os ubuntu --dry-runkubernetes_cni_source_type=httpand verified the generated checks assert executable CNI plugin binaries plus the active/opt/cni/bin/host-deviceversionkubernetes_cni_source_type=pkgand verified the generated checks assert thekubernetes-cnipackage, executable CNI plugin binaries, and package ownership of the installed plugin binariesmake -C images/capi validate-qemu-ubuntu-2404 PACKER_FLAGS=-syntax-onlymake -C images/capi validate-qemu-ubuntu-2404 PACKER_FLAGS="-syntax-only --var 'kubernetes_cni_source_type=pkg'"packer validate -syntax-onlyfor qemu Ubuntu 24.04, qemu Flatcar, and Proxmox Ubuntu 24.04 templates with the common node var filescontainernetworking/pluginshasv1.9.1tarballs and checksums forlinux-amd64andlinux-arm64pkgs.k8s.ioDEB/RPM metadata for v1.32 through v1.36 Kubernetes minor repositories