Skip to content

Commit

Permalink
Add scsi controller and write docs
Browse files Browse the repository at this point in the history
  • Loading branch information
mcbenjemaa committed Oct 23, 2024
1 parent c4aab42 commit 7c0308c
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 50 deletions.

This file was deleted.

37 changes: 35 additions & 2 deletions images/capi/packer/proxmox/README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,48 @@
## Custom Kubernetes version

To build an image using a specific version of Kubernetes use the "PACKER_FLAGS" env var like in the example below:

```
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
```


# ISO files
## ISO files

To use existing ISO files, set the `ISO_FILE` environment variable to the path of the ISO file.
For example, to use a local ISO file, set the `ISO_FILE` environment variable like this:

```
export ISO_FILE="local:iso/ubuntu-24.04.1-live-server-amd64.iso"
```

## 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
```
2 changes: 1 addition & 1 deletion images/capi/packer/proxmox/flatcar.json
Original file line number Diff line number Diff line change
@@ -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 --now<enter><wait>curl -sLo /tmp/ignition.json ",
"boot_command_suffix": "/proxmox-bootstrap-pass-auth.json<enter>sed -i \"s|BUILDERPASSWORDHASH|$(mkpasswd -5 {{user `ssh_password`}})|\" /tmp/ignition.json<enter>sudo flatcar-install -d /dev/sda -C {{user `channel_name`}} -V {{user `release_version`}} -i /tmp/ignition.json && sudo reboot<enter>",
"boot_command_suffix": "/bootstrap-pass-auth.json<enter>sed -i \"s|BUILDERPASSWORDHASH|$(mkpasswd -5 {{user `ssh_password`}})|\" /tmp/ignition.json<enter>sudo flatcar-install -d /dev/sda -C {{user `channel_name`}} -V {{user `release_version`}} -i /tmp/ignition.json && sudo reboot<enter>",
"boot_media_path": "http://{{ .HTTPIP }}:{{ .HTTPPort }}",
"boot_wait": "180s",
"build_name": "flatcar-{{env `FLATCAR_CHANNEL`}}-{{env `FLATCAR_VERSION`}}",
Expand Down
4 changes: 3 additions & 1 deletion images/capi/packer/proxmox/packer.json.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,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`}}",
Expand Down Expand Up @@ -215,6 +216,7 @@
"token": "{{env `PROXMOX_TOKEN`}}",
"username": "{{env `PROXMOX_USERNAME`}}",
"vlan_tag": "{{env `PROXMOX_VLAN`}}",
"vmid": ""
"vmid": "",
"scsi_controller": "virtio-scsi-pci"
}
}

0 comments on commit 7c0308c

Please sign in to comment.