Skip to content

Add healthzBindAddress parameter to kubeProxy conf#7384

Open
dodgex wants to merge 1 commit intok0sproject:mainfrom
dodgex:make-healthzbindaddress-configurable
Open

Add healthzBindAddress parameter to kubeProxy conf#7384
dodgex wants to merge 1 commit intok0sproject:mainfrom
dodgex:make-healthzbindaddress-configurable

Conversation

@dodgex
Copy link
Copy Markdown

@dodgex dodgex commented Apr 3, 2026

Description

Prior to this the value was hardcoded to an empty string.

As kubeproxy ignores the related commandline argument when a config file is present, this option was not configurable otherwise.

Fixes: #7363

The changes are made to mirror changes of #2378.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

How Has This Been Tested?

  • Manual test
  • Auto test added

make lint failed, unable to find golang.sh to check whats wrong

0.201 + git apply
0.202 error: patch failed: hack/lib/golang.sh:27
0.202 error: hack/lib/golang.sh: patch does not apply
0.202 error: patch failed: hack/lib/util.sh:185
0.202 error: hack/lib/util.sh: patch does not apply

unfortunately the same for make build && git diff --exit-code and the other commands mentioned in https://docs.k0sproject.io/stable/contributors/testing/

Checklist

  • My code follows the style guidelines of this project
  • My commit messages are signed-off
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules
  • I have checked my code and corrected any misspellings

Copy link
Copy Markdown
Member

@twz123 twz123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Can you add the new field to docs/configuration.md, too, in the spec.network.kubeProxy section? (Maybe also add the missing metricsBindAddress?)

@twz123
Copy link
Copy Markdown
Member

twz123 commented Apr 7, 2026

Given that kube-proxy has health endpoints, I wonder if it would make sense to add readiness and liveness probes to the DaemonSet? 🤔

Are other distros doing this?

@dodgex dodgex force-pushed the make-healthzbindaddress-configurable branch from 188f8d6 to c2baff3 Compare April 7, 2026 18:21
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 7, 2026

This pull request has merge conflicts that need to be resolved.

@dodgex dodgex force-pushed the make-healthzbindaddress-configurable branch from c2baff3 to 9f830e1 Compare April 7, 2026 18:28
@dodgex
Copy link
Copy Markdown
Author

dodgex commented Apr 7, 2026

I should have addressed all your comments. As the build does still not work locally, I unfortunately can't verify the results by myself. But I hope CI is now happy. :)

@twz123
Copy link
Copy Markdown
Member

twz123 commented Apr 8, 2026

You need to sign-off your commit using git commit --signoff with the same name and email address as the commit's author:

Checking commits: 08499122d2fd47681f7b894ca32a83482c365f39..9f830e15bd1d1e683723c0a75571b126031ebc97

	9f830e15bd1d1e683723c0a75571b126031ebc97
	dodgex <git@kujanssen.de>
	Add healthzBindAddress parameter to kubeProxy conf
	Prior to this the value was hardcoded to an empty string.
	As kubeproxy ignores the related commandline argument
	when a config file is present, this option was not configurable otherwise.
	Fixes: https://github.com/k0sproject/k0s/issues/7363
	Signed-off-by: dodgex <dodgex@users.noreply.github.com>
		found sign-off: dodgex <dodgex@users.noreply.github.com>

Missing sign-off(s):

	9f830e15bd1d1e683723c0a75571b126031ebc97
		sign-off not found for commit author: dodgex git@kujanssen.de; found: ['dodgex <dodgex@users.noreply.github.com>']

Prior to this the value was hardcoded to an empty string.

As kubeproxy ignores the related commandline argument
when a config file is present, this option was not configurable otherwise.

Fixes: k0sproject#7363

Signed-off-by: dodgex <git@kujanssen.de>
@dodgex dodgex force-pushed the make-healthzbindaddress-configurable branch from 9f830e1 to 10bf7dc Compare April 8, 2026 08:00
@dodgex
Copy link
Copy Markdown
Author

dodgex commented Apr 8, 2026

You need to sign-off your commit using git commit --signoff with the same name and email address as the commit's author:

Checking commits: 08499122d2fd47681f7b894ca32a83482c365f39..9f830e15bd1d1e683723c0a75571b126031ebc97

	9f830e15bd1d1e683723c0a75571b126031ebc97
	dodgex <git@kujanssen.de>
	Add healthzBindAddress parameter to kubeProxy conf
	Prior to this the value was hardcoded to an empty string.
	As kubeproxy ignores the related commandline argument
	when a config file is present, this option was not configurable otherwise.
	Fixes: https://github.com/k0sproject/k0s/issues/7363
	Signed-off-by: dodgex <dodgex@users.noreply.github.com>
		found sign-off: dodgex <dodgex@users.noreply.github.com>

Missing sign-off(s):

	9f830e15bd1d1e683723c0a75571b126031ebc97
		sign-off not found for commit author: dodgex git@kujanssen.de; found: ['dodgex <dodgex@users.noreply.github.com>']

Should be fixed

@twz123
Copy link
Copy Markdown
Member

twz123 commented Apr 8, 2026

make lint failed, unable to find golang.sh to check whats wrong

0.201 + git apply
0.202 error: patch failed: hack/lib/golang.sh:27
0.202 error: hack/lib/golang.sh: patch does not apply
0.202 error: patch failed: hack/lib/util.sh:185
0.202 error: hack/lib/util.sh: patch does not apply

Weird! Can you maybe upload the full terminal output? Which OS are you using?

@dodgex
Copy link
Copy Markdown
Author

dodgex commented Apr 8, 2026

Weird! Can you maybe upload the full terminal output? Which OS are you using?

$ make lint
hack/copyright.sh
make -C embedded-bins \
 TARGET_OS=linux \
 SOURCE_DATE_EPOCH=1775635219
make[1]: Entering directory '/home/dodge/projects/k0s/embedded-bins'
docker build --progress=plain --iidfile '.docker-image.kubernetes.stamp' -t k0sbuild.docker-image.kubernetes:latest --build-arg BUILDKIT_DOCKERFILE_CHECK=skip=InvalidDefaultArgInFrom --build-arg TARGET_OS=linux --build-arg CONTAINERD_BINS="containerd containerd-shim-runc-v2" --build-arg KUBERNETES_BINS="kubelet kube-apiserver kube-scheduler kube-controller-manager" --build-arg VERSION=1.35.3 --build-arg SOURCE_DATE_EPOCH=1775635219 --build-arg BUILDIMAGE=docker.io/library/golang:1.26.1-alpine3.23 --build-arg BUILD_GO_TAGS="providerless" --build-arg BUILD_GO_CGO_ENABLED= --build-arg BUILD_GO_CGO_CFLAGS='' --build-arg BUILD_SHIM_GO_CGO_ENABLED= --build-arg BUILD_GO_FLAGS="-v" --build-arg BUILD_GO_LDFLAGS=' -extldflags=-static' --build-arg BUILD_CFLAGS='' --build-arg BUILD_LDFLAGS='' --build-arg BUILD_CONFIGURE_FLAGS='' -- kubernetes/
#0 building with "default" instance using docker driver

#1 [internal] load build definition from Dockerfile
#1 transferring dockerfile: 1.91kB done
#1 DONE 0.0s

#2 [internal] load metadata for docker.io/library/golang:1.26.1-alpine3.23
#2 DONE 0.9s

#3 [internal] load .dockerignore
#3 transferring context: 2B done
#3 DONE 0.0s

#4 [build 1/7] FROM docker.io/library/golang:1.26.1-alpine3.23@sha256:2389ebfa5b7f43eeafbd6be0c3700cc46690ef842ad962f6c5bd6be49ed82039
#4 resolve docker.io/library/golang:1.26.1-alpine3.23@sha256:2389ebfa5b7f43eeafbd6be0c3700cc46690ef842ad962f6c5bd6be49ed82039 0.0s done
#4 DONE 0.0s

#5 [build 3/7] RUN mkdir -p /go/src/github.com/kubernetes/kubernetes
#5 CACHED

#6 [build 2/7] RUN if [ ! -z "$(which apt)" ]; then        apt update && apt install -y build-essential git rsync grep coreutils bash;     elif [ ! -z "$(which apk)" ]; then        apk add build-base git linux-headers rsync grep coreutils bash;     else        echo "unsupported package manager";        exit 1;     fi
#6 CACHED

#7 [build 4/7] RUN git -c advice.detachedHead=false clone -b v1.35.3 --depth=1 https://github.com/kubernetes/kubernetes.git /go/src/github.com/kubernetes/kubernetes
#7 CACHED

#8 [internal] load build context
#8 transferring context: 35B done
#8 DONE 0.0s

#9 [build 5/7] WORKDIR /go/src/github.com/kubernetes/kubernetes
#9 DONE 0.0s

#10 [build 6/7] COPY riscv64.patch .
#10 DONE 0.0s

#11 [build 7/7] RUN   set -ex;   git apply < riscv64.patch;   export GOPATH=/go;   if [ "linux" = windows ]; then     commands="kubelet kube-apiserver kube-scheduler kube-controller-manager";     binarySuffix=.exe;     export KUBE_BUILD_PLATFORMS=windows/amd64;   else     commands="kubelet kube-apiserver kube-scheduler kube-controller-manager";     binarySuffix='';   fi;   if [ 0 -eq 1 ]; then     export KUBE_CGO_OVERRIDES=$commands;   else     export KUBE_STATIC_OVERRIDES=$commands;   fi;   mkdir /out;   export SOURCE_DATE_EPOCH=1775635219;   export FORCE_HOST_GO=y;   export KUBE_VERBOSE=9;   export KUBE_GIT_TREE_STATE=clean;   export KUBE_GIT_VERSION="v1.35.3+k0s";   for cmd in $commands; do     make GOFLAGS="-v -tags=providerless" GOLDFLAGS=" -extldflags=-static" WHAT=cmd/$cmd;     mv /go/src/github.com/kubernetes/kubernetes/_output/local/bin/*/*/$cmd$binarySuffix /out/;   done
#11 0.175 + git apply
#11 0.193 error: patch failed: hack/lib/golang.sh:27
#11 0.193 error: hack/lib/golang.sh: patch does not apply
#11 0.193 error: patch failed: hack/lib/util.sh:185
#11 0.193 error: hack/lib/util.sh: patch does not apply
#11 ERROR: process "/bin/sh -c set -ex;   git apply < riscv64.patch;   export GOPATH=/go;   if [ \"${TARGET_OS}\" = windows ]; then     commands=\"${KUBERNETES_BINS}\";     binarySuffix=.exe;     export KUBE_BUILD_PLATFORMS=windows/amd64;   else     commands=\"${KUBERNETES_BINS}\";     binarySuffix='';   fi;   if [ ${BUILD_GO_CGO_ENABLED:-0} -eq 1 ]; then     export KUBE_CGO_OVERRIDES=$commands;   else     export KUBE_STATIC_OVERRIDES=$commands;   fi;   mkdir /out;   export SOURCE_DATE_EPOCH=$SOURCE_DATE_EPOCH;   export FORCE_HOST_GO=y;   export KUBE_VERBOSE=9;   export KUBE_GIT_TREE_STATE=clean;   export KUBE_GIT_VERSION=\"v$VERSION+k0s\";   for cmd in $commands; do     make GOFLAGS=\"${BUILD_GO_FLAGS} -tags=${BUILD_GO_TAGS}\" GOLDFLAGS=\"${BUILD_GO_LDFLAGS}\" WHAT=cmd/$cmd;     mv /go/src/github.com/kubernetes/kubernetes/_output/local/bin/*/*/$cmd$binarySuffix /out/;   done" did not complete successfully: exit code: 1
------
> [build 7/7] RUN   set -ex;   git apply < riscv64.patch;   export GOPATH=/go;   if [ "linux" = windows ]; then     commands="kubelet kube-apiserver kube-scheduler kube-controller-manager";     binarySuffix=.exe;     export KUBE_BUILD_PLATFORMS=windows/amd64;   else     commands="kubelet kube-apiserver kube-scheduler kube-controller-manager";     binarySuffix='';   fi;   if [ 0 -eq 1 ]; then     export KUBE_CGO_OVERRIDES=$commands;   else     export KUBE_STATIC_OVERRIDES=$commands;   fi;   mkdir /out;   export SOURCE_DATE_EPOCH=1775635219;   export FORCE_HOST_GO=y;   export KUBE_VERBOSE=9;   export KUBE_GIT_TREE_STATE=clean;   export KUBE_GIT_VERSION="v1.35.3+k0s";   for cmd in $commands; do     make GOFLAGS="-v -tags=providerless" GOLDFLAGS=" -extldflags=-static" WHAT=cmd/$cmd;     mv /go/src/github.com/kubernetes/kubernetes/_output/local/bin/*/*/$cmd$binarySuffix /out/;   done:
0.175 + git apply
0.193 error: patch failed: hack/lib/golang.sh:27
0.193 error: hack/lib/golang.sh: patch does not apply
0.193 error: patch failed: hack/lib/util.sh:185
0.193 error: hack/lib/util.sh: patch does not apply
------
Dockerfile:29
--------------------
 28 |
 29 | >>> RUN \
 30 | >>>   set -ex; \
 31 | >>>   git apply < riscv64.patch; \
 32 | >>>   export GOPATH=/go; \
 33 | >>>   if [ "${TARGET_OS}" = windows ]; then \
 34 | >>>     commands="${KUBERNETES_BINS}"; \
 35 | >>>     binarySuffix=.exe; \
 36 | >>>     export KUBE_BUILD_PLATFORMS=windows/amd64; \
 37 | >>>   else \
 38 | >>>     commands="${KUBERNETES_BINS}"; \
 39 | >>>     binarySuffix=''; \
 40 | >>>   fi; \
 41 | >>>   # Ensure that all of the binaries are built with CGO \
 42 | >>>   if [ ${BUILD_GO_CGO_ENABLED:-0} -eq 1 ]; then \
 43 | >>>     export KUBE_CGO_OVERRIDES=$commands; \
 44 | >>>   else \
 45 | >>>     export KUBE_STATIC_OVERRIDES=$commands; \
 46 | >>>   fi; \
 47 | >>>   mkdir /out; \
 48 | >>>   export SOURCE_DATE_EPOCH=$SOURCE_DATE_EPOCH; \
 49 | >>>   export FORCE_HOST_GO=y; \
 50 | >>>   export KUBE_VERBOSE=9; \
 51 | >>>   export KUBE_GIT_TREE_STATE=clean; \
 52 | >>>   export KUBE_GIT_VERSION="v$VERSION+k0s"; \
 53 | >>>   for cmd in $commands; do \
 54 | >>>     make GOFLAGS="${BUILD_GO_FLAGS} -tags=${BUILD_GO_TAGS}" GOLDFLAGS="${BUILD_GO_LDFLAGS}" WHAT=cmd/$cmd; \
 55 | >>>     mv /go/src/github.com/kubernetes/kubernetes/_output/local/bin/*/*/$cmd$binarySuffix /out/; \
 56 | >>>   done
 57 |
--------------------
ERROR: failed to build: failed to solve: process "/bin/sh -c set -ex;   git apply < riscv64.patch;   export GOPATH=/go;   if [ \"${TARGET_OS}\" = windows ]; then     commands=\"${KUBERNETES_BINS}\";     binarySuffix=.exe;     export KUBE_BUILD_PLATFORMS=windows/amd64;   else     commands=\"${KUBERNETES_BINS}\";     binarySuffix='';   fi;   if [ ${BUILD_GO_CGO_ENABLED:-0} -eq 1 ]; then     export KUBE_CGO_OVERRIDES=$commands;   else     export KUBE_STATIC_OVERRIDES=$commands;   fi;   mkdir /out;   export SOURCE_DATE_EPOCH=$SOURCE_DATE_EPOCH;   export FORCE_HOST_GO=y;   export KUBE_VERBOSE=9;   export KUBE_GIT_TREE_STATE=clean;   export KUBE_GIT_VERSION=\"v$VERSION+k0s\";   for cmd in $commands; do     make GOFLAGS=\"${BUILD_GO_FLAGS} -tags=${BUILD_GO_TAGS}\" GOLDFLAGS=\"${BUILD_GO_LDFLAGS}\" WHAT=cmd/$cmd;     mv /go/src/github.com/kubernetes/kubernetes/_output/local/bin/*/*/$cmd$binarySuffix /out/;   done" did not complete successfully: exit code: 1
make[1]: *** [Makefile:108: .docker-image.kubernetes.stamp] Error 1
make[1]: Leaving directory '/home/dodge/projects/k0s/embedded-bins'
make: *** [Makefile:224: .bins.linux.stamp] Error 2

@dodgex
Copy link
Copy Markdown
Author

dodgex commented Apr 8, 2026

As I realized that there are some steps cached, i ran docker buildx prune -a and tried make lint again, but the same fail in the end.

Here is the full log, in case you might see something suspicious.

$ make lint
hack/copyright.sh
make -C embedded-bins \
  TARGET_OS=linux \
  SOURCE_DATE_EPOCH=1775635219
make[1]: Entering directory '/home/dodge/projects/k0s/embedded-bins'
docker build --progress=plain --iidfile '.docker-image.kubernetes.stamp' -t k0sbuild.docker-image.kubernetes:latest --build-arg BUILDKIT_DOCKERFILE_CHECK=skip=InvalidDefaultArgInFrom --build-arg TARGET_OS=linux --build-arg CONTAINERD_BINS="containerd containerd-shim-runc-v2" --build-arg KUBERNETES_BINS="kubelet kube-apiserver kube-scheduler kube-controller-manager" --build-arg VERSION=1.35.3 --build-arg SOURCE_DATE_EPOCH=1775635219 --build-arg BUILDIMAGE=docker.io/library/golang:1.26.1-alpine3.23 --build-arg BUILD_GO_TAGS="providerless" --build-arg BUILD_GO_CGO_ENABLED= --build-arg BUILD_GO_CGO_CFLAGS='' --build-arg BUILD_SHIM_GO_CGO_ENABLED= --build-arg BUILD_GO_FLAGS="-v" --build-arg BUILD_GO_LDFLAGS=' -extldflags=-static' --build-arg BUILD_CFLAGS='' --build-arg BUILD_LDFLAGS='' --build-arg BUILD_CONFIGURE_FLAGS='' -- kubernetes/
#0 building with "default" instance using docker driver

#1 [internal] load build definition from Dockerfile
#1 transferring dockerfile: 1.91kB done
#1 DONE 0.0s

#2 [internal] load metadata for docker.io/library/golang:1.26.1-alpine3.23
#2 DONE 1.3s

#3 [internal] load .dockerignore
#3 transferring context: 2B done
#3 DONE 0.0s

#4 [internal] load build context
#4 transferring context: 1.42kB done
#4 DONE 0.0s

#5 [build 1/7] FROM docker.io/library/golang:1.26.1-alpine3.23@sha256:2389ebfa5b7f43eeafbd6be0c3700cc46690ef842ad962f6c5bd6be49ed82039
#5 resolve docker.io/library/golang:1.26.1-alpine3.23@sha256:2389ebfa5b7f43eeafbd6be0c3700cc46690ef842ad962f6c5bd6be49ed82039 0.0s done
#5 DONE 0.1s

#6 [build 2/7] RUN if [ ! -z "$(which apt)" ]; then        apt update && apt install -y build-essential git rsync grep coreutils bash;     elif [ ! -z "$(which apk)" ]; then        apk add build-base git linux-headers rsync grep coreutils bash;     else        echo "unsupported package manager";        exit 1;     fi
#6 0.802 ( 1/51) Installing ncurses-terminfo-base (6.5_p20251123-r0)
#6 0.835 ( 2/51) Installing libncursesw (6.5_p20251123-r0)
#6 0.872 ( 3/51) Installing readline (8.3.1-r0)
#6 0.909 ( 4/51) Installing bash (5.3.3-r1)
#6 0.972   Executing bash-5.3.3-r1.post-install
#6 0.975 ( 5/51) Installing libgcc (15.2.0-r2)
#6 1.002 ( 6/51) Installing jansson (2.14.1-r0)
#6 1.031 ( 7/51) Installing libstdc++ (15.2.0-r2)
#6 1.131 ( 8/51) Installing zstd-libs (1.5.7-r2)
#6 1.191 ( 9/51) Installing binutils (2.45.1-r0)
#6 1.439 (10/51) Installing libmagic (5.46-r2)
#6 1.512 (11/51) Installing file (5.46-r2)
#6 1.543 (12/51) Installing libgomp (15.2.0-r2)
#6 1.581 (13/51) Installing libatomic (15.2.0-r2)
#6 1.607 (14/51) Installing gmp (6.3.0-r4)
#6 1.667 (15/51) Installing isl26 (0.26-r1)
#6 1.763 (16/51) Installing mpfr4 (4.2.2-r0)
#6 1.832 (17/51) Installing mpc1 (1.3.1-r1)
#6 1.866 (18/51) Installing gcc (15.2.0-r2)
#6 6.355 (19/51) Installing libstdc++-dev (15.2.0-r2)
#6 6.697 (20/51) Installing musl-dev (1.2.5-r21)
#6 6.972 (21/51) Installing g++ (15.2.0-r2)
#6 8.341 (22/51) Installing make (4.4.1-r3)
#6 8.381 (23/51) Installing fortify-headers (1.1-r5)
#6 8.413 (24/51) Installing patch (2.8-r0)
#6 8.445 (25/51) Installing build-base (0.5-r3)
#6 8.445 (26/51) Installing coreutils-env (9.8-r1)
#6 8.473 (27/51) Installing coreutils-fmt (9.8-r1)
#6 8.501 (28/51) Installing coreutils-sha512sum (9.8-r1)
#6 8.529 (29/51) Installing acl-libs (2.3.2-r1)
#6 8.557 (30/51) Installing libattr (2.5.2-r2)
#6 8.584 (31/51) Installing skalibs-libs (2.14.4.0-r0)
#6 8.619 (32/51) Installing utmps-libs (0.1.3.1-r0)
#6 8.645 (33/51) Installing coreutils (9.8-r1)
#6 8.712 (34/51) Installing brotli-libs (1.2.0-r0)
#6 8.771 (35/51) Installing c-ares (1.34.6-r0)
#6 8.803 (36/51) Installing libunistring (1.4.1-r0)
#6 8.892 (37/51) Installing libidn2 (2.3.8-r0)
#6 8.925 (38/51) Installing nghttp2-libs (1.68.0-r0)
#6 8.967 (39/51) Installing nghttp3 (1.13.1-r0)
#6 9.002 (40/51) Installing libpsl (0.21.5-r3)
#6 9.033 (41/51) Installing libcurl (8.17.0-r1)
#6 9.079 (42/51) Installing libexpat (2.7.5-r0)
#6 9.109 (43/51) Installing pcre2 (10.47-r0)
#6 9.155 (44/51) Installing git (2.52.0-r0)
#6 9.471 (45/51) Installing git-init-template (2.52.0-r0)
#6 9.501 (46/51) Installing grep (3.12-r0)
#6 9.536 (47/51) Installing linux-headers (6.16.12-r0)
#6 9.710 (48/51) Installing lz4-libs (1.10.0-r0)
#6 9.747 (49/51) Installing popt (1.19-r4)
#6 9.776 (50/51) Installing libxxhash (0.8.3-r0)
#6 9.808 (51/51) Installing rsync (3.4.1-r1)
#6 9.851 Executing busybox-1.37.0-r30.trigger
#6 9.856 OK: 297.2 MiB in 68 packages
#6 DONE 10.3s

#7 [build 3/7] RUN mkdir -p /go/src/github.com/kubernetes/kubernetes
#7 DONE 0.3s

#8 [build 4/7] RUN git -c advice.detachedHead=false clone -b v1.35.3 --depth=1 https://github.com/kubernetes/kubernetes.git /go/src/github.com/kubernetes/kubernetes
#8 0.218 Cloning into '/go/src/github.com/kubernetes/kubernetes'...
#8 7.336 warning: refs/tags/v1.35.3 e666bc7de9a51bad471cba21ff41ac9805272281 is not a commit!
Updating files: 100% (28310/28310), done.0)
#8 DONE 8.5s

#9 [build 5/7] WORKDIR /go/src/github.com/kubernetes/kubernetes
#9 DONE 0.1s

#10 [build 6/7] COPY riscv64.patch .
#10 DONE 0.0s

#11 [build 7/7] RUN   set -ex;   git apply < riscv64.patch;   export GOPATH=/go;   if [ "linux" = windows ]; then     commands="kubelet kube-apiserver kube-scheduler kube-controller-manager";     binarySuffix=.exe;     export KUBE_BUILD_PLATFORMS=windows/amd64;   else     commands="kubelet kube-apiserver kube-scheduler kube-controller-manager";     binarySuffix='';   fi;   if [ 0 -eq 1 ]; then     export KUBE_CGO_OVERRIDES=$commands;   else     export KUBE_STATIC_OVERRIDES=$commands;   fi;   mkdir /out;   export SOURCE_DATE_EPOCH=1775635219;   export FORCE_HOST_GO=y;   export KUBE_VERBOSE=9;   export KUBE_GIT_TREE_STATE=clean;   export KUBE_GIT_VERSION="v1.35.3+k0s";   for cmd in $commands; do     make GOFLAGS="-v -tags=providerless" GOLDFLAGS=" -extldflags=-static" WHAT=cmd/$cmd;     mv /go/src/github.com/kubernetes/kubernetes/_output/local/bin/*/*/$cmd$binarySuffix /out/;   done
#11 0.143 + git apply
#11 0.144 error: patch failed: hack/lib/golang.sh:27
#11 0.144 error: hack/lib/golang.sh: patch does not apply
#11 0.144 error: patch failed: hack/lib/util.sh:185
#11 0.144 error: hack/lib/util.sh: patch does not apply
#11 ERROR: process "/bin/sh -c set -ex;   git apply < riscv64.patch;   export GOPATH=/go;   if [ \"${TARGET_OS}\" = windows ]; then     commands=\"${KUBERNETES_BINS}\";     binarySuffix=.exe;     export KUBE_BUILD_PLATFORMS=windows/amd64;   else     commands=\"${KUBERNETES_BINS}\";     binarySuffix='';   fi;   if [ ${BUILD_GO_CGO_ENABLED:-0} -eq 1 ]; then     export KUBE_CGO_OVERRIDES=$commands;   else     export KUBE_STATIC_OVERRIDES=$commands;   fi;   mkdir /out;   export SOURCE_DATE_EPOCH=$SOURCE_DATE_EPOCH;   export FORCE_HOST_GO=y;   export KUBE_VERBOSE=9;   export KUBE_GIT_TREE_STATE=clean;   export KUBE_GIT_VERSION=\"v$VERSION+k0s\";   for cmd in $commands; do     make GOFLAGS=\"${BUILD_GO_FLAGS} -tags=${BUILD_GO_TAGS}\" GOLDFLAGS=\"${BUILD_GO_LDFLAGS}\" WHAT=cmd/$cmd;     mv /go/src/github.com/kubernetes/kubernetes/_output/local/bin/*/*/$cmd$binarySuffix /out/;   done" did not complete successfully: exit code: 1
------
 > [build 7/7] RUN   set -ex;   git apply < riscv64.patch;   export GOPATH=/go;   if [ "linux" = windows ]; then     commands="kubelet kube-apiserver kube-scheduler kube-controller-manager";     binarySuffix=.exe;     export KUBE_BUILD_PLATFORMS=windows/amd64;   else     commands="kubelet kube-apiserver kube-scheduler kube-controller-manager";     binarySuffix='';   fi;   if [ 0 -eq 1 ]; then     export KUBE_CGO_OVERRIDES=$commands;   else     export KUBE_STATIC_OVERRIDES=$commands;   fi;   mkdir /out;   export SOURCE_DATE_EPOCH=1775635219;   export FORCE_HOST_GO=y;   export KUBE_VERBOSE=9;   export KUBE_GIT_TREE_STATE=clean;   export KUBE_GIT_VERSION="v1.35.3+k0s";   for cmd in $commands; do     make GOFLAGS="-v -tags=providerless" GOLDFLAGS=" -extldflags=-static" WHAT=cmd/$cmd;     mv /go/src/github.com/kubernetes/kubernetes/_output/local/bin/*/*/$cmd$binarySuffix /out/;   done:
0.143 + git apply
0.144 error: patch failed: hack/lib/golang.sh:27
0.144 error: hack/lib/golang.sh: patch does not apply
0.144 error: patch failed: hack/lib/util.sh:185
0.144 error: hack/lib/util.sh: patch does not apply
------
Dockerfile:29
--------------------
  28 |
  29 | >>> RUN \
  30 | >>>   set -ex; \
  31 | >>>   git apply < riscv64.patch; \
  32 | >>>   export GOPATH=/go; \
  33 | >>>   if [ "${TARGET_OS}" = windows ]; then \
  34 | >>>     commands="${KUBERNETES_BINS}"; \
  35 | >>>     binarySuffix=.exe; \
  36 | >>>     export KUBE_BUILD_PLATFORMS=windows/amd64; \
  37 | >>>   else \
  38 | >>>     commands="${KUBERNETES_BINS}"; \
  39 | >>>     binarySuffix=''; \
  40 | >>>   fi; \
  41 | >>>   # Ensure that all of the binaries are built with CGO \
  42 | >>>   if [ ${BUILD_GO_CGO_ENABLED:-0} -eq 1 ]; then \
  43 | >>>     export KUBE_CGO_OVERRIDES=$commands; \
  44 | >>>   else \
  45 | >>>     export KUBE_STATIC_OVERRIDES=$commands; \
  46 | >>>   fi; \
  47 | >>>   mkdir /out; \
  48 | >>>   export SOURCE_DATE_EPOCH=$SOURCE_DATE_EPOCH; \
  49 | >>>   export FORCE_HOST_GO=y; \
  50 | >>>   export KUBE_VERBOSE=9; \
  51 | >>>   export KUBE_GIT_TREE_STATE=clean; \
  52 | >>>   export KUBE_GIT_VERSION="v$VERSION+k0s"; \
  53 | >>>   for cmd in $commands; do \
  54 | >>>     make GOFLAGS="${BUILD_GO_FLAGS} -tags=${BUILD_GO_TAGS}" GOLDFLAGS="${BUILD_GO_LDFLAGS}" WHAT=cmd/$cmd; \
  55 | >>>     mv /go/src/github.com/kubernetes/kubernetes/_output/local/bin/*/*/$cmd$binarySuffix /out/; \
  56 | >>>   done
  57 |
--------------------
ERROR: failed to build: failed to solve: process "/bin/sh -c set -ex;   git apply < riscv64.patch;   export GOPATH=/go;   if [ \"${TARGET_OS}\" = windows ]; then     commands=\"${KUBERNETES_BINS}\";     binarySuffix=.exe;     export KUBE_BUILD_PLATFORMS=windows/amd64;   else     commands=\"${KUBERNETES_BINS}\";     binarySuffix='';   fi;   if [ ${BUILD_GO_CGO_ENABLED:-0} -eq 1 ]; then     export KUBE_CGO_OVERRIDES=$commands;   else     export KUBE_STATIC_OVERRIDES=$commands;   fi;   mkdir /out;   export SOURCE_DATE_EPOCH=$SOURCE_DATE_EPOCH;   export FORCE_HOST_GO=y;   export KUBE_VERBOSE=9;   export KUBE_GIT_TREE_STATE=clean;   export KUBE_GIT_VERSION=\"v$VERSION+k0s\";   for cmd in $commands; do     make GOFLAGS=\"${BUILD_GO_FLAGS} -tags=${BUILD_GO_TAGS}\" GOLDFLAGS=\"${BUILD_GO_LDFLAGS}\" WHAT=cmd/$cmd;     mv /go/src/github.com/kubernetes/kubernetes/_output/local/bin/*/*/$cmd$binarySuffix /out/;   done" did not complete successfully: exit code: 1
make[1]: *** [Makefile:108: .docker-image.kubernetes.stamp] Error 1
make[1]: Leaving directory '/home/dodge/projects/k0s/embedded-bins'
make: *** [Makefile:224: .bins.linux.stamp] Error 2

@dodgex
Copy link
Copy Markdown
Author

dodgex commented Apr 8, 2026

Which OS are you using?

Just saw that question as part of your message.

I am on windows 11 with Docker Desktop 4.66.1; running the command in WSL2 Ubuntu 24.04

@twz123
Copy link
Copy Markdown
Member

twz123 commented Apr 8, 2026

I am on windows 11

Somehow anticipated Windows. Probably git's autocrlf settings mess up the patch file. Can you check if it has CRLF endings and convert it to LF only? If that's the case, then we could set the git attributes for the patch file accordingly.

@twz123
Copy link
Copy Markdown
Member

twz123 commented Apr 8, 2026

Do you have any possibility to test this change? Since we don't have any integration test coverage for this, I'd like to have at least a confirmation that this has been tested manually 🙃

@dodgex
Copy link
Copy Markdown
Author

dodgex commented Apr 8, 2026

I am on windows 11

Somehow anticipated Windows. Probably git's autocrlf settings mess up the patch file. Can you check if it has CRLF endings and convert it to LF only? If that's the case, then we could set the git attributes for the patch file accordingly.

Strange. While I used Goland from windows to access the files in my WSL, the actual clone was on linux/wsl. I just recloned the repo and tested on wsl only. but even then it was CRLF. after converting the riscv patch file with dos2unix, the make lint is currently running.

Do you have any possibility to test this change? Since we don't have any integration test coverage for this, I'd like to have at least a confirmation that this has been tested manually 🙃

I can give it a try, now that it seems, that I can build the project. Now I only need to know what (and how) I need on my k0s test vm from my local build (can re-build there if it helps).

@dodgex
Copy link
Copy Markdown
Author

dodgex commented Apr 8, 2026

make lint as well as make build && git diff --exit-code both succeded now.

The git diff outputs...

warning: in the working copy of 'embedded-bins/kubernetes/riscv64.patch', LF will be replaced by CRLF the next time Git touches it
warning: in the working copy of 'static/_crds/autopilot/autopilot.k0sproject.io_controlnodes.yaml', LF will be replaced by CRLF the next time Git touches it
warning: in the working copy of 'static/_crds/autopilot/autopilot.k0sproject.io_plans.yaml', LF will be replaced by CRLF the next time Git touches it
warning: in the working copy of 'static/_crds/autopilot/autopilot.k0sproject.io_updateconfigs.yaml', LF will be replaced by CRLF the next time Git touches it
warning: in the working copy of 'static/_crds/etcd/etcd.k0sproject.io_etcdmembers.yaml', LF will be replaced by CRLF the next time Git touches it
warning: in the working copy of 'static/_crds/helm/helm.k0sproject.io_charts.yaml', LF will be replaced by CRLF the next time Git touches it
warning: in the working copy of 'static/_crds/k0s/k0s.k0sproject.io_clusterconfigs.yaml', LF will be replaced by CRLF the next time Git touches it

I checked my ~/.gitconfig it has autocrlf as true, can't remember if or when i configured that.

[core]
        autocrlf = true

Maybe it would make sense, to consider adding a .gitattributes which should bypass this afaik.

@dodgex
Copy link
Copy Markdown
Author

dodgex commented Apr 9, 2026

Do you have any possibility to test this change? Since we don't have any integration test coverage for this, I'd like to have at least a confirmation that this has been tested manually 🙃

I built k0s on my Test VM and replaced the k0s binary in /usr/local/bin with the one build by make k0s. Luckily I did not need any of the container images build by k0s so testing was easy. I configured the healthzBindAddress in my k0s.yaml and after restarting k0s it took a few seconds until the configmap got updated. After that I also had to kill the kube-proxy pod for it to use the updated config (restart should have worked too I guess).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow to configure healthzBindAddress for kube-proxy

2 participants