-
Notifications
You must be signed in to change notification settings - Fork 2.7k
/
Copy pathinit.yaml
31 lines (23 loc) · 1.69 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
#cloud-config
runcmd:
- echo "Test run from /tmp folder, remounting it"
- mount /tmp /tmp -o remount,exec,suid
- echo "This will configure built-in containerd for k8s tests. Containerd version is:"
- ctr version # current version of containerd
- echo "Download and install CNI configuration to /home/containerd"
- mkdir -p /home/containerd
- mount --bind /home/containerd /home/containerd
- mount -o remount,exec /home/containerd
- 'curl --fail --retry 5 --retry-delay 3 --silent --show-error -H "X-Google-Metadata-Request: True" -o /home/containerd/cni.template http://metadata.google.internal/computeMetadata/v1/instance/attributes/cni-template'
- echo "Download and install CNI to /home/containerd"
- 'curl -sSL --fail --retry 5 --retry-delay 3 --silent --show-error -o /home/containerd/cni.tgz https://storage.googleapis.com/k8s-artifacts-cni/release/v1.0.1/cni-plugins-linux-amd64-v1.0.1.tgz'
- tar xzf /home/containerd/cni.tgz -C /home/containerd --overwrite
- echo "Set containerd configuration"
- mkdir -p /etc/containerd
- 'curl --fail --retry 5 --retry-delay 3 --silent --show-error -H "X-Google-Metadata-Request: True" -o /etc/containerd/config.toml http://metadata.google.internal/computeMetadata/v1/instance/attributes/containerd-config'
- echo "Set containerd registry configurations"
- mkdir -p /etc/containerd/certs.d/docker.io
- 'curl --fail --retry 5 --retry-delay 3 --silent --show-error -H "X-Google-Metadata-Request: True" -o /etc/containerd/certs.d/docker.io/hosts.toml http://metadata.google.internal/computeMetadata/v1/instance/attributes/registry-config-docker'
- echo "Restarting containerd"
- systemctl restart containerd
- echo "Configuration complete"