follow 1.17 doc
This commit is contained in:
		
							parent
							
								
									59664b8861
								
							
						
					
					
						commit
						9bc2a924df
					
				| 
						 | 
				
			
			@ -3,14 +3,14 @@ title: CRIのインストール
 | 
			
		|||
content_type: concept
 | 
			
		||||
weight: 10
 | 
			
		||||
---
 | 
			
		||||
<!-- overview -->
 | 
			
		||||
{{% capture overview %}}
 | 
			
		||||
{{< feature-state for_k8s_version="v1.6" state="stable" >}}
 | 
			
		||||
Podのコンテナを実行するために、Kubernetesはコンテナランタイムを使用します。
 | 
			
		||||
様々なランタイムのインストール手順は次のとおりです。
 | 
			
		||||
 | 
			
		||||
{{% /capture %}}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
<!-- body -->
 | 
			
		||||
{{% capture body %}}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
{{< caution >}}
 | 
			
		||||
| 
						 | 
				
			
			@ -47,9 +47,16 @@ systemdと一緒に `cgroupfs` を使用するということは、2つの異な
 | 
			
		|||
kubeletとDockerに `cgroupfs` を使用し、ノード上で実行されている残りのプロセスに `systemd` を使用するように設定されたノードが、
 | 
			
		||||
リソース圧迫下で不安定になる場合があります。
 | 
			
		||||
 | 
			
		||||
あなたのコンテナランタイムとkubeletにcgroupドライバーとしてsystemdを使用するように設定を変更することはシステムを安定させました。
 | 
			
		||||
コンテナランタイムとkubeletがcgroupドライバーとしてsystemdを使用するように設定を変更することでシステムは安定します。
 | 
			
		||||
以下のDocker設定の `native.cgroupdriver=systemd` オプションに注意してください。
 | 
			
		||||
 | 
			
		||||
{{< caution >}}
 | 
			
		||||
すでにクラスターに組み込まれているノードのcgroupドライバーを変更することは非常におすすめしません。
 | 
			
		||||
kubeletが一方のcgroupドライバーを使用してPodを作成した場合、コンテナランタイムを別のもう一方のcgroupドライバーに変更すると、そのような既存のPodのPodサンドボックスを再作成しようとするとエラーが発生する可能性があります。
 | 
			
		||||
kubeletを再起動しても問題は解決しないでしょう。
 | 
			
		||||
ワークロードからノードを縮退させ、クラスターから削除して再び組み込むことを推奨します。
 | 
			
		||||
{{< /caution >}}
 | 
			
		||||
 | 
			
		||||
## Docker
 | 
			
		||||
 | 
			
		||||
それぞれのマシンに対してDockerをインストールします。
 | 
			
		||||
| 
						 | 
				
			
			@ -62,23 +69,24 @@ Kubernetesのリリースノートにある、Dockerの動作確認済み最新
 | 
			
		|||
{{< 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
 | 
			
		||||
apt-get update && apt-get install -y \
 | 
			
		||||
  apt-transport-https ca-certificates curl software-properties-common gnupg2
 | 
			
		||||
 | 
			
		||||
### Docker公式のGPG鍵を追加
 | 
			
		||||
    curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -
 | 
			
		||||
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の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
 | 
			
		||||
## Docker CEのインストール
 | 
			
		||||
apt-get update && apt-get install -y \
 | 
			
		||||
  containerd.io=1.2.10-3 \
 | 
			
		||||
  docker-ce=5:19.03.4~3-0~ubuntu-$(lsb_release -cs) \
 | 
			
		||||
  docker-ce-cli=5:19.03.4~3-0~ubuntu-$(lsb_release -cs)
 | 
			
		||||
 | 
			
		||||
# デーモンをセットアップ
 | 
			
		||||
cat > /etc/docker/daemon.json <<EOF
 | 
			
		||||
| 
						 | 
				
			
			@ -105,13 +113,15 @@ systemctl restart docker
 | 
			
		|||
### 必要なパッケージのインストール
 | 
			
		||||
    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リポジトリの追加
 | 
			
		||||
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
 | 
			
		||||
## Docker CEのインストール
 | 
			
		||||
yum update -y && yum install -y \
 | 
			
		||||
  containerd.io-1.2.10 \
 | 
			
		||||
  docker-ce-19.03.4 \
 | 
			
		||||
  docker-ce-cli-19.03.4
 | 
			
		||||
 | 
			
		||||
## /etc/docker ディレクトリを作成
 | 
			
		||||
mkdir /etc/docker
 | 
			
		||||
| 
						 | 
				
			
			@ -147,7 +157,12 @@ systemctl restart docker
 | 
			
		|||
 | 
			
		||||
システムへCRI-Oをインストールするためには以下のコマンドを利用します:
 | 
			
		||||
 | 
			
		||||
### 必要な設定の追加
 | 
			
		||||
{{< note >}}
 | 
			
		||||
CRI-OのメジャーとマイナーバージョンはKubernetesのメジャーとマイナーバージョンと一致しなければなりません。
 | 
			
		||||
詳細は[CRI-O互換性表](https://github.com/cri-o/cri-o)を参照してください。
 | 
			
		||||
{{< /note >}}
 | 
			
		||||
 | 
			
		||||
### 事前準備
 | 
			
		||||
 | 
			
		||||
```shell
 | 
			
		||||
modprobe overlay
 | 
			
		||||
| 
						 | 
				
			
			@ -164,33 +179,55 @@ sysctl --system
 | 
			
		|||
```
 | 
			
		||||
 | 
			
		||||
{{< tabs name="tab-cri-cri-o-installation" >}}
 | 
			
		||||
{{< tab name="Ubuntu 16.04" codelang="bash" >}}
 | 
			
		||||
{{< tab name="Debian" codelang="bash" >}}
 | 
			
		||||
# Debian Unstable/Sid
 | 
			
		||||
echo 'deb http://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/Debian_Unstable/ /' > /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list
 | 
			
		||||
wget -nv https://download.opensuse.org/repositories/devel:kubic:libcontainers:stable/Debian_Unstable/Release.key -O- | sudo apt-key add -
 | 
			
		||||
 | 
			
		||||
# 必要なパッケージをインストールし、リポジトリを追加
 | 
			
		||||
apt-get update
 | 
			
		||||
apt-get install software-properties-common
 | 
			
		||||
# Debian Testing
 | 
			
		||||
echo 'deb http://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/Debian_Testing/ /' > /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list
 | 
			
		||||
wget -nv https://download.opensuse.org/repositories/devel:kubic:libcontainers:stable/Debian_Testing/Release.key -O- | sudo apt-key add -
 | 
			
		||||
 | 
			
		||||
add-apt-repository ppa:projectatomic/ppa
 | 
			
		||||
apt-get update
 | 
			
		||||
# Debian 10
 | 
			
		||||
echo 'deb http://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/Debian_10/ /' > /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list
 | 
			
		||||
wget -nv https://download.opensuse.org/repositories/devel:kubic:libcontainers:stable/Debian_10/Release.key -O- | sudo apt-key add -
 | 
			
		||||
 | 
			
		||||
# CRI-Oをインストール
 | 
			
		||||
apt-get install cri-o-1.11
 | 
			
		||||
# Raspbian 10
 | 
			
		||||
echo 'deb http://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/Raspbian_10/ /' > /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list
 | 
			
		||||
wget -nv https://download.opensuse.org/repositories/devel:kubic:libcontainers:stable/Raspbian_10/Release.key -O- | sudo apt-key add -
 | 
			
		||||
 | 
			
		||||
# CRI-Oのインストール
 | 
			
		||||
sudo apt-get install cri-o-1.17
 | 
			
		||||
{{< /tab >}}
 | 
			
		||||
 | 
			
		||||
{{< tab name="Ubuntu 18.04, 19.04 and 19.10" codelang="bash" >}}
 | 
			
		||||
# リポジトリの設定
 | 
			
		||||
. /etc/os-release
 | 
			
		||||
sudo sh -c "echo 'deb http://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/x${NAME}_${VERSION_ID}/ /' > /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list"
 | 
			
		||||
wget -nv https://download.opensuse.org/repositories/devel:kubic:libcontainers:stable/x${NAME}_${VERSION_ID}/Release.key -O- | sudo apt-key add -
 | 
			
		||||
sudo apt-get update
 | 
			
		||||
 | 
			
		||||
# CRI-Oのインストール
 | 
			
		||||
sudo apt-get install cri-o-1.17
 | 
			
		||||
{{< /tab >}}
 | 
			
		||||
 | 
			
		||||
{{< tab name="CentOS/RHEL 7.4+" codelang="bash" >}}
 | 
			
		||||
# 必要なパッケージのインストール
 | 
			
		||||
yum-config-manager --add-repo=https://cbs.centos.org/repos/paas7-crio-115-release/x86_64/os/
 | 
			
		||||
 | 
			
		||||
# 必要なリポジトリを追加
 | 
			
		||||
yum-config-manager --add-repo=https://cbs.centos.org/repos/paas7-crio-311-candidate/x86_64/os/
 | 
			
		||||
 | 
			
		||||
# CRI-Oをインストール
 | 
			
		||||
yum install --nogpgcheck cri-o
 | 
			
		||||
# CRI-Oのインストール
 | 
			
		||||
yum install --nogpgcheck -y cri-o
 | 
			
		||||
{{< /tab >}}
 | 
			
		||||
 | 
			
		||||
{{< tab name="openSUSE Tumbleweed" codelang="bash" >}}
 | 
			
		||||
sudo zypper install cri-o
 | 
			
		||||
{{< /tab >}}
 | 
			
		||||
{{< /tabs >}}
 | 
			
		||||
 | 
			
		||||
### CRI-Oの起動
 | 
			
		||||
 | 
			
		||||
```
 | 
			
		||||
systemctl daemon-reload
 | 
			
		||||
systemctl start crio
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -205,6 +242,11 @@ systemctl start crio
 | 
			
		|||
### 必要な設定の追加
 | 
			
		||||
 | 
			
		||||
```shell
 | 
			
		||||
cat > /etc/modules-load.d/containerd.conf <<EOF
 | 
			
		||||
overlay
 | 
			
		||||
br_netfilter
 | 
			
		||||
EOF
 | 
			
		||||
 | 
			
		||||
modprobe overlay
 | 
			
		||||
modprobe br_netfilter
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -218,39 +260,65 @@ EOF
 | 
			
		|||
sysctl --system
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
### containerdのインストール
 | 
			
		||||
 | 
			
		||||
{{< tabs name="tab-cri-containerd-installation" >}}
 | 
			
		||||
{{< tab name="Ubuntu 16.04+" codelang="bash" >}}
 | 
			
		||||
apt-get install -y libseccomp2
 | 
			
		||||
{{< tab name="Ubuntu 16.04" codelang="bash" >}}
 | 
			
		||||
# containerdのインストール
 | 
			
		||||
## リポジトリの設定
 | 
			
		||||
### HTTPS越しのリポジトリの使用をaptに許可するために、パッケージをインストール
 | 
			
		||||
apt-get update && apt-get install -y 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"
 | 
			
		||||
 | 
			
		||||
## containerdのインストール
 | 
			
		||||
apt-get update && apt-get install -y containerd.io
 | 
			
		||||
 | 
			
		||||
# containerdの設定
 | 
			
		||||
mkdir -p /etc/containerd
 | 
			
		||||
containerd config default > /etc/containerd/config.toml
 | 
			
		||||
 | 
			
		||||
# containerdの再起動
 | 
			
		||||
systemctl restart containerd
 | 
			
		||||
{{< /tab >}}
 | 
			
		||||
{{< tab name="CentOS/RHEL 7.4+" codelang="bash" >}}
 | 
			
		||||
yum install -y libseccomp
 | 
			
		||||
# containerdのインストール
 | 
			
		||||
## リポジトリの設定
 | 
			
		||||
### 必要なパッケージのインストール
 | 
			
		||||
yum install -y yum-utils device-mapper-persistent-data lvm2
 | 
			
		||||
 | 
			
		||||
### Dockerのリポジトリの追加
 | 
			
		||||
yum-config-manager \
 | 
			
		||||
    --add-repo \
 | 
			
		||||
    https://download.docker.com/linux/centos/docker-ce.repo
 | 
			
		||||
 | 
			
		||||
## containerdのインストール
 | 
			
		||||
yum update -y && yum install -y containerd.io
 | 
			
		||||
 | 
			
		||||
# containerdの設定
 | 
			
		||||
mkdir -p /etc/containerd
 | 
			
		||||
containerd config default > /etc/containerd/config.toml
 | 
			
		||||
 | 
			
		||||
# containerdの再起動
 | 
			
		||||
systemctl restart containerd
 | 
			
		||||
{{< /tab >}}
 | 
			
		||||
{{< /tabs >}}
 | 
			
		||||
 | 
			
		||||
### containerdのインストール
 | 
			
		||||
### systemd
 | 
			
		||||
 | 
			
		||||
[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
 | 
			
		||||
```
 | 
			
		||||
`systemd`のcgroupドライバーを使うには、`/etc/containerd/config.toml`内で`plugins.cri.systemd_cgroup = true`を設定してください。
 | 
			
		||||
kubeadmを使う場合は[kubeletのためのcgroupドライバー](/ja/docs/setup/production-environment/tools/kubeadm/install-kubeadm/)を手動で設定してください。
 | 
			
		||||
 | 
			
		||||
## その他のCRIランタイム: frakti
 | 
			
		||||
 | 
			
		||||
詳細については[Fraktiのクイックスタートガイド](https://github.com/kubernetes/frakti#quickstart)を参照してください。
 | 
			
		||||
 | 
			
		||||
{{% /capture %}}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue