diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index 0b31e0b6..84a08ace 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -13,4 +13,4 @@ jobs: python-version: 3.x - run: pip install mkdocs-material - run: pip install mkdocs-markdownextradata-plugin - - run: mkdocs gh-deploy --force + - run: mkdocs gh-deploy --force --strict diff --git a/docs/installation.md b/docs/installation.md new file mode 100644 index 00000000..29e62f3d --- /dev/null +++ b/docs/installation.md @@ -0,0 +1,127 @@ +# Installation + +## Building Images + +The design of RancherOS is that you boot from a vanilla image and through cloud-init and Kubernetes mechanisms +the node will be configured. Installation of RancherOS is really the process of building an image from which +you can boot. During the image building process you can bake in default OEM configuration that is a part of the +image. + +## Installation Configuration + +The installation process is driven by a config file. The configuration file contains the installation directives and +the OEM configuration for the image. + +The installation configuration should be hosted on an HTTP or TFTP server. A simple approach is to use a +[GitHub Gist](https://gist.github.com). + +### Kernel Command Line + +Install directives can be set from the kernel command line using a period (.) seperated key structure such as +`rancheros.install.configurl`. They kernel command line keys are case-insensitive. + +### Reference + +```yaml +#cloud-config +rancheros: + install: + # An http://, https://, or tftp:// URL to load and overlay on top of + # this configuration. This configuration can include any install + # directives or OEM configuration. The resulting merged configuration + # will be read by the installer and all content of the merged config will + # be stored in /oem/99_custom.yaml in the created image. + configURL: http://example.com/machine-cloud-config + # Turn on verbose logging for the installation process + debug: false + # The target device that will be formatted and grub will be install on. + # The partition table will be cleared and recreated with the default + # partition layout. If noFormat is set to true this parameter is only + # used to install grub. + device: /dev/vda + # If the system has the path /sys/firmware/efi it will be treated as a + # UEFI system. If you are created an UEFI image on a non-EFI platform + # then this flag will force the installer to use UEFI even if not detected. + forceEFI: false + # If true then it is assumed that the disk is already formatted with the standard + # partitions need by RancherOS. Refer to the partition table section below for the + # exact requirements. Also, if this is set to true + noFormat: false + # After installation the system will reboot by default. If you wish to instead + # power off the system set this to true. + powerOff: false + # The installed image will setup the default console to the current TTY value + # used during the installation. To force the installation to use a different TTY + # then set that value here. + tty: ttyS0 + +# Any other cloud-init values can be included in this file and will be stored in +# /oem/99_custom.yaml of the installed image +``` + +## ISO Installation + +When booting from the ISO you will immediately be presented with the shell. The root password is hard coded to `root/ros` +if needed. An SSH server will be running so realize that __because of the hard coded password this is an insecure +system__ to be running on a public network. + +From the shell run the below where `${LOCATION}` should be a path to a local file or `http://`, `https://`, or +`tftp://` URL. + +```bash +ros-installer -config-file ${LOCATION} +``` + +### Interactive + +`ros-installer` can also be ran without any arguments to allow you to install a simple vanilla image with a +root password set. + +## iPXE Installation + +Use the following script to install RancherOS using iPXE + +``` +#!ipxe +set config http://example.com/machine-cloud-confg +set version v0.0.1-test1 +set arch amd64 +set cmdline "sample.extra.cmdline.param=1" +chain https://github.com/rancher/os2/releases/download/${version}/rancheros-${version}-${arch}.ipxe +``` + +## Partition Table + +RancherOS requires the following partitions. These partitions are required by [cOS-toolkit](https://rancher-sandbox.github.io/cos-toolkit-docs/docs) + +| Label | Default Size | Contains | +| ---------------|-----------------|------------------------------------------------------------ | +| COS_BOOT | 50 MiB | UEFI Boot partition | +| COS_STATE | 15 GiB | A/B bootable file system images constructed from OCI images | +| COS_OEM | 50 MiB | OEM cloud-config files and other data | +| COS_RECOVERY | 8 GiB | Recovery file system image if COS_STATE is destroyed | +| COS_PERSISTENT | Remaining space | All contents of the persistent folders | + +## Folders + +| Path | Read-Only | Ephemeral | Persistence | +| ------------------|:---------:|:---------:|:-----------:| +| / | x | | | +| /etc | | x | | +| /etc/cni | | | x | +| /etc/iscsi | | | x | +| /etc/rancher | | | x | +| /etc/ssh | | | x | +| /etc/systemd | | | x | +| /srv | | x | | +| /home | | | x | +| /opt | | | x | +| /root | | | x | +| /var | | x | | +| /usr/libexec | | | x | +| /var/lib/cni | | | x | +| /var/lib/kubelet | | | x | +| /var/lib/longhorn | | | x | +| /var/lib/rancher | | | x | +| /var/lib/wicked | | | x | +| /var/log | | | x | diff --git a/mkdocs.yml b/mkdocs.yml index 1b7aeb65..c9722e8b 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -6,8 +6,6 @@ site_url: https://rancher.github.io/os2 repo_name: rancher/os2 repo_url: https://github.com/rancher/os2 edit_uri: https://github.com/rancher/os2/edit/main/docs/ -# Set to false for local docs development -strict: true theme: name: material @@ -46,6 +44,7 @@ markdown_extensions: nav: - index.md + - installation.md #- Installation: # - install/iso-install.md # - install/pxe-boot-install.md diff --git a/scripts/package b/scripts/package index 45587835..6b540e09 100755 --- a/scripts/package +++ b/scripts/package @@ -53,7 +53,7 @@ set url ${RELEASE_URL}/\${version} set kernel rancheros-${PXE_ASSET_VERSION}-kernel set initrd rancheros-${PXE_ASSET_VERSION}-initrd set rootfs rancheros-${PXE_ASSET_VERSION}.squashfs -kernel \${url}/\${kernel} initrd=\${initrd} ip=dhcp rd.cos.disable root=live:\${url}/\${rootfs} rancheros.install.automatic=true rancheros.install.config_url=\${config} console=tty1 console=ttyS0 +kernel \${url}/\${kernel} initrd=\${initrd} ip=dhcp rd.cos.disable root=live:\${url}/\${rootfs} rancheros.install.automatic=true rancheros.install.config_url=\${config} console=tty1 console=ttyS0 ${cmdline} initrd \${url}/\${initrd} boot EOF