Skip to content

Ansible playbooks to install/uninstall CRI-O for K3S isolation with Sysbox.

Notifications You must be signed in to change notification settings

Teachh/K3S-with-CRI-O

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CRI-O, Sysbox, and K3s Setup Playbooks

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

Prerequisites

  1. Target System: Ubuntu 23.04 (tested also in 22.04).
    • In case of using ubuntu 23 or above, you will need to create a new Dockerimage changing lines 263 709 from Daemonset and then change line 54 from this Manifest: roles/sysbox_uninstall/files/sysbox.yaml and roles/sysbox_install/files/sysbox.yaml
  2. Ansible Installed: Ensure Ansible is installed on your control node.
    • Installation command: sudo apt update && sudo apt install ansible
  3. User Permissions: The user running the playbooks must have sudo privileges on the target machine(s).
  4. 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 and roles/sysbox_uninstall/tasks/main.yaml

Playbooks

1. crio-install.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, and containernetworking-plugins.
  • Configures CRI-O for use with the K3s server.

2. crio-uninstall.yaml

This playbook removes CRI-O and all associated components from the target machine.

Key Tasks:

  • Uninstalls CRI-O, cri-o-runc, and containernetworking-plugins.
  • Cleans up configuration files and runtime data.

3. Sysbox Installation

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.

Usage

Remember to change your machines in inventory/host.ini Run the playbooks using the following commands:

Install CRI-O and Sysbox

ansible-playbook crio-install.yaml

About

Ansible playbooks to install/uninstall CRI-O for K3S isolation with Sysbox.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages