diff --git a/images/capi/packer/files/flatcar/ignition/proxmox-bootstrap-pass-auth.json b/images/capi/packer/files/flatcar/ignition/proxmox-bootstrap-pass-auth.json deleted file mode 100644 index 8e09b18a1c..0000000000 --- a/images/capi/packer/files/flatcar/ignition/proxmox-bootstrap-pass-auth.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "ignition": { - "config": {}, - "security": { - "tls": {} - }, - "timeouts": {}, - "version": "2.3.0" - }, - "networkd": {}, - "passwd": { - "users": [ - { - "groups": [ - "wheel", - "sudo", - "docker" - ], - "name": "builder", - "passwordHash": "BUILDERPASSWORDHASH" - } - ] - }, - "storage": {}, - "systemd": { - "units": [ - { - "enable": true, - "name": "docker.service" - }, - { - "mask": true, - "name": "update-engine.service" - }, - { - "mask": true, - "name": "locksmithd.service" - }, - { - "name": "flatcar-openstack-hostname.service", - "enabled": false, - "mask": true - } - ] - } -} diff --git a/images/capi/packer/proxmox/README.md b/images/capi/packer/proxmox/README.md index e04c1ea70f..76d37ca6e8 100644 --- a/images/capi/packer/proxmox/README.md +++ b/images/capi/packer/proxmox/README.md @@ -3,3 +3,35 @@ To build an image using a specific version of Kubernetes use the "PACKER_FLAGS" ``` PACKER_FLAGS="--var 'kubernetes_rpm_version=1.28.3' --var 'kubernetes_semver=v1.28.3' --var 'kubernetes_series=v1.28' --var 'kubernetes_deb_version=1.28.3-1.1'" make build-proxmox-ubuntu-2204 ``` + +#### Flatcar for Proxmox + +Currently, Proxmox doesn't support ignition and it's currently in-development. +* https://github.com/coreos/fedora-coreos-tracker/issues/1652 +* https://github.com/flatcar/scripts/pull/1783 + +But we do a trick to make it working on Proxmox, until the support is already released. + +We use OEM_ID `nutanix` which is an openstack provider that loads ignition from device with label `config-2`: +https://github.com/coreos/ignition/blob/main/internal/providers/nutanix/nutanix.go#L51 + +Therefore, we build an image with `OEM_ID=nutanix` so that we can provide an ISO that contain the ignition file in `/openstack/latest/user_data` +https://github.com/coreos/ignition/blob/main/internal/providers/nutanix/nutanix.go#L40C29-L40C56 + +**To build a Proxmox template for flatcar** + +```shell +export PROXMOX_URL="https://example.net:8006/api2/json" +export PROXMOX_USERNAME='root@pam!proxmox' +export PROXMOX_TOKEN="xxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxxxxx" +export PROXMOX_NODE="pve1" +export PROXMOX_ISO_POOL="local" +export PROXMOX_BRIDGE="vmbr1" +export PROXMOX_STORAGE_POOL="ceph_pool" + +## flatcar version +export FLATCAR_VERSION=4081.1.0 +export FLATCAR_CHANNEL=beta + +export OEM_ID=nutanix # make sure to choose OEM_ID=nutanix +``` diff --git a/images/capi/packer/proxmox/flatcar.json b/images/capi/packer/proxmox/flatcar.json index 4f91f16ac8..64bd2df5ff 100644 --- a/images/capi/packer/proxmox/flatcar.json +++ b/images/capi/packer/proxmox/flatcar.json @@ -1,7 +1,7 @@ { "ansible_extra_vars": "ansible_python_interpreter=/opt/bin/python oem_id={{user `oem_id`}}", "boot_command_prefix": "sudo systemctl mask sshd.socket --nowcurl -sLo /tmp/ignition.json ", - "boot_command_suffix": "/proxmox-bootstrap-pass-auth.jsonsed -i \"s|BUILDERPASSWORDHASH|$(mkpasswd -5 {{user `ssh_password`}})|\" /tmp/ignition.jsonsudo flatcar-install -d /dev/sda -C {{user `channel_name`}} -V {{user `release_version`}} -i /tmp/ignition.json && sudo reboot", + "boot_command_suffix": "/bootstrap-pass-auth.jsonsed -i \"s|BUILDERPASSWORDHASH|$(mkpasswd -5 {{user `ssh_password`}})|\" /tmp/ignition.jsonsudo flatcar-install -d /dev/sda -C {{user `channel_name`}} -V {{user `release_version`}} -i /tmp/ignition.json && sudo reboot", "boot_media_path": "http://{{ .HTTPIP }}:{{ .HTTPPort }}", "boot_wait": "180s", "build_name": "flatcar-{{env `FLATCAR_CHANNEL`}}-{{env `FLATCAR_VERSION`}}", diff --git a/images/capi/packer/proxmox/packer.json b/images/capi/packer/proxmox/packer.json index c9db2ab7b9..cb2be76697 100644 --- a/images/capi/packer/proxmox/packer.json +++ b/images/capi/packer/proxmox/packer.json @@ -18,6 +18,7 @@ "type": "scsi" } ], + "scsi_controller": "{{user `scsi_controller`}}", "http_directory": "{{user `http_directory`}}", "insecure_skip_tls_verify": true, "iso_checksum": "{{user `iso_checksum_type`}}:{{user `iso_checksum`}}", @@ -205,6 +206,7 @@ "token": "{{env `PROXMOX_TOKEN`}}", "username": "{{env `PROXMOX_USERNAME`}}", "vlan_tag": "{{env `PROXMOX_VLAN`}}", - "vmid": "" + "vmid": "", + "scsi_controller": "virtio-scsi-pci" } }