2023-11-01 09:16:49 +03:00
|
|
|
# Set Up The Jumpbox
|
|
|
|
|
2025-06-02 06:37:55 +03:00
|
|
|
In this lab you will set up one of the four machines to be a `jumpbox`. This
|
|
|
|
machine will be used to run commands throughout this tutorial. While a dedicated
|
|
|
|
machine is being used to ensure consistency, these commands can also be run from
|
|
|
|
just about any machine including your personal workstation running macOS or
|
|
|
|
Linux.
|
|
|
|
|
|
|
|
Think of the `jumpbox` as the administration machine that you will use as a
|
|
|
|
home base when setting up your Kubernetes cluster from the ground up. Before
|
|
|
|
we get started we need to install a few command line utilities and clone the
|
|
|
|
Kubernetes The Hard Way git repository, which contains some additional
|
|
|
|
configuration files that will be used to configure various Kubernetes
|
|
|
|
components throughout this tutorial.
|
2023-11-01 09:16:49 +03:00
|
|
|
|
|
|
|
Log in to the `jumpbox`:
|
|
|
|
|
|
|
|
```bash
|
2025-06-09 01:21:10 +03:00
|
|
|
ssh vagrant@jumpbox
|
2023-11-01 09:16:49 +03:00
|
|
|
```
|
|
|
|
|
2025-06-09 01:21:10 +03:00
|
|
|
All commands will be run as the `vagrant` user. This is being done for the sake
|
2025-06-02 06:37:55 +03:00
|
|
|
of convenience, and will help reduce the number of commands required to set
|
|
|
|
everything up.
|
2023-11-01 09:16:49 +03:00
|
|
|
|
|
|
|
### Install Command Line Utilities
|
|
|
|
|
2025-06-09 01:21:10 +03:00
|
|
|
Now that you are logged into the `jumpbox` machine as the `vagrant` user, you will
|
2025-06-03 05:13:21 +03:00
|
|
|
install the command line utilities that will be used to preform various tasks
|
|
|
|
throughout the tutorial.
|
2023-11-01 09:16:49 +03:00
|
|
|
|
|
|
|
```bash
|
2025-04-07 04:32:30 +03:00
|
|
|
{
|
2025-06-09 01:21:10 +03:00
|
|
|
sudo apt-get update
|
|
|
|
sudo apt-get -y install wget curl vim openssl git
|
2025-04-07 04:32:30 +03:00
|
|
|
}
|
2023-11-01 09:16:49 +03:00
|
|
|
```
|
|
|
|
|
|
|
|
### Sync GitHub Repository
|
|
|
|
|
2025-06-03 05:13:21 +03:00
|
|
|
Now it's time to download a copy of this tutorial which contains the
|
|
|
|
configuration files and templates that will be used to build your Kubernetes
|
|
|
|
cluster from the ground up. Clone the Kubernetes The Hard Way git repository
|
|
|
|
using the `git` command:
|
2023-11-01 09:16:49 +03:00
|
|
|
|
|
|
|
```bash
|
|
|
|
git clone --depth 1 \
|
2025-06-03 05:13:21 +03:00
|
|
|
https://github.com/b01/kubernetes-the-hard-way.git
|
2023-11-01 09:16:49 +03:00
|
|
|
```
|
|
|
|
|
|
|
|
Change into the `kubernetes-the-hard-way` directory:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
cd kubernetes-the-hard-way
|
|
|
|
```
|
|
|
|
|
2025-06-03 05:13:21 +03:00
|
|
|
This will be the working directory for the rest of the tutorial. If you ever
|
|
|
|
get lost run the `pwd` command to verify you are in the right directory when
|
|
|
|
running commands on the `jumpbox`:
|
2023-11-01 09:16:49 +03:00
|
|
|
|
|
|
|
```bash
|
|
|
|
pwd
|
|
|
|
```
|
|
|
|
|
|
|
|
```text
|
2025-06-03 05:13:21 +03:00
|
|
|
/home/vagrant/kubernetes-the-hard-way
|
2023-11-01 09:16:49 +03:00
|
|
|
```
|
|
|
|
|
|
|
|
### Download Binaries
|
|
|
|
|
2025-06-03 05:13:21 +03:00
|
|
|
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`, which will reduce the amount of internet bandwidth required to
|
|
|
|
complete this tutorial as we avoid downloading the binaries multiple times
|
|
|
|
for each machine in our Kubernetes cluster.
|
2023-11-01 09:16:49 +03:00
|
|
|
|
2025-06-03 05:13:21 +03:00
|
|
|
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:
|
2023-11-01 09:16:49 +03:00
|
|
|
|
|
|
|
```bash
|
2025-04-10 09:08:13 +03:00
|
|
|
cat downloads-$(dpkg --print-architecture).txt
|
2023-11-01 09:16:49 +03:00
|
|
|
```
|
|
|
|
|
2025-06-03 05:13:21 +03:00
|
|
|
Download the binaries into a directory called `downloads` using the `wget`
|
|
|
|
command:
|
2023-11-01 09:16:49 +03:00
|
|
|
|
|
|
|
```bash
|
|
|
|
wget -q --show-progress \
|
|
|
|
--https-only \
|
|
|
|
--timestamping \
|
|
|
|
-P downloads \
|
2025-04-10 09:08:13 +03:00
|
|
|
-i downloads-$(dpkg --print-architecture).txt
|
2023-11-01 09:16:49 +03:00
|
|
|
```
|
|
|
|
|
2025-06-03 05:13:21 +03:00
|
|
|
Depending on your internet connection speed it may take a while to download
|
|
|
|
over `500` megabytes of binaries, and once the download is complete, you can
|
|
|
|
list them using the `ls` command:
|
2023-11-01 09:16:49 +03:00
|
|
|
|
|
|
|
```bash
|
2025-04-07 04:32:30 +03:00
|
|
|
ls -oh downloads
|
2023-11-01 09:16:49 +03:00
|
|
|
```
|
|
|
|
|
2025-06-03 05:13:21 +03:00
|
|
|
Extract the component binaries from the release archives and organize them
|
|
|
|
under the `downloads` directory.
|
2025-04-10 09:08:13 +03:00
|
|
|
|
|
|
|
```bash
|
|
|
|
{
|
2025-06-03 05:13:21 +03:00
|
|
|
KUBE_VER=v1.33.1
|
|
|
|
CRI_VER=v1.33.0
|
|
|
|
RUNC_VER=v1.3.0
|
|
|
|
CNI_VER=v1.7.1
|
|
|
|
CONTAINERD_VER=2.1.1
|
|
|
|
ETCD_VER=v3.6.0
|
|
|
|
|
2025-04-10 09:08:13 +03:00
|
|
|
ARCH=$(dpkg --print-architecture)
|
|
|
|
mkdir -p downloads/{client,cni-plugins,controller,worker}
|
2025-06-03 05:13:21 +03:00
|
|
|
tar -xvf downloads/crictl-${CRI_VER}-linux-${ARCH}.tar.gz \
|
2025-04-10 09:08:13 +03:00
|
|
|
-C downloads/worker/
|
2025-06-03 05:13:21 +03:00
|
|
|
tar -xvf downloads/containerd-${CONTAINERD_VER}-linux-${ARCH}.tar.gz \
|
2025-04-10 09:08:13 +03:00
|
|
|
--strip-components 1 \
|
|
|
|
-C downloads/worker/
|
2025-06-03 05:13:21 +03:00
|
|
|
tar -xvf downloads/cni-plugins-linux-${ARCH}-${CNI_VER}.tgz \
|
2025-04-10 09:08:13 +03:00
|
|
|
-C downloads/cni-plugins/
|
2025-06-03 05:13:21 +03:00
|
|
|
tar -xvf downloads/etcd-${ETCD_VER}-linux-${ARCH}.tar.gz \
|
2025-04-10 09:08:13 +03:00
|
|
|
-C downloads/ \
|
|
|
|
--strip-components 1 \
|
2025-06-03 05:13:21 +03:00
|
|
|
etcd-${ETCD_VER}-linux-${ARCH}/etcdctl \
|
|
|
|
etcd-${ETCD_VER}-linux-${ARCH}/etcd
|
2025-04-10 09:08:13 +03:00
|
|
|
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
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
```bash
|
|
|
|
rm -rf downloads/*gz
|
|
|
|
```
|
|
|
|
|
|
|
|
Make the binaries executable.
|
|
|
|
|
|
|
|
```bash
|
|
|
|
{
|
2025-06-12 01:06:04 +03:00
|
|
|
chmod +x -R downloads
|
2025-04-10 09:08:13 +03:00
|
|
|
}
|
2023-11-01 09:16:49 +03:00
|
|
|
```
|
|
|
|
|
|
|
|
### Install kubectl
|
|
|
|
|
2025-06-03 05:13:21 +03:00
|
|
|
In this section you will install the `kubectl`, the official Kubernetes client
|
|
|
|
command line tool, on the `jumpbox` machine. `kubectl` will be used to interact
|
|
|
|
with the Kubernetes control plane once your cluster is provisioned later in
|
|
|
|
this tutorial.
|
2023-11-01 09:16:49 +03:00
|
|
|
|
2025-06-03 05:13:21 +03:00
|
|
|
Use the `chmod` command to make the `kubectl` binary executable and move it to
|
|
|
|
the `/usr/local/bin/` directory:
|
2023-11-01 09:16:49 +03:00
|
|
|
|
|
|
|
```bash
|
|
|
|
{
|
2025-06-03 05:13:21 +03:00
|
|
|
sudo cp downloads/client/kubectl /usr/local/bin/
|
2023-11-01 09:16:49 +03:00
|
|
|
}
|
|
|
|
```
|
|
|
|
|
2025-06-03 05:13:21 +03:00
|
|
|
At this point `kubectl` is installed and can be verified by running the
|
|
|
|
`kubectl` command:
|
2023-11-01 09:16:49 +03:00
|
|
|
|
|
|
|
```bash
|
|
|
|
kubectl version --client
|
|
|
|
```
|
|
|
|
|
|
|
|
```text
|
2025-06-03 01:15:47 +03:00
|
|
|
Client Version: v1.33.1
|
2025-06-03 05:13:21 +03:00
|
|
|
Kustomize Version: v5.6.0
|
2023-11-01 09:16:49 +03:00
|
|
|
```
|
|
|
|
|
2025-06-03 05:13:21 +03:00
|
|
|
At this point the `jumpbox` has been set up with all the command line tools
|
|
|
|
and utilities necessary to complete the labs in this tutorial.
|
2023-11-01 09:16:49 +03:00
|
|
|
|
|
|
|
Next: [Provisioning Compute Resources](03-compute-resources.md)
|