File: docker.yaml

package info (click to toggle)
kind 0.30.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,392 kB
  • sloc: sh: 1,900; makefile: 97; javascript: 55; xml: 9
file content (84 lines) | stat: -rw-r--r-- 2,361 bytes parent folder | download
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
74
75
76
77
78
79
80
81
82
83
84
name: Docker

on:
  workflow_dispatch:
  pull_request:
    branches:
      - main
    paths-ignore:
      - 'site/**'

permissions:
  contents: read

jobs:
  docker:
    name: Docker
    runs-on: ubuntu-24.04
    timeout-minutes: 30
    strategy:
      fail-fast: false
      matrix:
        ipFamily: [ipv4, ipv6]
        deployment: [singleNode, multiNode]
    env:
      JOB_NAME: "docker-${{ matrix.deployment }}-${{ matrix.ipFamily }}"
      IP_FAMILY: ${{ matrix.ipFamily }}
    steps:
      - name: Check out code into the Go module directory
        uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0

      - uses: ./.github/actions/setup-env

      - name: Create single node cluster
        if: ${{ matrix.deployment == 'singleNode' }}
        run: |
          cat <<EOF | /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 | /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
          kubectl wait --for=condition=ready pods --namespace=kube-system -l k8s-app=kube-dns
          kubectl get nodes -o wide
          kubectl get pods -A

      - name: Load docker image
        run: |
          docker pull busybox
          /usr/local/bin/kind load docker-image busybox

      - name: Export logs
        if: always()
        run: |
          mkdir -p /tmp/kind/logs
          /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: /usr/local/bin/kind delete cluster