.. _kubernetes:
Kubernetes\*
############
This tutorial describes how to install, configure, and start the `Kubernetes
container orchestration system`_ on |CL-ATTR|.
A Kubernetes cluster can be setup on |CL| using the |CL| cloud-native-setup
scripts to automate the process or can be setup through a manual step-by-step
process. This tutorial covers both scenarios.
.. contents::
:local:
:depth: 1
Background
***********
|CL| has builtin integrations to make setting up Kubernetes using a variety of
`container runtimes
`_.
For more background information see:
* `What is Kubernetes?`_
* `What is a Container Network Interface (CNI)?`_
* `What is a Container Runtime Interface (CRI)?`_
* `What is CRI+O?`_
* `What is containerd?`_
* `What is Docker?`_
* `What is Kata Containers\*?`_
Prerequisites
*************
This tutorial assumes you have already installed |CL|. For detailed
instructions on installing |CL| on a bare metal system, follow the :ref:`bare
metal installation tutorial`.
#. Review and make sure the `requirements for kubeadm
`_
are satisfied for the host system.
#. Before you continue, update your |CL| installation with the following
command:
.. code-block:: bash
sudo swupd update
Learn about the benefits of having an up-to-date system for cloud
orchestration on the :ref:`swupd-guide` page.
#. Kubernetes, a set of supported :abbr:`CRI (Container Runtime Interface)`
runtimes, :abbr:`CNI (Container Network Interface)` and `cloud-native-setup
scripts`_ are included in the `cloud-native-basic`_ bundle. Install the
cloud-native-basic bundle to get these components:
.. code-block:: bash
sudo swupd bundle-add cloud-native-basic
Set up Kubernetes automatically
*******************************
|CL| provides `cloud-native-setup scripts`_ to automate system setup and
Kubernetes cluster initialization which allows you to get a cluster up and
running quickly.
.. note::
By default, the scripts will update |CL| to the latest version, set up the
system as a Kubernetes master-node with **canal for container networking**
and **crio for container runtime**, and taint the master node to allow
workloads to run on it. Kata is installed as an optional alternative
runtime. The script can be configured to use other CNI's and CRI's by
following the directions on the `README
`_.
See `What is a Container Network Interface (CNI)?`_ and `What is a
Container Runtime Interface (CRI)?`_ for more information.
.. important::
If network proxy settings are required for Internet connectivity, configure
them now because the scripts will propagate proxy configuration based on
the running configuration. It is especially important to set the
:command:`no_proxy` variable appropriately for Kubernetes.
The script will also modify the :file:`/etc/environment` and
:file:`/etc/profile.d/proxy.sh` files, if they exist, with the proxy
environment variables in the running shell when the script is executed.
See the `Setting proxy servers for Kubernetes`_ section for details.
#. Run the :file:`system-setup.sh` script to configure the |CL| system
settings.
.. code-block:: bash
sudo /usr/share/clr-k8s-examples/setup_system.sh
#. Stop docker and containerd to avoid conflicting CRIs being detected. The
scripts use CRIO for the CRI.
.. code-block:: bash
sudo systemctl stop docker
sudo systemctl stop containerd
#. Install git as it's a dependency of the :file:`create_stack.sh`.
.. code-block:: bash
sudo swupd bundle-add git
#. Run the :file:`create_stack.sh` script to initialize the Kubernetes node
and setup a container network plugin.
.. code-block:: bash
sudo /usr/share/clr-k8s-examples/create_stack.sh minimal
#. Follow the output on the screen and continue onto the section on `using
your cluster