0 of 15 done
Provision the Ground

Set up the jumpbox

Where you are

You have four machines, and one of them, jumpbox, is the administration host you run every command from. You set it up first because it holds the tools and files the rest of the build depends on. Installing the command line utilities, cloning the course repository, and downloading the Kubernetes binaries here once means you do not repeat that work on every machine. From this point on, when a step says to run a command, run it on the jumpbox unless told otherwise.

Log in to the jumpbox

Log in to the jumpbox from your Mac:

ssh root@jumpbox

All commands will be run as the root user. This is being done for the sake of convenience, and will help reduce the number of commands required to set everything up.

Install command line utilities

Now that you are logged into the jumpbox machine as the root user, you will install the command line utilities that will be used to perform various tasks throughout the course.

{
  apt-get update
  apt-get -y install wget curl vim openssl git
}

Clone the course repository

Download a copy of this course repository. It contains the configuration files and unit files you will use to build the cluster. These files are also your boilerplate. By the end of the course they are yours to change. Clone the repository with the git command. Replace ChaiWithJai with the account that hosts your copy, or copy the clone URL from the repository page on GitHub.

git clone --depth 1 \
  https://github.com/ChaiWithJai/bootstrap-your-own-kubernetes-cluster.git

Change into the bootstrap-your-own-kubernetes-cluster directory:

cd bootstrap-your-own-kubernetes-cluster

This is the working directory for the rest of the course. If you ever get lost, run the pwd command to confirm you are in the right directory before running commands on the jumpbox:

pwd
/root/bootstrap-your-own-kubernetes-cluster

Download the binaries

In this section you will download the binaries for the various Kubernetes components. The binaries will be stored in the downloads directory on the jumpbox. Downloading them once here, rather than separately on each machine, reduces the amount of internet bandwidth the build requires.

The binaries that will be downloaded are listed in either the downloads-amd64.txt or downloads-arm64.txt file depending on your hardware architecture, which you can review using the cat command:

cat downloads-$(dpkg --print-architecture).txt

Download the binaries into a directory called downloads using the wget command:

wget -q --show-progress \
  --https-only \
  --timestamping \
  -P downloads \
  -i downloads-$(dpkg --print-architecture).txt

Depending on your internet connection speed it may take a while to download over 500 megabytes of binaries. Once the download is complete, you can list them using the ls command:

ls -oh downloads

Extract the component binaries from the release archives and organize them under the downloads directory.

{
  ARCH=$(dpkg --print-architecture)
  mkdir -p downloads/{client,cni-plugins,controller,worker}
  tar -xvf downloads/crictl-v1.32.0-linux-${ARCH}.tar.gz \
    -C downloads/worker/
  tar -xvf downloads/containerd-2.1.0-beta.0-linux-${ARCH}.tar.gz \
    --strip-components 1 \
    -C downloads/worker/
  tar -xvf downloads/cni-plugins-linux-${ARCH}-v1.6.2.tgz \
    -C downloads/cni-plugins/
  tar -xvf downloads/etcd-v3.6.0-rc.3-linux-${ARCH}.tar.gz \
    -C downloads/ \
    --strip-components 1 \
    etcd-v3.6.0-rc.3-linux-${ARCH}/etcdctl \
    etcd-v3.6.0-rc.3-linux-${ARCH}/etcd
  mv downloads/{etcdctl,kubectl} downloads/client/
  mv downloads/{etcd,kube-apiserver,kube-controller-manager,kube-scheduler} \
    downloads/controller/
  mv downloads/{kubelet,kube-proxy} downloads/worker/
  mv downloads/runc.${ARCH} downloads/worker/runc
}
rm -rf downloads/*gz

Make the binaries executable.

{
  chmod +x downloads/{client,cni-plugins,controller,worker}/*
}

Install kubectl

In this section you will install kubectl, the official Kubernetes client command line tool, on the jumpbox machine. You will use kubectl to interact with the Kubernetes control plane once your cluster is provisioned later in the course.

Copy the kubectl binary to the /usr/local/bin/ directory so it is on your path:

{
  cp downloads/client/kubectl /usr/local/bin/
}

At this point kubectl is installed and can be verified by running the kubectl command:

kubectl version --client
Client Version: v1.32.3
Kustomize Version: v5.5.0

The jumpbox now has all the command line tools and binaries you need to complete the rest of the course.

Key terms

  • Jumpbox: the single administration host you run commands from. It holds your tools and the downloaded binaries and reaches the other machines over the network.
  • wget: a command line tool for downloading files over HTTP and HTTPS. You use it to fetch the Kubernetes binaries.
  • curl: a command line tool for making network requests. Later steps use it to talk to running services.
  • openssl: a tool for creating keys and certificates. You use it later to set up the cluster’s TLS certificates.
  • git: a version control tool. Here you use it to clone the course repository.
  • kubectl: the official Kubernetes client. You run it to view and change cluster state once the control plane is up.
  • Binary: a compiled, ready-to-run program file. The Kubernetes components ship as binaries you download rather than build yourself.

Reflect

You downloaded the binaries once on the jumpbox instead of on each of the four machines. What problems would you expect if every machine downloaded and stored its own copy of every binary?

Next: Provision the machines