「Kata コンテナ」の版間の差分

提供: ArchWiki
ナビゲーションに移動 検索に移動
(Kusanaginoturugi がページ「Kata Containers」を「Kata コンテナ」に移動しました: 日本語化)
(同じ利用者による、間の3版が非表示)
9行目: 9行目:
 
Kata Containers(以前の Clear Containers)は、OCI 互換のアプリケーションコンテナランタイムで、仮想化を利用して、潜在的に信頼できないプロセスを、ホストシステムや他のプロセスから隔離することを目的としています。現在、アップストリームでサポートされているハイパーバイザーは、{{pkg|qemu}}、{{aur|firecracker-bin}} と {{aur|cloud-hypervisor}} です。
 
Kata Containers(以前の Clear Containers)は、OCI 互換のアプリケーションコンテナランタイムで、仮想化を利用して、潜在的に信頼できないプロセスを、ホストシステムや他のプロセスから隔離することを目的としています。現在、アップストリームでサポートされているハイパーバイザーは、{{pkg|qemu}}、{{aur|firecracker-bin}} と {{aur|cloud-hypervisor}} です。
   
== Architecture ==
+
== アーキテクチャ ==
   
  +
* {{ic|kata-agent}} - ハイパーバイザー化されたゲストサンドボックスで実行されるスーパーバイザープロセスで、そのライフタイムを管理する役割を持つ
* {{ic|kata-agent}} - supervisor process running on the hypervised guest sandbox, tasked with managing its lifetime
 
  +
* {{ic|kata-runtime}} - OCIランタイム仕様で指定されたコマンドを処理し、シムの起動を担当するコンテナランタイムコンポーネント
* {{ic|kata-runtime}} - container runtime component responsible for handling commands specified by the OCI runtime specification and tasked with launching shims
 
  +
* {{ic|kata-proxy}} (2.0以前) - gRPC を使用してゲスト側のエージェントとホスト側のプロセス間で I/O ストリームとシグナルをルーティングする
* {{ic|kata-proxy}} (before 2.0) - routes I/O streams and signals between on-guest agent and host-side processes associated with running a given sandbox using gRPC
 
* {{ic|kata-shim}} (before 2.0) - container process monitor and reaper
+
* {{ic|kata-shim}} (2.0以前) - コンテナプロセスの監視とリーパー
* {{ic|kata-ksm-throttler}} (optional, before 2.0) -
+
* {{ic|kata-ksm-throttler}} (オプション, 2.0以前) -
  +
* {{ic|kata-linux-container}} - コンテナ/ポッドサンドボックスとして機能するVMを起動するために使用されるパッチ済みカーネル
* {{ic|kata-linux-container}} - patched kernel used to launch VMs serving as container/pod sandboxes
 
* {{ic|kata-containers-image}} - initramfs and rootfs images used for spawning VM sandboxes
+
* {{ic|kata-containers-image}} - VMサンドボックスを生成するために使用される initramfs および rootfs イメージ
   
 
== 使用方法 ==
 
== 使用方法 ==
25行目: 25行目:
 
=== v1 ===
 
=== v1 ===
   
Install the runtime {{aur|kata-runtime-bin}}, {{aur|kata-proxy-bin}}{{Broken package link|package not found}}, {{aur|kata-shim-bin}}{{Broken package link|package not found}}, kernel {{aur|kata-linux-container-bin}} and set of initrd and rootfs {{aur|kata-containers-image-bin}}.
+
ランタイム {{aur|kata-runtime-bin}}, {{aur|kata-proxy-bin}}{{Broken package link|package not found}}, {{aur|kata-shim-bin}}{{Broken package link|package not found}}, カーネル {{aur|kata-linux-container-bin}} および initrd rootfs のセット {{aur|kata-containers-image-bin}} をインストールします。
   
 
==== Docker ====
 
==== Docker ====
   
  +
Docker で Kata コンテナを使用するには、{{ic|/etc/docker/daemon.json}} に対応するランタイムを追加する必要があります:
In order to use Kata Containers with Docker, the user needs to add it to supported runtimes in {{ic|/etc/docker/daemon.json}}:
 
   
 
{
 
{
39行目: 39行目:
 
}
 
}
   
To use it as the default runtime for Docker: {{ic|{"default-runtime": "kata"} }}.
+
Docker のデフォルトランタイムとして使用するには: {{ic|{"default-runtime": "kata"} }}
   
To use it with the Firecracker hypervisor, due to its limitations, the {{ic|devicemapper}} storage driver [https://docs.docker.com/storage/storagedriver/select-storage-driver/] has to be used: {{ic|{"storage-driver": "devicemapper"} }}.
+
Firecracker ハイパーバイザーを使用するには、その制限のために {{ic|devicemapper}} ストレージドライバ [https://docs.docker.com/storage/storagedriver/select-storage-driver/] を使用する必要があります: {{ic|{"storage-driver": "devicemapper"} }}
   
Afterward you can use the runtime key: {{ic|docker run --runtime kata --rm -ti archlinux/base /bin/bash}}.
+
その後、ランタイムキーを使用して実行できます: {{ic|docker run --runtime kata --rm -ti archlinux/base /bin/bash}}
   
 
==== Podman ====
 
==== Podman ====
   
Running a container: {{ic|podman --runtime /usr/bin/kata-runtime run --rm -ti archlinux/base /bin/bash}}.
+
コンテナを実行するには: {{ic|podman --runtime /usr/bin/kata-runtime run --rm -ti archlinux/base /bin/bash}}
   
  +
Kata VM サンドボックスは、概念的には Kubernetes のポッドや共有ネットワーク名前空間に対応し、個々のコンテナに対応するわけではないことに注意してください。
Keep in mind that a Kata VM sandbox conceptually maps to Kubernetes pods or a shared netns, not just individual containers.
 
   
 
=== v2 ===
 
=== v2 ===
   
  +
バージョン2.0以降、Kata コンテナは専ら OCI ランタイムシム API v2 を使用していますが、Docker はその API バージョンを v1 にハードコードしているため、この組み合わせを使用することは現時点では不可能です。
Since release 2.0, Kata Containers exclusively uses OCI runtime shim API v2, however Docker has that API version hard-coded to v1, making it unfeasible to use this combination as of this writing.
 
   
Install the runtime {{aur|kata2-runtime-bin}}, kernel {{aur|kata2-linux-container-bin}} and set of initrd and rootfs {{aur|kata2-containers-image-bin}}.
+
ランタイム {{aur|kata2-runtime-bin}}, カーネル {{aur|kata2-linux-container-bin}} および initrd rootfs のセット {{aur|kata2-containers-image-bin}} をインストールします。
   
 
==== Containerd CLI ====
 
==== Containerd CLI ====
62行目: 62行目:
 
# ctr run --rm -t --runtime io.containerd.kata.v2 docker.io/archlinux/base:latest example-container-name date
 
# ctr run --rm -t --runtime io.containerd.kata.v2 docker.io/archlinux/base:latest example-container-name date
   
== See also ==
+
== 参照 ==
  +
 
* [https://katacontainers.io/ Project's official site]
 
* [https://katacontainers.io/ Project's official site]
 
* [https://github.com/kata-containers/documentation/blob/master/design/architecture.md Architecture reference documentation]
 
* [https://github.com/kata-containers/documentation/blob/master/design/architecture.md Architecture reference documentation]

2024年5月15日 (水) 18:44時点における版

関連記事

Kata Containers(以前の Clear Containers)は、OCI 互換のアプリケーションコンテナランタイムで、仮想化を利用して、潜在的に信頼できないプロセスを、ホストシステムや他のプロセスから隔離することを目的としています。現在、アップストリームでサポートされているハイパーバイザーは、qemufirecracker-binAURcloud-hypervisorAUR です。

アーキテクチャ

  • kata-agent - ハイパーバイザー化されたゲストサンドボックスで実行されるスーパーバイザープロセスで、そのライフタイムを管理する役割を持つ
  • kata-runtime - OCIランタイム仕様で指定されたコマンドを処理し、シムの起動を担当するコンテナランタイムコンポーネント
  • kata-proxy (2.0以前) - gRPC を使用してゲスト側のエージェントとホスト側のプロセス間で I/O ストリームとシグナルをルーティングする
  • kata-shim (2.0以前) - コンテナプロセスの監視とリーパー
  • kata-ksm-throttler (オプション, 2.0以前) -
  • kata-linux-container - コンテナ/ポッドサンドボックスとして機能するVMを起動するために使用されるパッチ済みカーネル
  • kata-containers-image - VMサンドボックスを生成するために使用される initramfs および rootfs イメージ

使用方法

Kata はデフォルトでは /etc/kata-containers/configuration.toml から設定を拾いますが、環境変数 KATA_CONF_FILE で設定のパスを指定することで、これをオーバーライドすることができます。必ず /usr/share/defaults/kata-containers/configuration-qemu.toml からの設定を初期化してください。

v1

ランタイム kata-runtime-binAUR, kata-proxy-binAUR[リンク切れ: package not found], kata-shim-binAUR[リンク切れ: package not found], カーネル kata-linux-container-binAUR および initrd と rootfs のセット kata-containers-image-binAUR をインストールします。

Docker

Docker で Kata コンテナを使用するには、/etc/docker/daemon.json に対応するランタイムを追加する必要があります:

 {
   "runtimes": {
     "kata": {
       "path": "/usr/bin/kata-runtime"
     }
   }
 }

Docker のデフォルトランタイムとして使用するには: {"default-runtime": "kata"}

Firecracker ハイパーバイザーを使用するには、その制限のために devicemapper ストレージドライバ [1] を使用する必要があります: {"storage-driver": "devicemapper"}

その後、ランタイムキーを使用して実行できます: docker run --runtime kata --rm -ti archlinux/base /bin/bash

Podman

コンテナを実行するには: podman --runtime /usr/bin/kata-runtime run --rm -ti archlinux/base /bin/bash

Kata VM サンドボックスは、概念的には Kubernetes のポッドや共有ネットワーク名前空間に対応し、個々のコンテナに対応するわけではないことに注意してください。

v2

バージョン2.0以降、Kata コンテナは専ら OCI ランタイムシム API v2 を使用していますが、Docker はその API バージョンを v1 にハードコードしているため、この組み合わせを使用することは現時点では不可能です。

ランタイム kata2-runtime-binAUR, カーネル kata2-linux-container-binAUR および initrd と rootfs のセット kata2-containers-image-binAUR をインストールします。

Containerd CLI

# ctr image pull docker.io/archlinux/base:latest
# ctr run --rm -t --runtime io.containerd.kata.v2 docker.io/archlinux/base:latest example-container-name date

参照