Skip to content

Commit

Permalink
Build kind-node images from latest base image
Browse files Browse the repository at this point in the history
  • Loading branch information
kishen-v committed Jun 26, 2024
1 parent 3c321c3 commit fa2b48c
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 20 deletions.
43 changes: 25 additions & 18 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,19 @@ on:
pull_request:
branches: [ "main", 'v*.*.*' ]

env:
# Use docker.io for Docker Hub if empty
REGISTRY: quay.io
# github.repository as <account>/<repo>
IMAGE_NAME: powercloud/kind-node


jobs:
build:
runs-on: ubuntu-latest
permissions:
packages: write
strategy:
fail-fast: false
matrix:
version: ["master"]
env:
# Use docker.io for Docker Hub if empty
REGISTRY: quay.io
# github.repository as <account>/<repo>
IMAGE_NAME: powercloud/kind-node


steps:
- name: Checkout repository
Expand All @@ -54,22 +51,32 @@ jobs:
run: |
KIND_VERSION=$(cat KIND_VERSION)
BASE_IMAGE=$(cat BASE_IMAGE)
KUBERNETES_VERSION=$(curl -Ls https://dl.k8s.io/release/stable.txt)
echo "KIND_VERSION=$KIND_VERSION" >> $GITHUB_ENV
echo "BASE_IMAGE=$BASE_IMAGE" >> $GITHUB_ENV
echo "KUBERNETES_VERSION=$KUBERNETES_VERSION" >> $GITHUB_ENV
- name: Install kind
- name: Build and install kind - ${{ env.KIND_VERSION }}
run: |
curl -Lo ./kind https://kind.sigs.k8s.io/dl/${{ env.KIND_VERSION }}/kind-linux-amd64
chmod +x ./kind
sudo mv ./kind /usr/local/bin/kind
# The runner has kind pre-installed, removing the same to download the preferred version.
rm -rf $(which kind)
echo $GOPATH
git clone --depth 1 --branch ${{ env.KIND_VERSION }} https://github.com/kubernetes-sigs/kind.git
pushd kind
git apply ../build-ppc64le.patch
popd
make -C kind install
mv /home/runner/go/bin/kind /usr/local/bin/
kind version
- name: Build kind image
- name: Build kind-node image - ${{ env.KUBERNETES_VERSION }}
run: |
mkdir -p tmp/kubernetes
git clone --single-branch --branch ${{ matrix.version }} https://github.com/kubernetes/kubernetes tmp/kubernetes
kind build node-image $PWD/tmp/kubernetes --arch ppc64le --image ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ matrix.version }} --base-image ${{ env.BASE_IMAGE }}
git clone --single-branch --filter=tree:0 --branch ${{ env.KUBERNETES_VERSION }} https://github.com/kubernetes/kubernetes tmp/kubernetes
kind build node-image $PWD/tmp/kubernetes --arch ppc64le --image ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.KUBERNETES_VERSION}} --base-image ${{ env.BASE_IMAGE }}
- name: Publish image
- name: Publish node image
if: github.event_name != 'pull_request'
run: |
docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ matrix.version }}
docker image tag ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.KUBERNETES_VERSION }} ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
docker push --all-tags ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
2 changes: 1 addition & 1 deletion BASE_IMAGE
Original file line number Diff line number Diff line change
@@ -1 +1 @@
docker.io/kindest/base:v20230310-474355fc
quay.io/powercloud/kind-base:v20240626-0296c52
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# kind-image
Kind-node image for the PowerPC architecture.

Images are hosted at https://quay.io/repository/powercloud/kind-node?tab=tags and can be used as follows:

```shell
$ kind create cluster --image quay.io/powercloud/kind-node:v1.25.0
$ kind create cluster --image quay.io/powercloud/kind-node:latest
```
41 changes: 41 additions & 0 deletions build-ppc64le.patch
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,44 @@ index f8226e1..dc9980f 100755
*)
exit 1 ;;
esac
diff --git a/pkg/build/nodeimage/const_cni.go b/pkg/build/nodeimage/const_cni.go
index 6715884..f7a8e88 100644
--- a/pkg/build/nodeimage/const_cni.go
+++ b/pkg/build/nodeimage/const_cni.go
@@ -20,7 +20,7 @@ package nodeimage
The default CNI manifest and images are our own tiny kindnet
*/

-const kindnetdImage = "docker.io/kindest/kindnetd:v20240513-cd2ac642"
+const kindnetdImage = "quay.io/powercloud/kind-kindnetd:v20240626-0296c52"

var defaultCNIImages = []string{kindnetdImage}

diff --git a/pkg/build/nodeimage/const_storage.go b/pkg/build/nodeimage/const_storage.go
index 7ddb8a6..03815e0 100644
--- a/pkg/build/nodeimage/const_storage.go
+++ b/pkg/build/nodeimage/const_storage.go
@@ -25,8 +25,8 @@ NOTE: we have customized it in the following ways:
- install as the default storage class
*/

-const storageProvisionerImage = "docker.io/kindest/local-path-provisioner:v20240513-b9bba138"
-const storageHelperImage = "docker.io/kindest/local-path-helper:v20230510-486859a6"
+const storageProvisionerImage = "quay.io/powercloud/kind-local-path-provisioner:v20240626-0296c52"
+const storageHelperImage = "quay.io/powercloud/kind-local-path-helper:v20240626-0296c52"

// image we need to preload
var defaultStorageImages = []string{storageProvisionerImage, storageHelperImage}
diff --git a/pkg/cluster/internal/loadbalancer/const.go b/pkg/cluster/internal/loadbalancer/const.go
index 3600b33..e84bf8c 100644
--- a/pkg/cluster/internal/loadbalancer/const.go
+++ b/pkg/cluster/internal/loadbalancer/const.go
@@ -17,7 +17,7 @@ limitations under the License.
package loadbalancer

// Image defines the loadbalancer image:tag
-const Image = "docker.io/kindest/haproxy:v20230606-42a2262b"
+const Image = "quay.io/powercloud/kind-haproxy:v20240626-0296c52"

// ConfigPath defines the path to the config file in the image
const ConfigPath = "/usr/local/etc/haproxy/haproxy.cfg"

0 comments on commit fa2b48c

Please sign in to comment.