Skip to content

Commit fd097ba

Browse files
authored
Merge pull request #7 from fluxcd/build-kind-node
Publish Kubernetes KinD node images for AMD46/ARM64
2 parents b368bb1 + 8900f0f commit fd097ba

File tree

1 file changed

+94
-0
lines changed

1 file changed

+94
-0
lines changed

.github/workflows/build-kind.yaml

+94
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
name: build-kind
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
description: 'Kubernetes version'
8+
default: 'v1.30.0'
9+
required: true
10+
11+
permissions:
12+
contents: read
13+
14+
jobs:
15+
k8s-node-amd64:
16+
runs-on:
17+
group: "Default Larger Runners"
18+
labels: ubuntu-latest-16-cores
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v4
22+
- name: Prepare
23+
id: prep
24+
run: |
25+
VERSION="${{ github.event.inputs.version }}"
26+
if [[ -z "$VERSION" ]]; then
27+
VERSION="v1.27.13"
28+
fi
29+
echo "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_OUTPUT
30+
echo "VERSION=${VERSION}" >> $GITHUB_OUTPUT
31+
- name: Setup Go
32+
uses: actions/setup-go@v5
33+
with:
34+
go-version: 1.22.x
35+
- name: Checkout
36+
uses: actions/checkout@v4
37+
with:
38+
repository: kubernetes/kubernetes
39+
ref: ${{ steps.prep.outputs.VERSION }}
40+
path: kubernetes
41+
- name: Build node image
42+
run: |
43+
cd $GITHUB_WORKSPACE/kubernetes
44+
kind build node-image
45+
- name: Login to GitHub Container Registry
46+
uses: docker/login-action@v3
47+
with:
48+
registry: ghcr.io
49+
username: fluxcdbot
50+
password: ${{ secrets.GHCR_TOKEN }}
51+
- name: Push node image
52+
run: |
53+
docker tag kindest/node:latest ghcr.io/fluxcd/kindest/node:${{ steps.prep.outputs.VERSION }}-amd64
54+
docker push ghcr.io/fluxcd/kindest/node:${{ steps.prep.outputs.VERSION }}-amd64
55+
k8s-node-arm64:
56+
# Hosted on Equinix
57+
# Docs: https://github.com/fluxcd/flux2/tree/main/.github/runners
58+
runs-on: [self-hosted, Linux, ARM64, equinix]
59+
steps:
60+
- name: Checkout
61+
uses: actions/checkout@v4
62+
- name: Prepare
63+
id: prep
64+
run: |
65+
VERSION="${{ github.event.inputs.version }}"
66+
if [[ -z "$VERSION" ]]; then
67+
VERSION="v1.27.13"
68+
fi
69+
echo "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_OUTPUT
70+
echo "VERSION=${VERSION}" >> $GITHUB_OUTPUT
71+
- name: Setup Go
72+
uses: actions/setup-go@v5
73+
with:
74+
go-version: 1.22.x
75+
- name: Checkout
76+
uses: actions/checkout@v4
77+
with:
78+
repository: kubernetes/kubernetes
79+
ref: ${{ steps.prep.outputs.VERSION }}
80+
path: kubernetes
81+
- name: Build node image
82+
run: |
83+
cd $GITHUB_WORKSPACE/kubernetes
84+
kind build node-image
85+
- name: Login to GitHub Container Registry
86+
uses: docker/login-action@v3
87+
with:
88+
registry: ghcr.io
89+
username: fluxcdbot
90+
password: ${{ secrets.GHCR_TOKEN }}
91+
- name: Push node image
92+
run: |
93+
docker tag kindest/node:latest ghcr.io/fluxcd/kindest/node:${{ steps.prep.outputs.VERSION }}-arm64
94+
docker push ghcr.io/fluxcd/kindest/node:${{ steps.prep.outputs.VERSION }}-arm64

0 commit comments

Comments
 (0)