Skip to content

Commit 5a325c2

Browse files
elsonrodriguezkelseyhightower
authored andcommitted
Updating software components to latest stable releases. Fix missing config, minor spelling/grammar/flow fixes.
The main purpose of this update is to make sure the guide still works with the newest version of all software. In running through the guide I found places to make bug fixes and minor improvements.
1 parent a9cb5f7 commit 5a325c2

15 files changed

+100
-90
lines changed

.gitignore

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ ca-csr.json
88
ca-key.pem
99
ca.csr
1010
ca.pem
11-
encryption-config.yaml
11+
/encryption-config.yaml
1212
kube-controller-manager-csr.json
1313
kube-controller-manager-key.pem
1414
kube-controller-manager.csr
@@ -48,4 +48,4 @@ service-account.csr
4848
service-account.pem
4949
service-account-csr.json
5050
*.swp
51-
.idea/
51+
.idea/

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ Kubernetes The Hard Way guides you through bootstrapping a basic Kubernetes clus
1919

2020
Component versions:
2121

22-
* [kubernetes](https://github.com/kubernetes/kubernetes) v1.28.x
23-
* [containerd](https://github.com/containerd/containerd) v1.7.x
24-
* [cni](https://github.com/containernetworking/cni) v1.3.x
22+
* [kubernetes](https://github.com/kubernetes/kubernetes) v1.31.x
23+
* [containerd](https://github.com/containerd/containerd) v2.0.x
24+
* [cni](https://github.com/containernetworking/cni) v1.6.x
2525
* [etcd](https://github.com/etcd-io/etcd) v3.4.x
2626

2727
## Labs

configs/encryption-config.yaml

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
kind: EncryptionConfig
2+
apiVersion: v1
3+
resources:
4+
- resources:
5+
- secrets
6+
providers:
7+
- aescbc:
8+
keys:
9+
- name: key1
10+
secret: ${ENCRYPTION_KEY}
11+
- identity: {}

docs/01-prerequisites.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ In this lab you will review the machine requirements necessary to follow this tu
44

55
## Virtual or Physical Machines
66

7-
This tutorial requires four (4) virtual or physical ARM64 machines running Debian 12 (bookworm). The follow table list the four machines and thier CPU, memory, and storage requirements.
7+
This tutorial requires four (4) virtual or physical ARM64 machines running Debian 12 (bookworm). The following table list the four machines and thier CPU, memory, and storage requirements.
88

99
| Name | Description | CPU | RAM | Storage |
1010
|---------|------------------------|-----|-------|---------|
@@ -22,7 +22,7 @@ uname -mov
2222
After running the `uname` command you should see the following output:
2323

2424
```text
25-
#1 SMP Debian 6.1.55-1 (2023-09-29) aarch64 GNU/Linux
25+
#1 SMP Debian 6.1.115-1 (2024-11-01) aarch64 GNU/Linux
2626
```
2727

2828
You maybe surprised to see `aarch64` here, but that is the official name for the Arm Architecture 64-bit instruction set. You will often see `arm64` used by Apple, and the maintainers of the Linux kernel, when referring to support for `aarch64`. This tutorial will use `arm64` consistently throughout to avoid confusion.

docs/02-jumpbox.md

+15-21
Original file line numberDiff line numberDiff line change
@@ -49,19 +49,13 @@ pwd
4949

5050
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.
5151

52-
From the `kubernetes-the-hard-way` directory create a `downloads` directory using the `mkdir` command:
53-
54-
```bash
55-
mkdir downloads
56-
```
57-
5852
The binaries that will be downloaded are listed in the `downloads.txt` file, which you can review using the `cat` command:
5953

6054
```bash
6155
cat downloads.txt
6256
```
6357

64-
Download the binaries listed in the `downloads.txt` file using the `wget` command:
58+
Download the binaries listed in the `downloads.txt` file into a directory called `downloads` using the `wget` command:
6559

6660
```bash
6761
wget -q --show-progress \
@@ -78,18 +72,18 @@ ls -loh downloads
7872
```
7973

8074
```text
81-
total 584M
82-
-rw-r--r-- 1 root 41M May 9 13:35 cni-plugins-linux-arm64-v1.3.0.tgz
83-
-rw-r--r-- 1 root 34M Oct 26 15:21 containerd-1.7.8-linux-arm64.tar.gz
84-
-rw-r--r-- 1 root 22M Aug 14 00:19 crictl-v1.28.0-linux-arm.tar.gz
85-
-rw-r--r-- 1 root 15M Jul 11 02:30 etcd-v3.4.27-linux-arm64.tar.gz
86-
-rw-r--r-- 1 root 111M Oct 18 07:34 kube-apiserver
87-
-rw-r--r-- 1 root 107M Oct 18 07:34 kube-controller-manager
88-
-rw-r--r-- 1 root 51M Oct 18 07:34 kube-proxy
89-
-rw-r--r-- 1 root 52M Oct 18 07:34 kube-scheduler
90-
-rw-r--r-- 1 root 46M Oct 18 07:34 kubectl
91-
-rw-r--r-- 1 root 101M Oct 18 07:34 kubelet
92-
-rw-r--r-- 1 root 9.6M Aug 10 18:57 runc.arm64
75+
total 510M
76+
-rw-r--r-- 1 root 48M Oct 15 02:37 cni-plugins-linux-arm64-v1.6.0.tgz
77+
-rw-r--r-- 1 root 32M Nov 5 11:37 containerd-2.0.0-linux-arm64.tar.gz
78+
-rw-r--r-- 1 root 17M Aug 13 03:48 crictl-v1.31.1-linux-arm64.tar.gz
79+
-rw-r--r-- 1 root 16M Sep 11 11:28 etcd-v3.4.34-linux-arm64.tar.gz
80+
-rw-r--r-- 1 root 84M Oct 22 21:41 kube-apiserver
81+
-rw-r--r-- 1 root 79M Oct 22 21:41 kube-controller-manager
82+
-rw-r--r-- 1 root 53M Oct 22 21:41 kubectl
83+
-rw-r--r-- 1 root 72M Oct 22 21:41 kubelet
84+
-rw-r--r-- 1 root 61M Oct 22 21:41 kube-proxy
85+
-rw-r--r-- 1 root 60M Oct 22 21:41 kube-scheduler
86+
-rw-r--r-- 1 root 11M Nov 1 15:23 runc.arm64
9387
```
9488

9589
### Install kubectl
@@ -112,8 +106,8 @@ kubectl version --client
112106
```
113107

114108
```text
115-
Client Version: v1.28.3
116-
Kustomize Version: v5.0.4-0.20230601165947-6ce0bf390ce3
109+
Client Version: v1.31.2
110+
Kustomize Version: v5.4.2
117111
```
118112

119113
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.

docs/03-compute-resources.md

+11-11
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,13 @@ SSH will be used to configure the machines in the cluster. Verify that you have
3434

3535
If `root` SSH access is enabled for each of your machines you can skip this section.
3636

37-
By default, a new `debian` install disables SSH access for the `root` user. This is done for security reasons as the `root` user is a well known user on Linux systems, and if a weak password is used on a machine connected to the internet, well, let's just say it's only a matter of time before your machine belongs to someone else. As mention earlier, we are going to enable `root` access over SSH in order to streamline the steps in this tutorial. Security is a tradeoff, and in this case, we are optimizing for convenience. On each machine login via SSH using your user account, then switch to the `root` user using the `su` command:
37+
By default, a new `debian` install disables SSH access for the `root` user. This is done for security reasons as the `root` user has total administrative control of unix-like systems. If a weak password is used on a machine connected to the internet, well, let's just say it's only a matter of time before your machine belongs to someone else. As mentioned earlier, we are going to enable `root` access over SSH in order to streamline the steps in this tutorial. Security is a tradeoff, and in this case, we are optimizing for convenience. Log on to each machine via SSH using your user account, then switch to the `root` user using the `su` command:
3838

3939
```bash
4040
su - root
4141
```
4242

43-
Edit the `/etc/ssh/sshd_config` SSH daemon configuration file and the `PermitRootLogin` option to `yes`:
43+
Edit the `/etc/ssh/sshd_config` SSH daemon configuration file and set the `PermitRootLogin` option to `yes`:
4444

4545
```bash
4646
sed -i \
@@ -97,7 +97,7 @@ aarch64 GNU/Linux
9797

9898
## Hostnames
9999

100-
In this section you will assign hostnames to the `server`, `node-0`, and `node-1` machines. The hostname will be used when executing commands from the `jumpbox` to each machine. The hostname also play a major role within the cluster. Instead of Kubernetes clients using an IP address to issue commands to the Kubernetes API server, those client will use the `server` hostname instead. Hostnames are also used by each worker machine, `node-0` and `node-1` when registering with a given Kubernetes cluster.
100+
In this section you will assign hostnames to the `server`, `node-0`, and `node-1` machines. The hostname will be used when executing commands from the `jumpbox` to each machine. The hostname also plays a major role within the cluster. Instead of Kubernetes clients using an IP address to issue commands to the Kubernetes API server, those clients will use the `server` hostname instead. Hostnames are also used by each worker machine, `node-0` and `node-1` when registering with a given Kubernetes cluster.
101101

102102
To configure the hostname for each machine, run the following commands on the `jumpbox`.
103103

@@ -125,9 +125,9 @@ node-0.kubernetes.local
125125
node-1.kubernetes.local
126126
```
127127

128-
## DNS
128+
## Host Lookup Table
129129

130-
In this section you will generate a DNS `hosts` file which will be appended to `jumpbox` local `/etc/hosts` file and to the `/etc/hosts` file of all three machines used for this tutorial. This will allow each machine to be reachable using a hostname such as `server`, `node-0`, or `node-1`.
130+
In this section you will generate a `hosts` file which will be appended to `/etc/hosts` file on `jumpbox` and to the `/etc/hosts` files on all three cluster members used for this tutorial. This will allow each machine to be reachable using a hostname such as `server`, `node-0`, or `node-1`.
131131

132132
Create a new `hosts` file and add a header to identify the machines being added:
133133

@@ -136,7 +136,7 @@ echo "" > hosts
136136
echo "# Kubernetes The Hard Way" >> hosts
137137
```
138138

139-
Generate a DNS entry for each machine in the `machines.txt` file and append it to the `hosts` file:
139+
Generate a host entry for each machine in the `machines.txt` file and append it to the `hosts` file:
140140

141141
```bash
142142
while read IP FQDN HOST SUBNET; do
@@ -145,7 +145,7 @@ while read IP FQDN HOST SUBNET; do
145145
done < machines.txt
146146
```
147147

148-
Review the DNS entries in the `hosts` file:
148+
Review the host entries in the `hosts` file:
149149

150150
```bash
151151
cat hosts
@@ -159,7 +159,7 @@ XXX.XXX.XXX.XXX node-0.kubernetes.local node-0
159159
XXX.XXX.XXX.XXX node-1.kubernetes.local node-1
160160
```
161161

162-
## Adding DNS Entries To A Local Machine
162+
## Adding `/etc/hosts` Entries To A Local Machine
163163

164164
In this section you will append the DNS entries from the `hosts` file to the local `/etc/hosts` file on your `jumpbox` machine.
165165

@@ -206,9 +206,9 @@ node-0 aarch64 GNU/Linux
206206
node-1 aarch64 GNU/Linux
207207
```
208208

209-
## Adding DNS Entries To The Remote Machines
209+
## Adding `/etc/hosts` Entries To The Remote Machines
210210

211-
In this section you will append the DNS entries from `hosts` to `/etc/hosts` on each machine listed in the `machines.txt` text file.
211+
In this section you will append the host entries from `hosts` to `/etc/hosts` on each machine listed in the `machines.txt` text file.
212212

213213
Copy the `hosts` file to each machine and append the contents to `/etc/hosts`:
214214

@@ -220,6 +220,6 @@ while read IP FQDN HOST SUBNET; do
220220
done < machines.txt
221221
```
222222

223-
At this point hostnames can be used when connecting to machines from your `jumpbox` machine, or any of the three machines in the Kubernetes cluster. Instead of using IP addresess you can now connect to machines using a hostname such as `server`, `node-0`, or `node-1`.
223+
At this point hostnames can be used when connecting to machines from your `jumpbox` machine, or any of the three machines in the Kubernetes cluster. Instead of using IP addresses you can now connect to machines using a hostname such as `server`, `node-0`, or `node-1`.
224224

225225
Next: [Provisioning a CA and Generating TLS Certificates](04-certificate-authority.md)

docs/04-certificate-authority.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ cat ca.conf
1414

1515
You don't need to understand everything in the `ca.conf` file to complete this tutorial, but you should consider it a starting point for learning `openssl` and the configuration that goes into managing certificates at a high level.
1616

17-
Every certificate authority starts with a private key and root certificate. In this section we are going to create a self-signed certificate authority, and while that's all we need for this tutorial, this shouldn't be considered something you would do in a real-world production level environment.
17+
Every certificate authority starts with a private key and root certificate. In this section we are going to create a self-signed certificate authority, and while that's all we need for this tutorial, this shouldn't be considered something you would do in a real-world production environment.
1818

1919
Generate the CA configuration file, certificate, and private key:
2020

@@ -75,7 +75,7 @@ ls -1 *.crt *.key *.csr
7575

7676
## Distribute the Client and Server Certificates
7777

78-
In this section you will copy the various certificates to each machine under a directory that each Kubernetes components will search for the certificate pair. In a real-world environment these certificates should be treated like a set of sensitive secrets as they are often used as credentials by the Kubernetes components to authenticate to each other.
78+
In this section you will copy the various certificates to every machine at a path where each Kubernetes component will search for its certificate pair. In a real-world environment these certificates should be treated like a set of sensitive secrets as they are used as credentials by the Kubernetes components to authenticate to each other.
7979

8080
Copy the appropriate certificates and private keys to the `node-0` and `node-1` machines:
8181

docs/05-kubernetes-configuration-files.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Generating Kubernetes Configuration Files for Authentication
22

3-
In this lab you will generate [Kubernetes configuration files](https://kubernetes.io/docs/concepts/configuration/organize-cluster-access-kubeconfig/), also known as kubeconfigs, which enable Kubernetes clients to locate and authenticate to the Kubernetes API Servers.
3+
In this lab you will generate [Kubernetes client configuration files](https://kubernetes.io/docs/concepts/configuration/organize-cluster-access-kubeconfig/), typically called kubeconfigs, which configure Kubernetes clients to connect and authenticate to Kubernetes API Servers.
44

55
## Client Authentication Configs
66

@@ -12,7 +12,7 @@ When generating kubeconfig files for Kubelets the client certificate matching th
1212

1313
> The following commands must be run in the same directory used to generate the SSL certificates during the [Generating TLS Certificates](04-certificate-authority.md) lab.
1414
15-
Generate a kubeconfig file the node-0 worker node:
15+
Generate a kubeconfig file for the node-0 worker node:
1616

1717
```bash
1818
for host in node-0 node-1; do

docs/07-bootstrapping-etcd.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Copy `etcd` binaries and systemd unit files to the `server` instance:
88

99
```bash
1010
scp \
11-
downloads/etcd-v3.4.27-linux-arm64.tar.gz \
11+
downloads/etcd-v3.4.34-linux-arm64.tar.gz \
1212
units/etcd.service \
1313
root@server:~/
1414
```
@@ -27,8 +27,8 @@ Extract and install the `etcd` server and the `etcdctl` command line utility:
2727

2828
```bash
2929
{
30-
tar -xvf etcd-v3.4.27-linux-arm64.tar.gz
31-
mv etcd-v3.4.27-linux-arm64/etcd* /usr/local/bin/
30+
tar -xvf etcd-v3.4.34-linux-arm64.tar.gz
31+
mv etcd-v3.4.34-linux-arm64/etcd* /usr/local/bin/
3232
}
3333
```
3434

docs/08-bootstrapping-kubernetes-controllers.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# Bootstrapping the Kubernetes Control Plane
22

3-
In this lab you will bootstrap the Kubernetes control plane. The following components will be installed the controller machine: Kubernetes API Server, Scheduler, and Controller Manager.
3+
In this lab you will bootstrap the Kubernetes control plane. The following components will be installed on the controller machine: Kubernetes API Server, Scheduler, and Controller Manager.
44

55
## Prerequisites
66

7-
Copy Kubernetes binaries and systemd unit files to the `server` instance:
7+
Connect to the `jumpbox` and copy Kubernetes binaries and systemd unit files to the `server` instance:
88

99
```bash
1010
scp \
@@ -166,12 +166,12 @@ curl -k --cacert ca.crt https://server.kubernetes.local:6443/version
166166
```text
167167
{
168168
"major": "1",
169-
"minor": "28",
170-
"gitVersion": "v1.28.3",
171-
"gitCommit": "a8a1abc25cad87333840cd7d54be2efaf31a3177",
169+
"minor": "31",
170+
"gitVersion": "v1.31.2",
171+
"gitCommit": "5864a4677267e6adeae276ad85882a8714d69d9d",
172172
"gitTreeState": "clean",
173-
"buildDate": "2023-10-18T11:33:18Z",
174-
"goVersion": "go1.20.10",
173+
"buildDate": "2024-10-22T20:28:14Z",
174+
"goVersion": "go1.22.8",
175175
"compiler": "gc",
176176
"platform": "linux/arm64"
177177
}

docs/09-bootstrapping-kubernetes-workers.md

+8-8
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ done
2424
for host in node-0 node-1; do
2525
scp \
2626
downloads/runc.arm64 \
27-
downloads/crictl-v1.28.0-linux-arm.tar.gz \
28-
downloads/cni-plugins-linux-arm64-v1.3.0.tgz \
29-
downloads/containerd-1.7.8-linux-arm64.tar.gz \
27+
downloads/crictl-v1.31.1-linux-arm64.tar.gz \
28+
downloads/cni-plugins-linux-arm64-v1.6.0.tgz \
29+
downloads/containerd-2.0.0-linux-arm64.tar.gz \
3030
downloads/kubectl \
3131
downloads/kubelet \
3232
downloads/kube-proxy \
@@ -95,9 +95,9 @@ Install the worker binaries:
9595
```bash
9696
{
9797
mkdir -p containerd
98-
tar -xvf crictl-v1.28.0-linux-arm.tar.gz
99-
tar -xvf containerd-1.7.8-linux-arm64.tar.gz -C containerd
100-
tar -xvf cni-plugins-linux-arm64-v1.3.0.tgz -C /opt/cni/bin/
98+
tar -xvf crictl-v1.31.1-linux-arm64.tar.gz
99+
tar -xvf containerd-2.0.0-linux-arm64.tar.gz -C containerd
100+
tar -xvf cni-plugins-linux-arm64-v1.6.0.tgz -C /opt/cni/bin/
101101
mv runc.arm64 runc
102102
chmod +x crictl kubectl kube-proxy kubelet runc
103103
mv crictl kubectl kube-proxy kubelet runc /usr/local/bin/
@@ -169,8 +169,8 @@ ssh root@server \
169169

170170
```
171171
NAME STATUS ROLES AGE VERSION
172-
node-0 Ready <none> 1m v1.28.3
173-
node-1 Ready <none> 10s v1.28.3
172+
node-0 Ready <none> 1m v1.31.2
173+
node-1 Ready <none> 10s v1.31.2
174174
```
175175

176176
Next: [Configuring kubectl for Remote Access](10-configuring-kubectl.md)

docs/10-configuring-kubectl.md

+10-10
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ curl -k --cacert ca.crt \
1818
```text
1919
{
2020
"major": "1",
21-
"minor": "28",
22-
"gitVersion": "v1.28.3",
23-
"gitCommit": "a8a1abc25cad87333840cd7d54be2efaf31a3177",
21+
"minor": "31",
22+
"gitVersion": "v1.31.2",
23+
"gitCommit": "5864a4677267e6adeae276ad85882a8714d69d9d",
2424
"gitTreeState": "clean",
25-
"buildDate": "2023-10-18T11:33:18Z",
26-
"goVersion": "go1.20.10",
25+
"buildDate": "2024-10-22T20:28:14Z",
26+
"goVersion": "go1.22.8",
2727
"compiler": "gc",
2828
"platform": "linux/arm64"
2929
}
@@ -61,9 +61,9 @@ kubectl version
6161
```
6262

6363
```text
64-
Client Version: v1.28.3
65-
Kustomize Version: v5.0.4-0.20230601165947-6ce0bf390ce3
66-
Server Version: v1.28.3
64+
Client Version: v1.31.2
65+
Kustomize Version: v5.4.2
66+
Server Version: v1.31.2
6767
```
6868

6969
List the nodes in the remote Kubernetes cluster:
@@ -74,8 +74,8 @@ kubectl get nodes
7474

7575
```
7676
NAME STATUS ROLES AGE VERSION
77-
node-0 Ready <none> 30m v1.28.3
78-
node-1 Ready <none> 35m v1.28.3
77+
node-0 Ready <none> 30m v1.31.2
78+
node-1 Ready <none> 35m v1.31.2
7979
```
8080

8181
Next: [Provisioning Pod Network Routes](11-pod-network-routes.md)

0 commit comments

Comments
 (0)