Skip to content
Switch branches/tags
Go to file
fixes #4599

Signed-off-by: Tim Hughes <>
8 contributors

Users who have contributed to this file

@haircommander @timhughes @saschagrunert @mkumatag @markusthoemmes @thanos1983 @cortopy @kubealex

Running CRI-O with kubeadm

This tutorial assumes you've already installed and setup CRI-O. If you have not, start here. It also assumes you've set up your system to use kubeadm. If you haven't done so, here is a good tutorial

Configuring CNI

You'll need to use your plugins to figure out your pod-network-cidr. If you use the default bridge plugin defined here, set CIDR= If you're using a flannel network, set CIDR=

Configuring Kubelet

To configure the Kubelet, you can use the yq tool, as is shown below. You can also manually configure a kubeadm configuration.

Run the following stript, passing the location you'd like the kubeadm configuration to be as the first argument:

set -euo pipefail                                                                                                                                                                                                                             
echo "Printing to $KUBEADM_CONFIG"                                                                                                                                                                                                                   
if [ -d "$KUBEADM_CONFIG" ]; then                                                                                                                                                                                                                    
    echo "$KUBEADM_CONFIG is a directory!"                                                                                                                                                                                                           
    exit 1                                                                                                                                                                                                                                    
if [ ! -d $(dirname "$KUBEADM_CONFIG") ]; then                                                                                                                                                                                                       
    echo "please create directory $(dirname $KUBEADM_CONFIG)"                                                                                                                                                                                        
    exit 1                                                                                                                                                                                                                                    
if [ ! $(which yq) ]; then                                                                                                                                                                                                                    
    echo "please install yq"                                                                                                                                                                                                                  
    exit 1                                                                                                                                                                                                                                    
if [ ! $(which kubeadm) ]; then                                                                                                                                                                                                               
    echo "please install kubeadm"                                                                                                                                                                                                             
    exit 1                                                                                                                                                                                                                                    
kubeadm config print init-defaults --component-configs=KubeletConfiguration > "$KUBEADM_CONFIG"                                                                                                                                                      
yq -i eval 'select(.nodeRegistration.criSocket) |= .nodeRegistration.criSocket = "unix:///var/run/crio/crio.sock"' "$KUBEADM_CONFIG"
yq -i eval 'select(di == 1) |= .cgroupDriver = "systemd"' "$KUBEADM_CONFIG"

This will create a kubeadm configuration file that kubeadm will use to configure the Kubelet to be able to communicate with CRI-O.

Note: This file assumes you've set the cgroup_driver in your CRI-O configuration as systemd, which is the default value.

Running kubeadm

Given you've set CIDR, and you've properly created your kubeadm configuration file, all you need to do is start crio (as defined here), and run: kubeadm init --pod-network-cidr=$CIDR --config=$KUBEADM_CONFIG

Running kubeadm in an off line network

We will assume that the user has installed CRI-O and all necessary packages. We will also assume that all necessary components are configured and everything is working as expected. The user should have a private repo where the container images are pushed. An example of container images for Kubernetes version 1.18.2:

$ kubeadm config images list --image-repository user.private.repo --kubernetes-version=v1.18.2

The user needs to configure the registries.conf file.

Sample of configurations:

$ cat /etc/containers/registries.conf
unqualified-search-registries = ["user.private.repo"]

prefix = ""
insecure = false
blocked = false
location = ""

location = "user.private.repo"

Next the user should reload and restart the CRI-O service to load the configurations.