This repository contains Ansible playbooks for managing a Kubernetes environment on Ubuntu 23.04. These playbooks install CRI-O as the container runtime, set up Sysbox for enhanced environment isolation, and configure a K3s server to use CRI-O.
Created from this issue: nestybox/sysbox#841
- Target System: Ubuntu 23.04 (tested also in 22.04).
- Ansible Installed: Ensure Ansible is installed on your control node.
- Installation command:
sudo apt update && sudo apt install ansible
- Installation command:
- User Permissions: The user running the playbooks must have
sudo
privileges on the target machine(s). - K3s Installed: K3s Agent must already be installed. In case of K3s master installation, uncomment lines 1-8 and comment lines 10-18 from
roles/sysbox_install/tasks/main.yaml
androles/sysbox_uninstall/tasks/main.yaml
This playbook installs CRI-O on the target Ubuntu machine and configures it as the container runtime.
Key Tasks:
- Adds the CRI-O repository for Ubuntu 23.04.
- Installs CRI-O,
cri-o-runc
, andcontainernetworking-plugins
. - Configures CRI-O for use with the K3s server.
This playbook removes CRI-O and all associated components from the target machine.
Key Tasks:
- Uninstalls CRI-O,
cri-o-runc
, andcontainernetworking-plugins
. - Cleans up configuration files and runtime data.
The setup includes installing Sysbox for enhanced container isolation and improved security in Kubernetes environments.
Key Tasks:
- Installs Sysbox on the target machine.
- Configures Sysbox as an alternative runtime for sandboxed workloads.
Remember to change your machines in inventory/host.ini
Run the playbooks using the following commands:
ansible-playbook crio-install.yaml