「CRI-O」の版間の差分

提供: ArchWiki
ナビゲーションに移動 検索に移動
(英語版より転載)
 
(一部飜訳)
 
(同じ利用者による、間の1版が非表示)
1行目: 1行目:
[[Category:Virtualization]]
+
[[Category:仮想化]]
  +
CRI-O は、[[Kubernetes]] Container RuntimeInterface の [[Wikipedia:Open_Container_Initiative|OCI]] ベースの実装です。
CRI-O is an [[Wikipedia:Open_Container_Initiative|OCI]]-based implementation of the [[Kubernetes]] Container Runtime Interface.
 
   
  +
そのため、Kubernetes クラスタのノードで使用できるコンテナランタイムの 1 つです。
As such it is one of the container runtimes that can be used with a node of a Kubernetes cluster.
 
   
== Installation ==
+
== インストール ==
   
  +
{{pkg|cri-o}} パッケージを[[インストール]]します。
[[Install]] the {{pkg|cri-o}} package.
 
   
The package will set the system up to load the {{ic|overlay}} and {{ic|br_netfilter}} modules and set the following [[sysctl]] options:
+
このパッケージは、{{ic|overlay}} {{ic|br_netfilter}} モジュールをロードするようにシステムをセットアップし、以下の [[sysctl]] オプションを設定します。
   
 
net.bridge.bridge-nf-call-iptables = 1
 
net.bridge.bridge-nf-call-iptables = 1
14行目: 14行目:
 
net.ipv4.ip_forward = 1
 
net.ipv4.ip_forward = 1
   
  +
CRI-O を再起動せずに使用するには、モジュールを[[カーネルモジュール#手動でモジュールを扱う|ロード]]し、それに応じてsysctlの値を[[Sysctl#Configuration|設定]]することを確認してください。
To use CRI-O without a reboot make sure to [[Kernel_module#Manual_module_handling|load]] the modules and [[Sysctl#Configuration|configure]] the sysctl values accordingly.
 
   
 
== Configuration ==
 
== Configuration ==

2022年1月28日 (金) 22:45時点における最新版

CRI-O は、Kubernetes Container RuntimeInterface の OCI ベースの実装です。

そのため、Kubernetes クラスタのノードで使用できるコンテナランタイムの 1 つです。

インストール

cri-o パッケージをインストールします。

このパッケージは、overlaybr_netfilter モジュールをロードするようにシステムをセットアップし、以下の sysctl オプションを設定します。

 net.bridge.bridge-nf-call-iptables = 1
 net.bridge.bridge-nf-call-ip6tables = 1
 net.ipv4.ip_forward = 1

CRI-O を再起動せずに使用するには、モジュールをロードし、それに応じてsysctlの値を設定することを確認してください。

Configuration

CRI-O is configured via /etc/crio/crio.conf or via drop-in configuration files in /etc/crio/crio.conf.d/.

Network

CRI-O can make use of container networking as provided by cni-plugins.

Copy one of the examples from /usr/share/doc/cri-o/examples/cni/ to /etc/cni/net.d and modify it as needed.

警告: The cri-o package installs the 10-crio-bridge.conf and 99-loopback.conf examples to /etc/cni/net.d by default (as 100-crio-bridge.conf and 199-crio-loopback.conf respectively). This may conflict with Kubernetes cluster network fabrics (weave, flannel, calico, etc) and require manual deletion to resolve this (e.g. #2411 #2885).

Storage

By default CRI-O makes use of the overlay driver as its storage_driver for the container storage in /var/lib/containers/storage/. However, it can also be configured to use btrfs or ZFS natively by changing the driver in /etc/containers/storage:

 sed -i 's/driver = ""/driver = "btrfs"/' /etc/containers/storage.conf

Running

Start and enable the crio.service systemd unit.

Testing

Use crio-status like this:

 # crio-status info
 cgroup driver: systemd
 storage driver: vfs
 storage root: /var/lib/containers/storage
 default GID mappings (format <container>:<host>:<size>):
   0:0:4294967295
 default UID mappings (format <container>:<host>:<size>):
   0:0:4294967295

and:

 # crio-status config
 ...

Now Install the crictl package, and see e.g. https://kubernetes.io/docs/tasks/debug-application-cluster/crictl/ or https://github.com/kubernetes-sigs/cri-tools/blob/master/docs/crictl.md, or simply:

 source <(crictl completion bash)
 crictl pull index.docker.io/busybox
 crictl pull quay.io/prometheus/busybox
 crictl images
 curl -O https://raw.githubusercontent.com/kubernetes-sigs/cri-tools/master/docs/examples/podsandbox-config.yaml
 curl -O https://raw.githubusercontent.com/kubernetes-sigs/cri-tools/master/docs/examples/container-config.yaml
 crictl run container-config.yaml podsandbox-config.yaml
 crictl logs $(crictl ps --last 1 --output yaml | yq -r .containers[0].id)
 crictl exec -it $(crictl ps --last 1 --output yaml | yq -r .containers[0].id) /bin/sh
 crictl rm -af
 crictl rmp -af

Note how Docker Hub is not hard-coded, so specify container registry explicitly. (See also https://github.com/kubernetes-sigs/cri-tools/pull/718.)

See also