How can I get older versions of kubectl for arm64 (MacBook Pro M1)

Kuberenetes repo doesn't have older kubectl versions for ARM64 (M1 Apple Silicon), the newest version are available with the command :

curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/darwin/arm64/kubectl"

v1.21 being the oldest available with this command for ARM64.

But I need kubectl v1.10, how can I build kubectl v1.10 for ARM64 architecture from the source code or even get it already built from some other repo?

When trying to build

cd examples/kubectl-container 

make kubectl
make -C ../../ WHAT=cmd/kubectl KUBE_STATIC_OVERRIDES="kubectl"; \
    cp ../../_output/local/bin/darwin/arm64/kubectl .
make[1]: *** No targets specified and no makefile found.  Stop.
cp: ../../_output/local/bin/darwin/arm64/kubectl: No such file or directory
make: *** [kubectl] Error 1

kubectl version 1.10 is from March 2018. The Apple M1 chip was launched in November 2020. There would not have been any builds available of kubectl 1.10 for the M1 chip when it was made - and I don't think it is likely that anyone would be producing builds for public usage for several year old versions of kubectl for the M1.

You will simply have to download the source code for the 1.10 version and compile it yourself. You might experience that it won't compile or that it won't work when compiled - in that case you'll have to backport fixes for the M1 support from the newer releases to the 1.10 release.

You can download the source code from here:

https://github.com/kubernetes/kubernetes/archive/refs/tags/v1.10.13.tar.gz

You can build the source code in two ways. The first is to first ensure you have a working Go installation, unpack the source code and then use the Terminal to run:

make

Or alternative you need a working Docker command line installation, and then you need to run:

make quick-release