Illumina Innovates with Rancher and Kubernetes
RancherOS basically uses the standard Linux kernel, but we maintain a kernel config ourselves. Due to various feature support and security fixes, we are constantly updating the kernel version.
We build the kernel for RancherOS at the os-kernel repository. You can use this repository to help package your own custom kernel to be used in RancherOS.
Create a clone of the os-kernel repository to your local machine using git clone.
git clone
$ git clone https://github.com/rancher/os-kernel.git
If you want to build kernel v4.14.53, you can refer to the following command. After the build is completed, a ./dist/kernel directory will be created with the freshly built kernel tarball and headers.
./dist/kernel
$ git tag v4.14.53-rancher $ KERNEL_TAG=4.14.53 make release ...snip... ./dist/kernel/extra-linux-4.14.53-rancher-x86.tar.gz ./dist/kernel/build-linux-4.14.53-rancher-x86.tar.gz ./dist/kernel/linux-4.14.53-rancher-x86.tar.gz ./dist/kernel/config ...snip... Images ready to push: rancher/os-extras:4.14.53-rancher rancher/os-headers:4.14.53-rancher
For some users who need a custom kernel, the following information is very useful to you:
modules.list
modules-extra.list
config/kernel-config
patches
os-kernel
Now you need to either upload the ./dist/kernel/linux-4.14.53-rancher-x86.tar.gz file to somewhere, or copy that file into your clone of the rancher/os repo, as assets/kernel.tar.gz.
./dist/kernel/linux-4.14.53-rancher-x86.tar.gz
rancher/os
assets/kernel.tar.gz
The build-<name>.tar.gz and extra-<name>.tar.gz files are used to build the rancher/os-extras and rancher/os-headers images for your RancherOS release - which you will need to tag them with a different organisation name, push them to a registry, and create custom service.yml files.
build-<name>.tar.gz
extra-<name>.tar.gz
rancher/os-extras
rancher/os-headers
Your kernel should be packaged and published as a set of files of the following format:
<kernel-name-and-version>.tar.gz is the one KERNEL_URL in rancher/os should point to. It contains the kernel binary, core modules and firmware.
<kernel-name-and-version>.tar.gz
build-<kernel-name-and-version>.tar.gz contains build headers to build additional modules: it is a subset of the kernel sources tarball. These files will be installed into /usr/src/<os-kernel-tag> using the kernel-headers-system-docker and kernel-headers services.
build-<kernel-name-and-version>.tar.gz
/usr/src/<os-kernel-tag>
kernel-headers-system-docker
kernel-headers
extra-<kernel-name-and-version>.tar.gz contains extra modules and firmware for your kernel and should be built into a kernel-extras service.
extra-<kernel-name-and-version>.tar.gz
kernel-extras
By default, RancherOS ships with the kernel provided by the os-kernel repository. Swapping out the default kernel can by done by building your own custom RancherOS ISO.
Create a clone of the main RancherOS repository to your local machine with a git clone.
$ git clone https://github.com/rancher/os.git
In the root of the repository, the “General Configuration” section of Dockerfile.dapper will need to be updated. Using your favorite editor, replace the appropriate KERNEL_URL value with a URL of your compiled custom kernel tarball. Ideally, the URL will use HTTPS.
Dockerfile.dapper
KERNEL_URL
HTTPS
# Update the URL to your own custom kernel tarball ARG KERNEL_VERSION_amd64=4.14.63-rancher ARG KERNEL_URL_amd64=https://link/xxxx
After you’ve replaced the URL with your custom kernel, you can follow the steps in building your own custom RancherOS ISO.
Note: KERNEL_URL settings should point to a Linux kernel, compiled and packaged in a specific way. You can fork os-kernel repository to package your own kernel.