Building Kind - linux-on-ibm-z/docs GitHub Wiki
Building Kind
The instructions provided below specify the steps to build Kind 0.31.0 on Linux on IBM Z for the following distributions:
- RHEL (8.10, 9.4, 9.6, 9.7)
- SLES (15 SP7)
- Ubuntu (22.04, 24.04, 25.10)
General Notes:
-
When following the steps below please use a standard permission user unless otherwise specified.
-
A directory
/<source_root>/will be referred to in these instructions, this is a temporary writable directory anywhere you'd like to place it.
Note: Kind(0.31.0) was verified with docker version 29.2.1 at the time of creation of these instructions.
1. Build environment set up
- Ensure the current user belongs to group
docker:
Use the below command to add group docker if it does not exist:
sudo groupadd docker
Use the below command to add current user to group docker if it has not been done:
sudo usermod -aG docker $USER && newgrp docker
2. Build using script
If you want to build Kind using manual steps, go to STEP 3.
Use the following commands to build Kind using the build script. Please make sure you have wget installed.
wget https://raw.githubusercontent.com/linux-on-ibm-z/scripts/master/Kind/0.31.0/build_kind.sh
# Build Kind
bash build_kind.sh [Provide -t option for executing build with tests]
If the build and tests complete successfully, go to STEP 6. In case of error, check logs at <source_root>/logs/ for more details or go to STEP 3 to follow manual build steps.
3. Install Dependencies
export SOURCE_ROOT=/<source_root>/
export PATCH_URL="https://raw.githubusercontent.com/linux-on-ibm-z/scripts/master/Kind/0.31.0/patch"
3.1. Install Basic Dependencies
-
RHEL (8.10, 9.4, 9.6, 9.7)
sudo yum remove -y podman buildah sudo yum install -y yum-utils sudo yum-config-manager --add-repo https://download.docker.com/linux/rhel/docker-ce.repo sudo yum install -y curl git make wget tar gcc glibc.s390x docker-ce docker-ce-cli containerd.io make which patch export CC=gcc -
SLES 15 SP7
sudo zypper install -y curl git make wget tar gcc glibc-devel-static make which patch docker containerd docker-buildx export CC=gcc -
Ubuntu (22.04, 24.04, 25.10)
sudo apt-get update sudo apt-get install -y ca-certificates curl gnupg sudo install -m 0755 -d /etc/apt/keyrings curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg sudo chmod a+r /etc/apt/keyrings/docker.gpg echo \ "deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \ "$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | sudo tee /etc/apt/sources.list.d/docker.list >/dev/null sudo apt-get update sudo apt-get install -y patch git curl make tar gcc wget make docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin clang
4. Build Kind binary and images
4.1. Start docker service
sudo service docker start
4.2. Download Kind source code and apply patches
cd $SOURCE_ROOT
git clone -b v0.31.0 https://github.com/kubernetes-sigs/kind.git
cd $SOURCE_ROOT/kind
curl -s $PATCH_URL/kind.patch | git apply --ignore-whitespace -
4.3. Build Kind binaries
cd $SOURCE_ROOT/kind
make build
export PATH=${SOURCE_ROOT}/kind/bin:$PATH
4.4. Build Kind images
cd $SOURCE_ROOT/kind
make -C images/base quick REGISTRY=kindest
make -C images/kindnetd REGISTRY=kindest TAG=v20251212-v0.29.0-alpha-105-g20ccfc88 quick
make -C images/local-path-provisioner REGISTRY=kindest TAG=v20251212-v0.29.0-alpha-105-g20ccfc88 quick
5. Testing (Optional)
cd $SOURCE_ROOT/kind
make test
make unit
make integration
6. Verification
6.1. Build cross image
Note: REGISTRY is set to local by default for local builds; replace local with your preferred registry if you want to push images to a specific registry.
cd $SOURCE_ROOT
git clone -b v0.19.0 https://github.com/kubernetes/release.git
cd release
curl -s $PATCH_URL/release.patch | git apply --ignore-whitespace -
export REGISTRY=local
docker buildx inspect
cd images/build/cross/
TARGETPLATFORM=s390x make container
6.2. Build Node image
cd $SOURCE_ROOT
git clone -b v1.35.1 https://github.com/kubernetes/kubernetes.git
cd kubernetes
sed -i 's,v1.35.0-go1.25.6-bullseye.0,v1.35.0-go1.25.6-bookworm.0,g' build/build-image/cross/VERSION
docker buildx use default
KUBE_CROSS_IMAGE=${REGISTRY}/kube-cross-s390x kind build node-image
docker tag kindest/node:latest ${REGISTRY}/kindest/node:latest
6.3. Create K8s cluster
kind create cluster --image=${REGISTRY}/kindest/node:latest
6.4. Load Kind images
kind load docker-image kindest/kindnetd:v20251212-v0.29.0-alpha-105-g20ccfc88
kind load docker-image kindest/local-path-provisioner:v20251212-v0.29.0-alpha-105-g20ccfc88
Following example shows logs for a successful cluster creation:
Creating cluster "kind" ...
â Ensuring node image (kindest/node:latest) đŧ
â Preparing nodes đĻ
â Writing configuration đ
â Starting control-plane đšī¸
â Installing CNI đ
â Installing StorageClass đž
Set kubectl context to "kind-kind"
You can now use your cluster with:
kubectl cluster-info --context kind-kind
Thanks for using kind! đ
Following pods are expected after successful cluster creation:
NAMESPACE NAME READY STATUS RESTARTS AGE
kube-system coredns-7d764666f9-6rs8x 1/1 Running 0 24s
kube-system coredns-7d764666f9-v4c9c 1/1 Running 0 24s
kube-system etcd-kind-control-plane 1/1 Running 0 32s
kube-system kindnet-rmzv8 1/1 Running 0 24s
kube-system kube-apiserver-kind-control-plane 1/1 Running 0 32s
kube-system kube-controller-manager-kind-control-plane 1/1 Running 0 32s
kube-system kube-proxy-qkthw 1/1 Running 0 24s
kube-system kube-scheduler-kind-control-plane 1/1 Running 0 32s
local-path-storage local-path-provisioner-67b8995b4b-hlcqf 1/1 Running 0 24s