Empezando con Fedora CoreOS

Introducción

Flujos

Hay tres flujos de actualización de Fedora CoreOS (FCOS) disponibles: stable, testing y next. En general, usted deseará usar stable, pero es recomendable ejecutar algunas máquinas sobre testing y next también y proporcionar comentarios.

Cada flujo tiene una URL canónica que representa su estado actual en formato JSON, conocidas como "metadatos de flujo". Por ejemplo, la URL de metadatos de flujos para stable es: https://builds.coreos.fedoraproject.org/streams/stable.json

For automating Fedora CoreOS installations, it is expected that you will interact with stream metadata. While Fedora CoreOS does automatic in-place updates, it is generally recommended to start provisioning new machines from the latest images.

Para más información sobre el uso de los metadatos de flujo, vea Metadatos de Flujo. Para más información sobre los flujos disponibles, vea Actualizar Flujos.

Filosofía de Aprovisionamiento

Fedora CoreOS no tiene un disco de instalación separado. En su lugar, cada instancia comienza a partir de una imagen de disco genérica que se personaliza en el primer arranque por medio de Ignition.

Cada plataforma tiene una lógica específica para recuperar y aplicar la primera configuración de arranque. Para despliegues en la nube, Ignition recopila la configuración a través de mecanismos de datos de usuario. En el caso de bare metal, Ignition puede recuperar su configuración desde el disco o desde una fuente remota.

Para más información sobre configuración, vea la documentación para Producir un Archivo Ignition.

Inicio Rápido

Arrancar sobre una MV en la nube (Ejemplo AWS)

New AWS instances can be directly created from the public FCOS images. You can find the latest AMI for each region from the download page.

If you are only interested in exploring FCOS without further customization, you can use a registered SSH key-pair for the default core user.

To test out FCOS this way you’ll need to run the aws ec2 run-instances command and provide some information to get the instance up and running. The following is an example command you can use:

Lanzando una nueva instancia
NAME='instance1'
SSHKEY='my-key'     # the name of your SSH key: `aws ec2 describe-key-pairs`
IMAGE='ami-xxx'     # the AMI ID found on the download page
DISK='20'           # the size of the hard disk
REGION='us-east-1'  # the target region
TYPE='m5.large'     # the instance type
SUBNET='subnet-xxx' # the subnet: `aws ec2 describe-subnets`
SECURITY_GROUPS='sg-xx' # the security group `aws ec2 describe-security-groups`
aws ec2 run-instances                     \
    --region $REGION                      \
    --image-id $IMAGE                     \
    --instance-type $TYPE                 \
    --key-name $SSHKEY                    \
    --subnet-id $SUBNET                   \
    --security-group-ids $SECURITY_GROUPS \
    --tag-specifications "ResourceType=instance,Tags=[{Key=Name,Value=${NAME}}]" \
    --block-device-mappings "VirtualName=/dev/xvda,DeviceName=/dev/xvda,Ebs={VolumeSize=${DISK}}"
You can find out the instance’s assigned IP by running aws ec2 describe-instances

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

Example connecting
ssh core@<ip address>

Un ejemplo más completo que permite la personalización se describe en Aprovisionando Fedora CoreOS en Servicios Web de Amazon.

Arrancar en un hipervisor local (ejemplo libvirt)

  1. Fetch the latest image suitable for the qemu platform using coreos-installer (or download and verify it from the web). You can use coreos-installer as a container, or on Fedora install it from the repos.

    STREAM="stable"
    # as an installed binary:
    coreos-installer download -s "${STREAM}" -p qemu -f qcow2.xz --decompress -C ~/.local/share/libvirt/images/
    # or as a container:
    podman run --pull=always --rm -v $HOME/.local/share/libvirt/images/:/data -w /data \
        quay.io/coreos/coreos-installer:release download -s "${STREAM}" -p qemu -f qcow2.xz --decompress
  2. Launch a new machine via virt-install, using the Ignition file with your customizations.

    IGNITION_CONFIG="/path/to/example.ign"
    IMAGE="/path/to/image.qcow2"
    VM_NAME="fcos-test-01"
    VCPUS="2"
    RAM_MB="2048"
    STREAM="stable"
    DISK_GB="10"
    # For x86 / aarch64,
    IGNITION_DEVICE_ARG=(--qemu-commandline="-fw_cfg name=opt/com.coreos/config,file=${IGNITION_CONFIG}")
    
    # For s390x / ppc64le,
    IGNITION_DEVICE_ARG=(--disk path="${IGNITION_CONFIG}",format=raw,readonly=on,serial=ignition,startup_policy=optional)
    
    # Setup the correct SELinux label to allow access to the config
    chcon --verbose --type svirt_home_t ${IGNITION_CONFIG}
    
    virt-install --connect="qemu:///system" --name="${VM_NAME}" --vcpus="${VCPUS}" --memory="${RAM_MB}" \
            --os-variant="fedora-coreos-$STREAM" --import --graphics=none \
            --disk="size=${DISK_GB},backing_store=${IMAGE}" \
            --network bridge=virbr0 "${IGNITION_DEVICE_ARG[@]}"
virt-install requires both the OS image and Ignition file to be specified as absolute paths.
Depending on your version of virt-install, you may not be able to use --os-variant=fedora-coreos-* and will get an error. In this case, you should pick an older Fedora variant (--os-variant=fedora31 for example). You can find the variants that are supported by you current version of virt-install with osinfo-query os | grep '^\s*fedora'.
DISK_GB should be at least as big as the default size of the image. For Fedora CoreOS, this is currently 10 GB.
Make sure that your user has access to /dev/kvm. The default is to allow access for everyone, but on some distributions you may need to add yourself to the kvm group.
You can escape out of the serial console by pressing CTRL + ].

Si ha establecido una clave SSH para el usuario core predeterminado, puede hacer SSH en la MV y explorar el SO:

ssh core@<ip address>

Explorar el SO

Una vez que la MV ha terminado de arrancar, sus direcciones IP aparecerán en la consola. Por diseño, no hay credenciales predeterminadas codificadas.

Si ha establecido una clave SSH para el usuario core predeterminado, puede hacer SSH en la MV y explorar el SO:

ssh core@<ip address>

Estar en contacto

Recomendamos que todos los usuarios se suscriban a la lista de correo de bajo volumen coreos-status para ver noticias operativas relacionadas con Fedora CoreOS.

Los errores pueden ser reportados a Fedora CoreOS Tracker.

Para cuestiones en directo, no dude en comunicarse con el canal #coreos:fedoraproject.org room on Matrix.

Para dudas y discusiones más largas relacionadas con Fedora CoreOS, están disponibles un foro y unahttps://lists.fedoraproject.org/archives/list/coreos@lists.fedoraproject.org/[lista de correo] .