Skip to content

capi: allow Ubuntu autoinstall mirror overrides - #2072

Open
MaxRink wants to merge 2 commits into
kubernetes-sigs:mainfrom
MaxRink:tcaas/ubuntu-autoinstall-mirror-vars
Open

capi: allow Ubuntu autoinstall mirror overrides#2072
MaxRink wants to merge 2 commits into
kubernetes-sigs:mainfrom
MaxRink:tcaas/ubuntu-autoinstall-mirror-vars

Conversation

@MaxRink

@MaxRink MaxRink commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

What this does

Ubuntu autoinstall user-data templates for QEMU, MAAS, and Proxmox currently hard-code the archive mirror used by the installer. This wires the existing ubuntu_repo and ubuntu_security_repo variables into those rendered templates so users can point the installer at a local mirror/cache before Ansible runs.

The defaults still come from packer/config/common.json, and callers can override them through PACKER_FLAGS, PACKER_VAR_FILES, UBUNTU_REPO, or UBUNTU_SECURITY_REPO.

Validation

  • bash -n images/capi/hack/set-ssh-password.sh
  • shellcheck -S warning images/capi/hack/set-ssh-password.sh
  • git diff --check
  • rendered QEMU, MAAS, and Proxmox Ubuntu 24.04 user-data with custom ubuntu_repo / ubuntu_security_repo values
  • make validate-qemu-ubuntu-2404 PACKER_FLAGS="--var 'ubuntu_repo=http://mirror.example.com/ubuntu' --var 'ubuntu_security_repo=http://security.example.com/ubuntu'"
  • make validate-qemu-ubuntu-2404-efi PACKER_FLAGS="--var 'ubuntu_repo=http://mirror.example.com/ubuntu' --var 'ubuntu_security_repo=http://security.example.com/ubuntu'"
  • make validate-maas-ubuntu-2404-efi PACKER_FLAGS="--var 'ubuntu_repo=http://mirror.example.com/ubuntu' --var 'ubuntu_security_repo=http://security.example.com/ubuntu'"

I also ran make validate-proxmox-ubuntu-2404 with the same mirror flags. It rendered the template and reached Packer validation, then stopped on the expected local Proxmox provider inputs being unset (proxmox_url, node, credentials, storage pools, bridge, and ISO pool).

@kubernetes-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign averagemarcus for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubernetes-prow
kubernetes-prow Bot requested review from AndiDog and vasartori June 26, 2026 02:49
@kubernetes-prow kubernetes-prow Bot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jun 26, 2026
@MaxRink
MaxRink force-pushed the tcaas/ubuntu-autoinstall-mirror-vars branch from 3a82447 to 55dcf5a Compare June 27, 2026 19:27
@MaxRink

MaxRink commented Jun 28, 2026

Copy link
Copy Markdown
Contributor Author

/test pull-azure-sigs

I inspected the failed pull-azure-sigs run. The branch does not touch Azure CI or Azure packer files; the ubuntu-2404 target failed immediately because Packer could not see an Azure CLI default subscription after init-sig.sh had already created the resource group/gallery. I opened #2086 to isolate Azure CLI auth per parallel SIG build, since the current CI script shares one Azure CLI config across all background builds.

@MaxRink
MaxRink force-pushed the tcaas/ubuntu-autoinstall-mirror-vars branch 4 times, most recently from 8de0a89 to 212b127 Compare July 7, 2026 04:22
@MaxRink
MaxRink force-pushed the tcaas/ubuntu-autoinstall-mirror-vars branch 2 times, most recently from 9bf6f67 to 155cf3d Compare July 7, 2026 23:00

@drew-viles drew-viles left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor note

Comment thread images/capi/hack/set-ssh-password.sh
@mboersma

Copy link
Copy Markdown
Contributor

/test pull-ova-all

@MaxRink
MaxRink force-pushed the tcaas/ubuntu-autoinstall-mirror-vars branch from 155cf3d to 1696113 Compare July 17, 2026 16:15
@drew-viles

Copy link
Copy Markdown
Contributor

/retest

@mboersma

Copy link
Copy Markdown
Contributor

/label tide/merge-method-squash

@kubernetes-prow kubernetes-prow Bot added tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Jul 19, 2026
@MaxRink
MaxRink force-pushed the tcaas/ubuntu-autoinstall-mirror-vars branch from 1696113 to facb61e Compare July 28, 2026 16:06
@kubernetes-prow kubernetes-prow Bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 28, 2026
@MaxRink
MaxRink force-pushed the tcaas/ubuntu-autoinstall-mirror-vars branch from facb61e to 2a14e85 Compare August 9, 2026 14:46
@MaxRink
MaxRink force-pushed the tcaas/ubuntu-autoinstall-mirror-vars branch from 2a14e85 to aa608f1 Compare August 14, 2026 17:55
@MaxRink

MaxRink commented Aug 20, 2026

Copy link
Copy Markdown
Contributor Author

/test pull-ova-all

Signed-off-by: Maximilian Rink <maximilian.rink@telekom.de>
set-ssh-password.sh only loaded common.json, PACKER_VAR_FILES, and
PACKER_FLAGS when resolving ubuntu_repo/ubuntu_security_repo, so it
missed overrides set in the target-specific var-file that the
Makefile passes to Packer as the primary -var-file (e.g.
build-maas-ubuntu-2404-arm64 -> packer/maas/maas-ubuntu-2404-arm64.json,
which points both repos at ports.ubuntu.com). This caused the
rendered autoinstall data to use a different mirror than what Packer
actually builds with.

Record each qemu/qemu-kubevirt/maas/maas-arm64/proxmox build and
validate target's primary var-file in PACKER_TARGET_VAR_FILE and have
the renderer load it right after common.json (still overridable by
PACKER_VAR_FILES/PACKER_FLAGS), so the rendered data matches what
Packer will use for that target.

Signed-off-by: Maximilian Rink <maximilian.rink@telekom.de>
@MaxRink
MaxRink force-pushed the tcaas/ubuntu-autoinstall-mirror-vars branch from aa608f1 to 1059357 Compare August 22, 2026 14:08

@mboersma mboersma left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we rework the rendering so it is target-specific and follows the exact Packer variable precedence? The shared phony prerequisite currently runs only once, so aggregate or parallel builds can render every template using the wrong target’s mirrors. PACKER_FLAGS ordering can also disagree with Packer.

Please include the active 24.04 immutable template and avoid printing or retaining credential-bearing mirror URLs outside the selected build.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants