bbf3a979d4
* Update k8s.io/ja/docs/tutorials/kubernetes-basics/create-cluster/cluster-intro/ (#13153) * [ja] Translate Hello Minikube in tutorials (#13100) (#13161) * ja-trans: update supported-doc-versions.md (#13186) * [ja] Update /concepts/overview/what-is-kubernetes.md #13079 (#13187) * ja-trans: update expose-intro.html (#13215) * ja-trans: update expose-intro.html * ja-trans: fix broken links by linking to english pages * update deploy-intro.html (#13103) (#13208) * update deploy-intro.html (#13103) * Update content/ja/docs/tutorials/kubernetes-basics/deploy-app/deploy-intro.html add /ja path Co-Authored-By: chidakiyo <chidakiyo@users.noreply.github.com> * [ja] Update /setup/release/building-from-source.md (#13095) (#13220) * ja-trans: update /ja/docs/setup/independent/control-plane-flags/ (#13228) * ja-trans: Update /setup/turnkey/azure.md (#13097) (#13224) * ja-trans: update /ja/docs/tutorials/kubernetes-basics/ (#13232) * ja-trans: update /ja/docs/tutorials/kubernetes-basics/ * ja-trans: translate card.title * ja-trans: update setup/minikube.md (#13091) (#13219) * [ja] Update content of setup/minikube.md, fixing the diff between551489f7b07d19. * [ja] Translate the content: content/ja/docs/setup/minikube.md (#13091) * Correct Katakana words, using long vowel words Co-Authored-By: yukinagae <yuki.nagae1130@gmail.com> * Fix typos Co-Authored-By: yukinagae <yuki.nagae1130@gmail.com> * Correct some changes, thanks for the FB Co-Authored-By: yukinagae <yuki.nagae1130@gmail.com> * ja-trans: Update k8s.io/ja/docs/setup/pick-right-solution/ (#13094) (#13328) * ja-trans: Update the content of setup/pick-right-solution.md, only fixing the diff between551489fand7b07d19. (Not yet translating the content at the moment to only make sure fixing the diff is ok. Next commit will be actually the translation stuff) * ja-trans: Translate /ja/docs/setup/pick-right-solution.md (#13094) * Update content/ja/docs/setup/pick-right-solution.md Correct small changes based on the feedback Co-Authored-By: yukinagae <yuki.nagae1130@gmail.com> * Better translation and refer the Japanese document link Co-Authored-By: yukinagae <yuki.nagae1130@gmail.com> * Correct Japanese anchors Co-Authored-By: yukinagae <yuki.nagae1130@gmail.com> * Correct translation mistakes Co-Authored-By: yukinagae <yuki.nagae1130@gmail.com> * ja: Translate /docs/home (#13366) * follow to the latest format * review * ja: fix some unnatural translation and formatting (#13367) * format * Update content/ja/docs/setup/certificates.md Co-Authored-By: inductor <kohei.ota@zozo.com> * ja-trans: Translate heading and subheading of docs/setup/version-skew-policy.md in Japanese (#13360) * copy content * remove reviewer block * Translate heading and subheading. * change translation * ja-trans: Translate heading and subheading of docs/setup/turnkey/icp.md in Japanese (#13359) * copy content * remove reviewer block * Translate heading and subheading. * ref. #13098 (#13358) * ref. #13096 (#13357) * ref. #13089 (#13353) * ref. #13087 (#13351) * ref. #13082 (#13348) * ref. #13085 (#13349) * ref. #13088 (#13352) * ref. #13090 (#13354) * ref. #13092 (#13355) * ref. #13093 (#13356) * ref. #13099 (#13361) * [ja] Translate the content: ja/docs/setup/independent/high-availability/ (#13364) * [ja] Translate the content: ja/docs/setup/independent/high-availability/ * remove redundant comma, words * Update content/ja/docs/setup/independent/high-availability.md 余分な文字を削除 Co-Authored-By: TSUDA-Kyosuke <tsuda@stmn.co.jp> * Update k8s.io/ja/docs/setup/cri/ (#13663) * fix content. * Update content/ja/docs/setup/cri.md Co-Authored-By: cstoku <cs.toku.mail@gmail.com> * Update cri.md * Update content/ja/docs/setup/cri.md Co-Authored-By: cstoku <cs.toku.mail@gmail.com> * Update content/ja/docs/setup/cri.md Co-Authored-By: cstoku <cs.toku.mail@gmail.com> * improve translation
257 lines
9.5 KiB
Markdown
257 lines
9.5 KiB
Markdown
---
|
|
title: CRIのインストール
|
|
content_template: templates/concept
|
|
weight: 100
|
|
---
|
|
{{% capture overview %}}
|
|
{{< feature-state for_k8s_version="v1.6" state="stable" >}}
|
|
Podのコンテナを実行するために、Kubernetesはコンテナランタイムを使用します。
|
|
様々なランタイムのインストール手順は次のとおりです。
|
|
|
|
{{% /capture %}}
|
|
|
|
{{% capture body %}}
|
|
|
|
|
|
{{< caution >}}
|
|
コンテナ実行時にruncがシステムファイルディスクリプターを扱える脆弱性が見つかりました。
|
|
悪意のあるコンテナがこの脆弱性を利用してruncのバイナリを上書きし、
|
|
コンテナホストシステム上で任意のコマンドを実行する可能性があります。
|
|
|
|
この問題の更なる情報は以下のリンクを参照してください。
|
|
[cve-2019-5736 : runc vulnerability](https://access.redhat.com/security/cve/cve-2019-5736)
|
|
{{< /caution >}}
|
|
|
|
### 適用性
|
|
|
|
{{< note >}}
|
|
このドキュメントはLinuxにCRIをインストールするユーザーの為に書かれています。
|
|
他のオペレーティングシステムの場合、プラットフォーム固有のドキュメントを見つけてください。
|
|
{{< /note >}}
|
|
|
|
このガイドでは全てのコマンドを `root` で実行します。
|
|
例として、コマンドに `sudo` を付けたり、 `root` になってそのユーザーでコマンドを実行します。
|
|
|
|
### Cgroupドライバー
|
|
|
|
systemdがLinuxのディストリビューションのinitシステムとして選択されている場合、
|
|
initプロセスが作成され、rootコントロールグループ(`cgroup`)を使い、cgroupマネージャーとして行動します。
|
|
systemdはcgroupと密接に統合されており、プロセスごとにcgroupを割り当てます。
|
|
`cgroupfs` を使うように、あなたのコンテナランライムとkubeletを設定することができます。
|
|
systemdと一緒に `cgroupfs` を使用するということは、2つの異なるcgroupマネージャーがあることを意味します。
|
|
|
|
コントロールグループはプロセスに割り当てられるリソースを制御するために使用されます。
|
|
単一のcgroupマネージャーは、割り当てられているリソースのビューを単純化し、
|
|
デフォルトでは使用可能なリソースと使用中のリソースについてより一貫性のあるビューになります。
|
|
2つのマネージャーがある場合、それらのリソースについて2つのビューが得られます。
|
|
kubeletとDockerに `cgroupfs` を使用し、ノード上で実行されている残りのプロセスに `systemd` を使用するように設定されたノードが、
|
|
リソース圧迫下で不安定になる場合があります。
|
|
|
|
あなたのコンテナランタイムとkubeletにcgroupドライバーとしてsystemdを使用するように設定を変更することはシステムを安定させました。
|
|
以下のDocker設定の `native.cgroupdriver=systemd` オプションに注意してください。
|
|
|
|
## Docker
|
|
|
|
それぞれのマシンに対してDockerをインストールします。
|
|
バージョン18.06.2が推奨されていますが、1.11、1.12、1.13、17.03、18.09についても動作が確認されています。
|
|
Kubernetesのリリースノートにある、Dockerの動作確認済み最新バージョンについてもご確認ください。
|
|
|
|
システムへDockerをインストールするには、次のコマンドを実行します。
|
|
|
|
{{< tabs name="tab-cri-docker-installation" >}}
|
|
{{< tab name="Ubuntu 16.04" codelang="bash" >}}
|
|
# Docker CEのインストール
|
|
## リポジトリをセットアップ
|
|
### aptパッケージインデックスを更新
|
|
apt-get update
|
|
|
|
### HTTPS越しのリポジトリの使用をaptに許可するために、パッケージをインストール
|
|
apt-get update && apt-get install apt-transport-https ca-certificates curl software-properties-common
|
|
|
|
### Docker公式のGPG鍵を追加
|
|
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -
|
|
|
|
### dockerのaptリポジトリを追加
|
|
add-apt-repository \
|
|
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
|
|
$(lsb_release -cs) \
|
|
stable"
|
|
|
|
## docker ceのインストール
|
|
apt-get update && apt-get install docker-ce=18.06.2~ce~3-0~ubuntu
|
|
|
|
# デーモンをセットアップ
|
|
cat > /etc/docker/daemon.json <<EOF
|
|
{
|
|
"exec-opts": ["native.cgroupdriver=systemd"],
|
|
"log-driver": "json-file",
|
|
"log-opts": {
|
|
"max-size": "100m"
|
|
},
|
|
"storage-driver": "overlay2"
|
|
}
|
|
EOF
|
|
|
|
mkdir -p /etc/systemd/system/docker.service.d
|
|
|
|
# dockerを再起動
|
|
systemctl daemon-reload
|
|
systemctl restart docker
|
|
{{< /tab >}}
|
|
{{< tab name="CentOS/RHEL 7.4+" codelang="bash" >}}
|
|
|
|
# Docker CEのインストール
|
|
## リポジトリをセットアップ
|
|
### 必要なパッケージのインストール
|
|
yum install yum-utils device-mapper-persistent-data lvm2
|
|
|
|
### dockerパッケージ用のyumリポジトリを追加
|
|
yum-config-manager \
|
|
--add-repo \
|
|
https://download.docker.com/linux/centos/docker-ce.repo
|
|
|
|
## docker ceのインストール
|
|
yum update && yum install docker-ce-18.06.2.ce
|
|
|
|
## /etc/docker ディレクトリを作成
|
|
mkdir /etc/docker
|
|
|
|
# デーモンをセットアップ
|
|
cat > /etc/docker/daemon.json <<EOF
|
|
{
|
|
"exec-opts": ["native.cgroupdriver=systemd"],
|
|
"log-driver": "json-file",
|
|
"log-opts": {
|
|
"max-size": "100m"
|
|
},
|
|
"storage-driver": "overlay2",
|
|
"storage-opts": [
|
|
"overlay2.override_kernel_check=true"
|
|
]
|
|
}
|
|
EOF
|
|
|
|
mkdir -p /etc/systemd/system/docker.service.d
|
|
|
|
# dockerを再起動
|
|
systemctl daemon-reload
|
|
systemctl restart docker
|
|
{{< /tab >}}
|
|
{{< /tabs >}}
|
|
|
|
詳細については、[Dockerの公式インストールガイド](https://docs.docker.com/engine/installation/)を参照してください。
|
|
|
|
## CRI-O
|
|
|
|
このセクションでは、CRIランタイムとして`CRI-O`を利用するために必要な手順について説明します。
|
|
|
|
システムへCRI-Oをインストールするためには以下のコマンドを利用します:
|
|
|
|
### 必要な設定の追加
|
|
|
|
```shell
|
|
modprobe overlay
|
|
modprobe br_netfilter
|
|
|
|
# 必要なカーネルパラメータの設定をします。これらの設定値は再起動後も永続化されます。
|
|
cat > /etc/sysctl.d/99-kubernetes-cri.conf <<EOF
|
|
net.bridge.bridge-nf-call-iptables = 1
|
|
net.ipv4.ip_forward = 1
|
|
net.bridge.bridge-nf-call-ip6tables = 1
|
|
EOF
|
|
|
|
sysctl --system
|
|
```
|
|
|
|
{{< tabs name="tab-cri-cri-o-installation" >}}
|
|
{{< tab name="Ubuntu 16.04" codelang="bash" >}}
|
|
|
|
# 必要なパッケージをインストールし、リポジトリを追加
|
|
apt-get update
|
|
apt-get install software-properties-common
|
|
|
|
add-apt-repository ppa:projectatomic/ppa
|
|
apt-get update
|
|
|
|
# CRI-Oをインストール
|
|
apt-get install cri-o-1.11
|
|
|
|
{{< /tab >}}
|
|
{{< tab name="CentOS/RHEL 7.4+" codelang="bash" >}}
|
|
|
|
# 必要なリポジトリを追加
|
|
yum-config-manager --add-repo=https://cbs.centos.org/repos/paas7-crio-311-candidate/x86_64/os/
|
|
|
|
# CRI-Oをインストール
|
|
yum install --nogpgcheck cri-o
|
|
|
|
{{< /tab >}}
|
|
{{< /tabs >}}
|
|
|
|
### CRI-Oの起動
|
|
|
|
```
|
|
systemctl start crio
|
|
```
|
|
|
|
詳細については、[CRI-Oインストールガイド](https://github.com/kubernetes-sigs/cri-o#getting-started)を参照してください。
|
|
|
|
## Containerd
|
|
|
|
このセクションでは、CRIランタイムとして`containerd`を利用するために必要な手順について説明します。
|
|
|
|
システムへContainerdをインストールするためには次のコマンドを実行します。
|
|
|
|
### 必要な設定の追加
|
|
|
|
```shell
|
|
modprobe overlay
|
|
modprobe br_netfilter
|
|
|
|
# 必要なカーネルパラメータの設定をします。これらの設定値は再起動後も永続化されます。
|
|
cat > /etc/sysctl.d/99-kubernetes-cri.conf <<EOF
|
|
net.bridge.bridge-nf-call-iptables = 1
|
|
net.ipv4.ip_forward = 1
|
|
net.bridge.bridge-nf-call-ip6tables = 1
|
|
EOF
|
|
|
|
sysctl --system
|
|
```
|
|
|
|
{{< tabs name="tab-cri-containerd-installation" >}}
|
|
{{< tab name="Ubuntu 16.04+" codelang="bash" >}}
|
|
apt-get install -y libseccomp2
|
|
{{< /tab >}}
|
|
{{< tab name="CentOS/RHEL 7.4+" codelang="bash" >}}
|
|
yum install -y libseccomp
|
|
{{< /tab >}}
|
|
{{< /tabs >}}
|
|
|
|
### containerdのインストール
|
|
|
|
[Containerdは定期的にリリース](https://github.com/containerd/containerd/releases)されますが、以下に示すコマンドで利用している値は、この手順が作成された時点での最新のバージョンにしたがって書かれています。より新しいバージョンとダウンロードするファイルのハッシュ値については[こちら](https://storage.googleapis.com/cri-containerd-release)で確認するようにしてください。
|
|
|
|
```shell
|
|
# 必要な環境変数をexportします。
|
|
export CONTAINERD_VERSION="1.1.2"
|
|
export CONTAINERD_SHA256="d4ed54891e90a5d1a45e3e96464e2e8a4770cd380c21285ef5c9895c40549218"
|
|
|
|
# containerdのtarボールをダウンロードします。
|
|
wget https://storage.googleapis.com/cri-containerd-release/cri-containerd-${CONTAINERD_VERSION}.linux-amd64.tar.gz
|
|
|
|
# ハッシュ値をチェックします。
|
|
echo "${CONTAINERD_SHA256} cri-containerd-${CONTAINERD_VERSION}.linux-amd64.tar.gz" | sha256sum --check -
|
|
|
|
# 解凍して展開します。
|
|
tar --no-overwrite-dir -C / -xzf cri-containerd-${CONTAINERD_VERSION}.linux-amd64.tar.gz
|
|
|
|
# containerdを起動します。
|
|
systemctl start containerd
|
|
```
|
|
|
|
## その他のCRIランタイム: frakti
|
|
|
|
詳細については[Fraktiのクイックスタートガイド](https://github.com/kubernetes/frakti#quickstart)を参照してください。
|
|
|
|
{{% /capture %}}
|