go-faster / portoshim

CRI plugin for Porto container runtime
Other
0 stars 0 forks source link

Portoshim

Portoshim is a CRI (Container Runtime Interface) plugin for Porto container management system.

Portoshim allows Porto daemon to communicate with kubelet, so Porto can be used as Kubernetes container runtime. Portoshim is written on Go programming language.

Porto and other container runtimes

Quick start

Dependencies

Install Porto container runtime and Go programming language (at least v1.17). Run Porto after installation.

Build

Download Portoshim project from github.com:

git clone https://github.com/ten-nancy/portoshim.git
cd portoshim

Build binary files using make and install them:

make
sudo make install

Run

Execute Portoshim binary file (in background optionaly):

sudo portoshim &

or

sudo portoshim --debug & # add debug logs

The following socket has to appear after all actions /run/portoshim.sock.

You can use crictl to check portoshim is running:

crictl --runtime-endpoint="unix:///run/portoshim.sock" ps

Also you can write the following config to /etc/crictl.yaml and do not specify endpoint flags:

runtime-endpoint: unix:///run/portoshim.sock

Kubernetes over Porto

You should specify two kubelet flags to use Kubernetes with Porto:

--container-runtime="remote"
--container-runtime-endpoint="unix:///run/portoshim.sock"

Kubelet uses Portoshim as a CRI service and sends CRI gRPC request to it. In turn Portoshim converts СRI request from kubelet to Porto request and forward it to Porto. Porto performs request. So Portoshim works as proxy between kubelet and Porto.

Configuration file

Usage

You can override default values of Portoshim invariants of run or add information about your custom registries using configuration file. Default path of configuration file is /etc/portoshim.yaml. You also can set own path using --config flag:

sudo portoshim --config <config path>

Fields description

Portoshim configuration file is a YAML file. It has following fields:

Example

The example of simple Portoshim configuration file:

Portoshim:
    LogsDir: /var/log/portoshim
Images:
    Registries:
    - Host: registry-1.docker.io
      AuthPath: https://auth.docker.io/token
      AuthService: registry.docker.io