Fornitura di Fedora CoreOS su Vultr

Questa guida mostra come fornire nuovi nodi Fedora CoreOS (FCOS) su Vultr. Vultr pubblica immagini FCOS, ma sono obsolete, quindi non consigliamo di utilizzare le immagini standard di Vultr. Invece, è possibile caricare una versione attuale di FCOS come immagine personalizzata.

Prerequisiti

Prima di configurare una macchina FCOS, è necessario avere un file di configurazione Ignition con le proprie personalizzazioni. Se non ne hai uno, consulta Produzione di un File Ignition.

Fedora CoreOS dispone di un utente predefinito core che può essere utilizzato per esplorare il sistema operativo. Se desideri utilizzarlo, completa la sua configurazione fornendo, ad esempio, una chiave SSH.

If you do not want to use Ignition to get started, you can make use of the Afterburn support.

You also need to have access to a Vultr account. The examples below use the vultr-cli and s3cmd command-line tools. Both of these tools are available in Fedora and can be installed via sudo dnf install vultr-cli s3cmd.

Using a custom snapshot

Vultr supports creating custom snapshots from public raw images.

These steps show how to download a FCOS image and upload it to an existing storage bucket, in order to create a snapshot from that.

See Vultr documentation for further details on how to create a bucket and configure s3cmd to use it.

Creating a snapshot

Fedora CoreOS comes in three streams, with different update schedules per stream. These steps show the stable stream as an example, but can be used for other streams too.

  1. Scarica l’immagine più recente adatta al tuo flusso target (oppure [scaricala e verificane l’autenticità](https://fedoraproject.org/coreos/download/) dal web).

    STREAM='stable'
    coreos-installer download -s $STREAM -p vultr -f raw.xz --decompress
  2. Use s3cmd to upload the raw image to your bucket, and note its public URL.

    BUCKET='my-bucket'
    FCOS_VERSION='...'
    s3cmd put --acl-public "fedora-coreos-${FCOS_VERSION}-vultr.x86_64.raw" "s3://${BUCKET}/"
  3. Create the snapshot from your object URL, and note its ID.

    IMAGE_URL='https://...'
    VULTR_API_KEY='<token>'
    vultr-cli snapshot create-url -u "${IMAGE_URL}"
You’ll need to wait for the snapshot to finish processing before using it. Monitor with vultr-cli snapshot list.

Launching an instance from a snapshot

You can now create a FCOS Vultr instance using the snapshot ID above.

This example creates a 2 vCPU, 4GB RAM instance named instance1 in the New Jersey region. Use vultr-cli regions list and vultr-cli plans list for other options.

NAME='instance1'
SNAPSHOT_ID='...'
REGION='ewr'
PLAN='vc2-2c-4gb'
vultr-cli instance create --region "${REGION}" --plan "${PLAN}" \
  --snapshot "${SNAPSHOT_ID}" --label "${NAME}" --host "${NAME}" \
  --userdata "$(cat example.ign)"
While the Vultr documentation mentions cloud-init and scripts, FCOS does not support cloud-init or the ability to run scripts from user-data. It accepts only Ignition configuration files.
You can find out the instance’s assigned IP by running vultr-cli instance list.

You now should be able to SSH into the instance using the associated IP address.

Example connecting
ssh core@<ip address>