Download Kubernetes for use on Raspberry Pi

  • The kubernetes repository comes with a shell script for downloading the binaries: get-kube-binaries.sh
  • The arm binaries are built for armv5 and are compatible with the Raspberry Pi.
  • The little snippet below is based on get-kube-binaries.sh and will download the arm binaries, and move them in to a single zip file which can be distributed to the Raspberry Pi hosts.
PLATFORM="linux"
ARCH="arm"

KUBE_VERSION="v1.9.1"
SERVER_TAR="kubernetes-server-${PLATFORM}-${ARCH}.tar.gz"
CLIENT_TAR="kubernetes-client-${PLATFORM}-${ARCH}.tar.gz"

KUBERNETES_RELEASE_URL="${KUBERNETES_RELEASE_URL:-https://dl.k8s.io}"
DOWNLOAD_URL_PREFIX="${KUBERNETES_RELEASE_URL}/${KUBE_VERSION}"
url="${DOWNLOAD_URL_PREFIX}/${SERVER_TAR}"
echo $url
wget -o kubernetes-server-linux-arm-$KUBE_VERSION.tar.gz $url

url="${DOWNLOAD_URL_PREFIX}/${CLIENT_TAR}"
echo $url
wget -o kubernetes-client-linux-arm-$KUBE_VERSION.tar.gz $url

tar zxf kubernetes-client-linux-arm-$KUBE_VERSION.tar.gz
tar zxf kubernetes-server-linux-arm-$KUBE_VERSION.tar.gz

mkdir -p opt/kubernetes
mv kubernetes/client/bin/* opt/kubernetes/
mv kubernetes/server/bin/* opt/kubernetes/
rm -rf kubernetes
zip -9r kubernetes-linux-arm-$KUBE_VERSION.zip opt
categories: kubernetes | golang | raspberrypi |