mirror of
https://github.com/kubernetes-sigs/kind.git
synced 2025-11-30 23:16:04 +07:00
Bumps the actions group with 2 updates: [actions/upload-artifact](https://github.com/actions/upload-artifact) and [actions/setup-go](https://github.com/actions/setup-go). Updates `actions/upload-artifact` from 4.6.1 to 4.6.2 - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](4cec3d8aa0...ea165f8d65) Updates `actions/setup-go` from 5.3.0 to 5.4.0 - [Release notes](https://github.com/actions/setup-go/releases) - [Commits](f111f3307d...0aaccfd150) --- updated-dependencies: - dependency-name: actions/upload-artifact dependency-type: direct:production update-type: version-update:semver-patch dependency-group: actions - dependency-name: actions/setup-go dependency-type: direct:production update-type: version-update:semver-minor dependency-group: actions ... Signed-off-by: dependabot[bot] <support@github.com>
108 lines
3.5 KiB
YAML
108 lines
3.5 KiB
YAML
name: Nerdctl
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
pull_request:
|
|
branches:
|
|
- main
|
|
paths-ignore:
|
|
- 'site/**'
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
nerdctl:
|
|
name: Nerdctl
|
|
runs-on: ubuntu-22.04
|
|
timeout-minutes: 30
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
ipFamily: [ipv4, ipv6]
|
|
deployment: [singleNode, multiNode]
|
|
exclude:
|
|
- ipFamily: ipv6
|
|
env:
|
|
JOB_NAME: "nerdctl-${{ matrix.deployment }}-${{ matrix.ipFamily }}"
|
|
IP_FAMILY: ${{ matrix.ipFamily }}
|
|
NERDCTL_VERSION: "2.0.2"
|
|
KIND_EXPERIMENTAL_PROVIDER: "nerdctl"
|
|
steps:
|
|
- name: Check out code into the Go module directory
|
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
|
|
|
- uses: ./.github/actions/setup-env
|
|
|
|
- name: Install nerdctl
|
|
run: |
|
|
# Remove Docker and Podman
|
|
sudo systemctl is-active --quiet docker.service || systemctl stop docker.service
|
|
sudo apt-get remove -y docker-ce docker-ce-cli podman containerd.io
|
|
sudo rm -rf /etc/systemd/system/containerd.service # clean up the cotnainerd systemd file
|
|
# Install nerdctl full package
|
|
sudo curl -sSL https://github.com/containerd/nerdctl/releases/download/v${NERDCTL_VERSION}/nerdctl-full-${NERDCTL_VERSION}-linux-amd64.tar.gz | sudo tar -xvz -C /usr/local
|
|
# Start Containerd
|
|
sudo systemctl daemon-reload
|
|
sudo systemctl enable --now containerd
|
|
# Show Versions
|
|
sudo ctr version
|
|
sudo nerdctl version
|
|
|
|
- name: Create single node cluster
|
|
if: ${{ matrix.deployment == 'singleNode' }}
|
|
run: |
|
|
cat <<EOF | sudo /usr/local/bin/kind create cluster -v7 --wait 1m --retain --config=-
|
|
kind: Cluster
|
|
apiVersion: kind.x-k8s.io/v1alpha4
|
|
networking:
|
|
ipFamily: ${IP_FAMILY}
|
|
EOF
|
|
|
|
- name: Create multi node cluster
|
|
if: ${{ matrix.deployment == 'multiNode' }}
|
|
run: |
|
|
cat <<EOF | sudo /usr/local/bin/kind create cluster -v7 --wait 1m --retain --config=-
|
|
kind: Cluster
|
|
apiVersion: kind.x-k8s.io/v1alpha4
|
|
networking:
|
|
ipFamily: ${IP_FAMILY}
|
|
nodes:
|
|
- role: control-plane
|
|
- role: worker
|
|
- role: worker
|
|
EOF
|
|
|
|
- name: Get Cluster status
|
|
run: |
|
|
# wait network is ready
|
|
sudo kubectl wait --for=condition=ready pods --namespace=kube-system -l k8s-app=kube-dns
|
|
sudo kubectl get nodes -o wide
|
|
sudo kubectl get pods -A
|
|
|
|
# TODO: similar to podman, this fails because the imageID() code in KinD is hardcoded to run a docker command
|
|
# need to solve this code before this test will work properly
|
|
- name: Load nerdctl image
|
|
run: |
|
|
sudo nerdctl pull busybox
|
|
sudo /usr/local/bin/kind load docker-image busybox
|
|
continue-on-error: true
|
|
|
|
- name: Export logs
|
|
if: always()
|
|
run: |
|
|
sudo find /etc/cni/net.d/ -type f -exec sh -c 'echo "{}" && cat "{}"' \;
|
|
sudo mkdir -p /tmp/kind/logs
|
|
sudo /usr/local/bin/kind export logs /tmp/kind/logs
|
|
sudo chown -R $USER:$USER /tmp/kind/logs
|
|
|
|
- name: Upload logs
|
|
if: always()
|
|
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
|
with:
|
|
name: kind-logs-${{ env.JOB_NAME }}-${{ github.run_id }}
|
|
path: /tmp/kind/logs
|
|
|
|
- name: Delete cluster
|
|
run: sudo /usr/local/bin/kind delete cluster
|