-
Notifications
You must be signed in to change notification settings - Fork 3.3k
/
init.yaml
73 lines (64 loc) · 2.43 KB
/
init.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#cloud-config
write_files:
- path: /etc/systemd/system/containerd-installation.service
permissions: 0644
owner: root
content: |
# installed by cloud-init
[Unit]
Description=Download and install containerd binaries and configurations.
After=network-online.target
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStartPre=/bin/mkdir -p /home/containerd
ExecStartPre=/bin/mount --bind /home/containerd /home/containerd
ExecStartPre=/bin/mount -o remount,exec /home/containerd
ExecStartPre=/usr/bin/curl --fail --retry 5 --retry-delay 3 --silent --show-error -H "X-Google-Metadata-Request: True" -o /home/containerd/configure.sh http://metadata.google.internal/computeMetadata/v1/instance/attributes/containerd-configure-sh
ExecStartPre=/bin/chmod 544 /home/containerd/configure.sh
ExecStart=/home/containerd/configure.sh
[Install]
WantedBy=containerd.target
- path: /etc/systemd/system/containerd.service
permissions: 0644
owner: root
content: |
# installed by cloud-init
[Unit]
Description=containerd container runtime
Documentation=https://containerd.io
After=containerd-installation.service
[Service]
Restart=always
RestartSec=5
Delegate=yes
KillMode=process
OOMScoreAdjust=-999
LimitNOFILE=1048576
# Having non-zero Limit*s causes performance problems due to accounting overhead
# in the kernel. We recommend using cgroups to do container-local accounting.
LimitNPROC=infinity
LimitCORE=infinity
TasksMax=infinity
ExecStartPre=/sbin/modprobe overlay
ExecStart=/home/containerd/usr/local/bin/containerd
[Install]
WantedBy=containerd.target
- path: /etc/systemd/system/containerd.target
permissions: 0644
owner: root
content: |
[Unit]
Description=Containerd
[Install]
WantedBy=multi-user.target
runcmd:
# Stop the existing containerd service if there is one. (for Docker 18.09+)
- systemctl is-active containerd && systemctl stop containerd
- systemctl daemon-reload
- systemctl enable containerd-installation.service
- systemctl enable containerd.service
- systemctl enable containerd.target
- systemctl start containerd.target
# Start docker after containerd is running. (for Docker 18.09+)
- systemctl is-enabled docker && (systemctl is-active docker || systemctl start docker)