k8s.io/test-infra@v0.0.0-20240520184403-27c6b4c223d8/jobs/e2e_node/dra/init-containerd-1.7.yaml (about)

     1  #cloud-config
     2  
     3  write_files:
     4  - content: |
     5      {
     6        "cniVersion": "0.2.0",
     7        "name": "mynet",
     8        "type": "bridge",
     9        "bridge": "cni0",
    10        "isGateway": true,
    11        "ipMasq": true,
    12        "ipam": {
    13          "type": "host-local",
    14          "subnet": "10.22.0.0/16",
    15          "routes": [
    16            { "dst": "0.0.0.0/0" }
    17          ]
    18        }
    19      }
    20    path: /etc/cni/net.d/10-mynet.conf
    21  
    22  runcmd:
    23    - echo "The test runs from /tmp folder, remounting it so that it can run executable."
    24    - mount /tmp /tmp -o remount,exec,suid
    25  
    26    - echo "This will install and configure containerd 1.7 for DRA tests"
    27  
    28    - echo "Stopping containerd"
    29    - systemctl stop containerd
    30  
    31    - echo "Download and install CNI plugins"
    32    - mkdir -p /tmp/containerd
    33    - 'curl -sSL --fail --retry 5 --retry-delay 3 --silent --show-error -o /tmp/containerd/cni.tgz https://storage.googleapis.com/k8s-artifacts-cni/release/v1.0.1/cni-plugins-linux-amd64-v1.0.1.tgz'
    34    - mkdir -p /opt/cni/bin
    35    - tar xzf /tmp/containerd/cni.tgz -C /opt/cni/bin --overwrite
    36  
    37    - echo "Download and install Containerd 1.7"
    38    - 'curl -sSL --fail --retry 5 --retry-delay 3 --silent --show-error -o /tmp/containerd/containerd.tgz https://github.com/containerd/containerd/releases/download/v1.7.5/containerd-1.7.5-linux-amd64.tar.gz'
    39    - tar xzf /tmp/containerd/containerd.tgz -C /usr --overwrite
    40  
    41    - echo "Configure Containerd"
    42    - mkdir -p /etc/containerd
    43    - containerd config default > /etc/containerd/config.toml
    44    - echo "Enabling CDI"
    45    - sed -ie 's/enable_cdi = false/enable_cdi = true/' /etc/containerd/config.toml
    46  
    47    - echo "Restarting containerd"
    48    - systemctl daemon-reload
    49    - systemctl restart containerd
    50  
    51    - echo "Containerd version is:"
    52    - ctr version
    53  
    54    - echo "Configuration complete"