@@ -32,9 +32,6 @@ This document is written for users installing CRI onto Linux. For other operatin
32
32
systems, look for documentation specific to your platform.
33
33
{{< /note >}}
34
34
35
- You should execute all the commands in this guide as ` root ` . For example, prefix commands
36
- with ` sudo ` , or become ` root ` and run the commands as that user.
37
-
38
35
### Cgroup drivers
39
36
40
37
When systemd is chosen as the init system for a Linux distribution, the init process generates
@@ -76,34 +73,34 @@ Use the following commands to install Docker on your system:
76
73
# (Install Docker CE)
77
74
# # Set up the repository:
78
75
# ## Install packages to allow apt to use a repository over HTTPS
79
- apt-get update && apt-get install -y \
76
+ sudo apt-get update && sudo apt-get install -y \
80
77
apt-transport-https ca-certificates curl software-properties-common gnupg2
81
78
```
82
79
83
80
``` shell
84
81
# Add Docker's official GPG key:
85
- curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -
82
+ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
86
83
```
87
84
88
85
``` shell
89
86
# Add the Docker apt repository:
90
- add-apt-repository \
87
+ sudo add-apt-repository \
91
88
" deb [arch=amd64] https://download.docker.com/linux/ubuntu \
92
89
$( lsb_release -cs) \
93
90
stable"
94
91
```
95
92
96
93
``` shell
97
94
# Install Docker CE
98
- apt-get update && apt-get install -y \
95
+ sudo apt-get update && sudo apt-get install -y \
99
96
containerd.io=1.2.13-2 \
100
97
docker-ce=5:19.03.11~3-0~ubuntu-$( lsb_release -cs) \
101
98
docker-ce-cli=5:19.03.11~3-0~ubuntu-$( lsb_release -cs)
102
99
```
103
100
104
101
``` shell
105
102
# Set up the Docker daemon
106
- cat > /etc/docker/daemon.json << EOF
103
+ cat << EOF | sudo tee /etc/docker/daemon.json
107
104
{
108
105
"exec-opts": ["native.cgroupdriver=systemd"],
109
106
"log-driver": "json-file",
@@ -116,13 +113,13 @@ EOF
116
113
```
117
114
118
115
``` shell
119
- mkdir -p /etc/systemd/system/docker.service.d
116
+ sudo mkdir -p /etc/systemd/system/docker.service.d
120
117
```
121
118
122
119
``` shell
123
120
# Restart Docker
124
- systemctl daemon-reload
125
- systemctl restart docker
121
+ sudo systemctl daemon-reload
122
+ sudo systemctl restart docker
126
123
```
127
124
{{% /tab %}}
128
125
{{% tab name="CentOS/RHEL 7.4+" %}}
@@ -131,31 +128,31 @@ systemctl restart docker
131
128
# (Install Docker CE)
132
129
# # Set up the repository
133
130
# ## Install required packages
134
- yum install -y yum-utils device-mapper-persistent-data lvm2
131
+ sudo yum install -y yum-utils device-mapper-persistent-data lvm2
135
132
```
136
133
137
134
``` shell
138
135
# # Add the Docker repository
139
- yum-config-manager --add-repo \
136
+ sudo yum-config-manager --add-repo \
140
137
https://download.docker.com/linux/centos/docker-ce.repo
141
138
```
142
139
143
140
``` shell
144
141
# Install Docker CE
145
- yum update -y && yum install -y \
142
+ sudo yum update -y && sudo yum install -y \
146
143
containerd.io-1.2.13 \
147
144
docker-ce-19.03.11 \
148
145
docker-ce-cli-19.03.11
149
146
```
150
147
151
148
``` shell
152
149
# # Create /etc/docker
153
- mkdir /etc/docker
150
+ sudo mkdir /etc/docker
154
151
```
155
152
156
153
``` shell
157
154
# Set up the Docker daemon
158
- cat > /etc/docker/daemon.json << EOF
155
+ cat << EOF | sudo tee /etc/docker/daemon.json
159
156
{
160
157
"exec-opts": ["native.cgroupdriver=systemd"],
161
158
"log-driver": "json-file",
@@ -171,13 +168,13 @@ EOF
171
168
```
172
169
173
170
``` shell
174
- mkdir -p /etc/systemd/system/docker.service.d
171
+ sudo mkdir -p /etc/systemd/system/docker.service.d
175
172
```
176
173
177
174
``` shell
178
175
# Restart Docker
179
- systemctl daemon-reload
180
- systemctl restart docker
176
+ sudo systemctl daemon-reload
177
+ sudo systemctl restart docker
181
178
```
182
179
{{% /tab %}}
183
180
{{< /tabs >}}
@@ -205,17 +202,17 @@ For more information, see the [CRI-O compatibility matrix](https://github.com/cr
205
202
### Prerequisites
206
203
207
204
``` shell
208
- modprobe overlay
209
- modprobe br_netfilter
205
+ sudo modprobe overlay
206
+ sudo modprobe br_netfilter
210
207
211
208
# Set up required sysctl params, these persist across reboots.
212
- cat > /etc/sysctl.d/99-kubernetes-cri.conf << EOF
209
+ cat << EOF | sudo tee /etc/sysctl.d/99-kubernetes-cri.conf
213
210
net.bridge.bridge-nf-call-iptables = 1
214
211
net.ipv4.ip_forward = 1
215
212
net.bridge.bridge-nf-call-ip6tables = 1
216
213
EOF
217
214
218
- sysctl --system
215
+ sudo sysctl --system
219
216
```
220
217
221
218
{{< tabs name="tab-cri-cri-o-installation" >}}
@@ -237,14 +234,18 @@ To install version 1.18.3, set `VERSION=1.18:1.18.3`.
237
234
238
235
Then run
239
236
``` shell
240
- echo " deb https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/$OS / /" > /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list
241
- echo " deb http://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable:/cri-o:/$VERSION /$OS / /" > /etc/apt/sources.list.d/devel:kubic:libcontainers:stable:cri-o:$VERSION .list
237
+ cat << EOF | sudo tee /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list
238
+ "deb https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/$OS / /"
239
+ EOF
240
+ cat << EOF | sudo tee /etc/apt/sources.list.d/devel:kubic:libcontainers:stable:cri-o:$VERSION .list
241
+ "deb http://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable:/cri-o:/$VERSION /$OS / /"
242
+ EOF
242
243
243
- curl -L https://download.opensuse.org/repositories/devel:kubic:libcontainers:stable:cri-o:$VERSION /$OS /Release.key | apt-key add -
244
- curl -L https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/$OS /Release.key | apt-key add -
244
+ curl -L https://download.opensuse.org/repositories/devel:kubic:libcontainers:stable:cri-o:$VERSION /$OS /Release.key | sudo apt-key add -
245
+ curl -L https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/$OS /Release.key | sudo apt-key add -
245
246
246
- apt-get update
247
- apt-get install cri-o cri-o-runc
247
+ sudo apt-get update
248
+ sudo apt-get install cri-o cri-o-runc
248
249
```
249
250
250
251
{{% /tab %}}
@@ -269,14 +270,14 @@ To install version 1.18.3, set `VERSION=1.18:1.18.3`.
269
270
270
271
Then run
271
272
``` shell
272
- echo " deb https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/$OS / /" > /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list
273
- echo " deb http://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable:/cri-o:/$VERSION /$OS / /" > /etc/apt/sources.list.d/devel:kubic:libcontainers:stable:cri-o:$VERSION .list
273
+ sudo echo " deb https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/$OS / /" > /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list
274
+ sudo echo " deb http://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable:/cri-o:/$VERSION /$OS / /" > /etc/apt/sources.list.d/devel:kubic:libcontainers:stable:cri-o:$VERSION .list
274
275
275
- curl -L https://download.opensuse.org/repositories/devel:kubic:libcontainers:stable:cri-o:$VERSION /$OS /Release.key | apt-key add -
276
- curl -L https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/$OS /Release.key | apt-key add -
276
+ curl -L https://download.opensuse.org/repositories/devel:kubic:libcontainers:stable:cri-o:$VERSION /$OS /Release.key | sudo apt-key add -
277
+ curl -L https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/$OS /Release.key | sudo apt-key add -
277
278
278
- apt-get update
279
- apt-get install cri-o cri-o-runc
279
+ sudo apt-get update
280
+ sudo apt-get install cri-o cri-o-runc
280
281
```
281
282
{{% /tab %}}
282
283
@@ -299,9 +300,9 @@ To install version 1.18.3, set `VERSION=1.18:1.18.3`.
299
300
300
301
Then run
301
302
``` shell
302
- curl -L -o /etc/yum.repos.d/devel:kubic:libcontainers:stable.repo https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/$OS /devel:kubic:libcontainers:stable.repo
303
- curl -L -o /etc/yum.repos.d/devel:kubic:libcontainers:stable:cri-o:$VERSION .repo https://download.opensuse.org/repositories/devel:kubic:libcontainers:stable:cri-o:$VERSION /$OS /devel:kubic:libcontainers:stable:cri-o:$VERSION .repo
304
- yum install cri-o
303
+ sudo curl -L -o /etc/yum.repos.d/devel:kubic:libcontainers:stable.repo https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/$OS /devel:kubic:libcontainers:stable.repo
304
+ sudo curl -L -o /etc/yum.repos.d/devel:kubic:libcontainers:stable:cri-o:$VERSION .repo https://download.opensuse.org/repositories/devel:kubic:libcontainers:stable:cri-o:$VERSION /$OS /devel:kubic:libcontainers:stable:cri-o:$VERSION .repo
305
+ sudo yum install cri-o
305
306
```
306
307
307
308
{{% /tab %}}
@@ -318,14 +319,14 @@ Set `$VERSION` to the CRI-O version that matches your Kubernetes version.
318
319
For instance, if you want to install CRI-O 1.18, ` VERSION=1.18 `
319
320
You can find available versions with:
320
321
``` shell
321
- dnf module list cri-o
322
+ sudo dnf module list cri-o
322
323
```
323
324
CRI-O does not support pinning to specific releases on Fedora.
324
325
325
326
Then run
326
327
``` shell
327
- dnf module enable cri-o:$VERSION
328
- dnf install cri-o
328
+ sudo dnf module enable cri-o:$VERSION
329
+ sudo dnf install cri-o
329
330
```
330
331
331
332
{{% /tab %}}
@@ -334,8 +335,8 @@ dnf install cri-o
334
335
### Start CRI-O
335
336
336
337
``` shell
337
- systemctl daemon-reload
338
- systemctl start crio
338
+ sudo systemctl daemon-reload
339
+ sudo systemctl start crio
339
340
```
340
341
341
342
Refer to the [ CRI-O installation guide] ( https://github.com/kubernetes-sigs/cri-o#getting-started )
@@ -350,22 +351,22 @@ Use the following commands to install Containerd on your system:
350
351
### Prerequisites
351
352
352
353
``` shell
353
- cat > /etc/modules-load.d/containerd.conf << EOF
354
+ cat << EOF | sudo tee /etc/modules-load.d/containerd.conf
354
355
overlay
355
356
br_netfilter
356
357
EOF
357
358
358
- modprobe overlay
359
- modprobe br_netfilter
359
+ sudo modprobe overlay
360
+ sudo modprobe br_netfilter
360
361
361
362
# Setup required sysctl params, these persist across reboots.
362
- cat > /etc/sysctl.d/99-kubernetes-cri.conf << EOF
363
+ cat << EOF | sudo tee /etc/sysctl.d/99-kubernetes-cri.conf
363
364
net.bridge.bridge-nf-call-iptables = 1
364
365
net.ipv4.ip_forward = 1
365
366
net.bridge.bridge-nf-call-ip6tables = 1
366
367
EOF
367
368
368
- sysctl --system
369
+ sudo sysctl --system
369
370
```
370
371
371
372
### Install containerd
@@ -377,36 +378,36 @@ sysctl --system
377
378
# (Install containerd)
378
379
# # Set up the repository
379
380
# ## Install packages to allow apt to use a repository over HTTPS
380
- apt-get update && apt-get install -y apt-transport-https ca-certificates curl software-properties-common
381
+ sudo apt-get update && sudo apt-get install -y apt-transport-https ca-certificates curl software-properties-common
381
382
```
382
383
383
384
``` shell
384
385
# # Add Docker's official GPG key
385
- curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -
386
+ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
386
387
```
387
388
388
389
``` shell
389
390
# # Add Docker apt repository.
390
- add-apt-repository \
391
+ sudo add-apt-repository \
391
392
" deb [arch=amd64] https://download.docker.com/linux/ubuntu \
392
393
$( lsb_release -cs) \
393
394
stable"
394
395
```
395
396
396
397
``` shell
397
398
# # Install containerd
398
- apt-get update && apt-get install -y containerd.io
399
+ sudo apt-get update && sudo apt-get install -y containerd.io
399
400
```
400
401
401
402
``` shell
402
403
# Configure containerd
403
- mkdir -p /etc/containerd
404
- containerd config default > /etc/containerd/config.toml
404
+ sudo mkdir -p /etc/containerd
405
+ sudo containerd config default > /etc/containerd/config.toml
405
406
```
406
407
407
408
``` shell
408
409
# Restart containerd
409
- systemctl restart containerd
410
+ sudo systemctl restart containerd
410
411
```
411
412
{{% /tab %}}
412
413
{{% tab name="CentOS/RHEL 7.4+" %}}
@@ -415,30 +416,30 @@ systemctl restart containerd
415
416
# (Install containerd)
416
417
# # Set up the repository
417
418
# ## Install required packages
418
- yum install -y yum-utils device-mapper-persistent-data lvm2
419
+ sudo yum install -y yum-utils device-mapper-persistent-data lvm2
419
420
```
420
421
421
422
``` shell
422
423
# # Add docker repository
423
- yum-config-manager \
424
+ sudo yum-config-manager \
424
425
--add-repo \
425
426
https://download.docker.com/linux/centos/docker-ce.repo
426
427
```
427
428
428
429
``` shell
429
430
# # Install containerd
430
- yum update -y && yum install -y containerd.io
431
+ sudo yum update -y && sudo yum install -y containerd.io
431
432
```
432
433
433
434
``` shell
434
435
# # Configure containerd
435
- mkdir -p /etc/containerd
436
- containerd config default > /etc/containerd/config.toml
436
+ sudo mkdir -p /etc/containerd
437
+ sudo containerd config default > /etc/containerd/config.toml
437
438
```
438
439
439
440
``` shell
440
441
# Restart containerd
441
- systemctl restart containerd
442
+ sudo systemctl restart containerd
442
443
```
443
444
{{% /tab %}}
444
445
{{% tab name="Windows (PowerShell)" %}}
0 commit comments