Skip to content

Commit 08b198f

Browse files
Update to Kubernetes 1.32.3
1 parent 5a325c2 commit 08b198f

17 files changed

+184
-174
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ 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.31.x
23-
* [containerd](https://github.com/containerd/containerd) v2.0.x
22+
* [kubernetes](https://github.com/kubernetes/kubernetes) v1.32.x
23+
* [containerd](https://github.com/containerd/containerd) v2.1.x
2424
* [cni](https://github.com/containernetworking/cni) v1.6.x
25-
* [etcd](https://github.com/etcd-io/etcd) v3.4.x
25+
* [etcd](https://github.com/etcd-io/etcd) v3.6.x
2626

2727
## Labs
2828

ca.conf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ extendedKeyUsage = clientAuth, serverAuth
124124
keyUsage = critical, digitalSignature, keyEncipherment
125125
nsCertType = client
126126
nsComment = "Kube Controller Manager Certificate"
127-
subjectAltName = DNS:kube-proxy, IP:127.0.0.1
127+
subjectAltName = DNS:kube-controller-manager, IP:127.0.0.1
128128
subjectKeyIdentifier = hash
129129

130130
[kube-controller-manager_distinguished_name]
@@ -175,7 +175,7 @@ basicConstraints = CA:FALSE
175175
extendedKeyUsage = clientAuth, serverAuth
176176
keyUsage = critical, digitalSignature, keyEncipherment
177177
nsCertType = client
178-
nsComment = "Kube Scheduler Certificate"
178+
nsComment = "Kube API Server Certificate"
179179
subjectAltName = @kube-api-server_alt_names
180180
subjectKeyIdentifier = hash
181181

@@ -203,4 +203,4 @@ extendedKeyUsage = clientAuth
203203
keyUsage = critical, digitalSignature, keyEncipherment
204204
nsCertType = client
205205
nsComment = "Admin Client Certificate"
206-
subjectKeyIdentifier = hash
206+
subjectKeyIdentifier = hash

configs/encryption-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
kind: EncryptionConfig
2-
apiVersion: v1
1+
kind: EncryptionConfiguration
2+
apiVersion: apiserver.config.k8s.io/v1
33
resources:
44
- resources:
55
- secrets

configs/kubelet-config.yaml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
kind: KubeletConfiguration
22
apiVersion: kubelet.config.k8s.io/v1beta1
3+
address: "0.0.0.0"
34
authentication:
45
anonymous:
56
enabled: false
@@ -9,13 +10,16 @@ authentication:
910
clientCAFile: "/var/lib/kubelet/ca.crt"
1011
authorization:
1112
mode: Webhook
12-
clusterDomain: "cluster.local"
13-
clusterDNS:
14-
- "10.32.0.10"
1513
cgroupDriver: systemd
1614
containerRuntimeEndpoint: "unix:///var/run/containerd/containerd.sock"
17-
podCIDR: "SUBNET"
15+
enableServer: true
16+
failSwapOn: false
17+
maxPods: 16
18+
memorySwap:
19+
swapBehavior: NoSwap
20+
port: 10250
1821
resolvConf: "/etc/resolv.conf"
22+
registerNode: true
1923
runtimeRequestTimeout: "15m"
2024
tlsCertFile: "/var/lib/kubelet/kubelet.crt"
21-
tlsPrivateKeyFile: "/var/lib/kubelet/kubelet.key"
25+
tlsPrivateKeyFile: "/var/lib/kubelet/kubelet.key"

docs/01-prerequisites.md

Lines changed: 4 additions & 4 deletions
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 following 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 lists the four machines and their CPU, memory, and storage requirements.
88

99
| Name | Description | CPU | RAM | Storage |
1010
|---------|------------------------|-----|-------|---------|
@@ -13,9 +13,9 @@ This tutorial requires four (4) virtual or physical ARM64 machines running Debia
1313
| node-0 | Kubernetes worker node | 1 | 2GB | 20GB |
1414
| node-1 | Kubernetes worker node | 1 | 2GB | 20GB |
1515

16-
How you provision the machines is up to you, the only requirement is that each machine meet the above system requirements including the machine specs and OS version. Once you have all four machine provisioned, verify the system requirements by running the `uname` command on each machine:
16+
How you provision the machines is up to you, the only requirement is that each machine meet the above system requirements including the machine specs and OS version. Once you have all four machines provisioned, verify the system requirements by running the `uname` command on each machine:
1717

18-
```bash
18+
```bash
1919
uname -mov
2020
```
2121

@@ -25,6 +25,6 @@ After running the `uname` command you should see the following output:
2525
#1 SMP Debian 6.1.115-1 (2024-11-01) aarch64 GNU/Linux
2626
```
2727

28-
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.
28+
You may be 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.
2929

3030
Next: [setting-up-the-jumpbox](02-jumpbox.md)

docs/02-jumpbox.md

Lines changed: 24 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Set Up The Jumpbox
22

3-
In this lab you will set up one of the four machines to be a `jumpbox`. This machine will be used to run commands in 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.
3+
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.
44

5-
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. One thing we need to do before we get started is 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.
5+
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.
66

77
Log in to the `jumpbox`:
88

@@ -14,10 +14,13 @@ All commands will be run as the `root` user. This is being done for the sake of
1414

1515
### Install Command Line Utilities
1616

17-
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 preform various tasks throughout the tutorial.
17+
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 preform various tasks throughout the tutorial.
1818

1919
```bash
20-
apt-get -y install wget curl vim openssl git
20+
{
21+
apt-get update
22+
apt-get -y install wget curl vim openssl git
23+
}
2124
```
2225

2326
### Sync GitHub Repository
@@ -65,30 +68,30 @@ wget -q --show-progress \
6568
-i downloads.txt
6669
```
6770

68-
Depending on your internet connection speed it may take a while to download the `584` megabytes of binaries, and once the download is complete, you can list them using the `ls` command:
71+
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:
6972

7073
```bash
71-
ls -loh downloads
74+
ls -oh downloads
7275
```
7376

7477
```text
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
78+
total 544M
79+
-rw-r--r-- 1 root 48M Jan 6 08:13 cni-plugins-linux-arm64-v1.6.2.tgz
80+
-rw-r--r-- 1 root 34M Mar 17 19:33 containerd-2.1.0-beta.0-linux-arm64.tar.gz
81+
-rw-r--r-- 1 root 17M Dec 9 01:16 crictl-v1.32.0-linux-arm64.tar.gz
82+
-rw-r--r-- 1 root 21M Mar 27 16:15 etcd-v3.6.0-rc.3-linux-arm64.tar.gz
83+
-rw-r--r-- 1 root 87M Mar 11 20:31 kube-apiserver
84+
-rw-r--r-- 1 root 80M Mar 11 20:31 kube-controller-manager
85+
-rw-r--r-- 1 root 54M Mar 11 20:31 kubectl
86+
-rw-r--r-- 1 root 72M Mar 11 20:31 kubelet
87+
-rw-r--r-- 1 root 63M Mar 11 20:31 kube-proxy
88+
-rw-r--r-- 1 root 62M Mar 11 20:31 kube-scheduler
89+
-rw-r--r-- 1 root 11M Mar 4 04:14 runc.arm64
8790
```
8891

8992
### Install kubectl
9093

91-
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 once your cluster is provisioned later in this tutorial.
94+
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.
9295

9396
Use the `chmod` command to make the `kubectl` binary executable and move it to the `/usr/local/bin/` directory:
9497

@@ -106,8 +109,8 @@ kubectl version --client
106109
```
107110

108111
```text
109-
Client Version: v1.31.2
110-
Kustomize Version: v5.4.2
112+
Client Version: v1.32.3
113+
Kustomize Version: v5.5.0
111114
```
112115

113116
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

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ This tutorial will leverage a text file, which will serve as a machine database,
1010
IPV4_ADDRESS FQDN HOSTNAME POD_SUBNET
1111
```
1212

13-
Each of the columns corresponds to a machine IP address `IPV4_ADDRESS`, fully qualified domain name `FQDN`, host name `HOSTNAME`, and the IP subnet `POD_SUBNET`. Kubernetes assigns one IP address per `pod` and the `POD_SUBNET` represents the unique IP address range assigned to each machine in the cluster for doing so.
13+
Each of the columns corresponds to a machine IP address `IPV4_ADDRESS`, fully qualified domain name `FQDN`, host name `HOSTNAME`, and the IP subnet `POD_SUBNET`. Kubernetes assigns one IP address per `pod` and the `POD_SUBNET` represents the unique IP address range assigned to each machine in the cluster for doing so.
1414

1515
Here is an example machine database similar to the one used when creating this tutorial. Notice the IP addresses have been masked out. Your machines can be assigned any IP address as long as each machine is reachable from each other and the `jumpbox`.
1616

@@ -19,12 +19,12 @@ cat machines.txt
1919
```
2020

2121
```text
22-
XXX.XXX.XXX.XXX server.kubernetes.local server
22+
XXX.XXX.XXX.XXX server.kubernetes.local server
2323
XXX.XXX.XXX.XXX node-0.kubernetes.local node-0 10.200.0.0/24
2424
XXX.XXX.XXX.XXX node-1.kubernetes.local node-1 10.200.1.0/24
2525
```
2626

27-
Now it's your turn to create a `machines.txt` file with the details for the three machines you will be using to create your Kubernetes cluster. Use the example machine database from above and add the details for your machines.
27+
Now it's your turn to create a `machines.txt` file with the details for the three machines you will be using to create your Kubernetes cluster. Use the example machine database from above and add the details for your machines.
2828

2929
## Configuring SSH Access
3030

@@ -44,7 +44,7 @@ Edit the `/etc/ssh/sshd_config` SSH daemon configuration file and set the `Permi
4444

4545
```bash
4646
sed -i \
47-
's/^#PermitRootLogin.*/PermitRootLogin yes/' \
47+
's/^#*PermitRootLogin.*/PermitRootLogin yes/' \
4848
/etc/ssh/sshd_config
4949
```
5050

@@ -66,25 +66,25 @@ ssh-keygen
6666

6767
```text
6868
Generating public/private rsa key pair.
69-
Enter file in which to save the key (/root/.ssh/id_rsa):
70-
Enter passphrase (empty for no passphrase):
71-
Enter same passphrase again:
69+
Enter file in which to save the key (/root/.ssh/id_rsa):
70+
Enter passphrase (empty for no passphrase):
71+
Enter same passphrase again:
7272
Your identification has been saved in /root/.ssh/id_rsa
7373
Your public key has been saved in /root/.ssh/id_rsa.pub
7474
```
7575

7676
Copy the SSH public key to each machine:
7777

7878
```bash
79-
while read IP FQDN HOST SUBNET; do
79+
while read IP FQDN HOST SUBNET; do
8080
ssh-copy-id root@${IP}
8181
done < machines.txt
8282
```
8383

8484
Once each key is added, verify SSH public key access is working:
8585

8686
```bash
87-
while read IP FQDN HOST SUBNET; do
87+
while read IP FQDN HOST SUBNET; do
8888
ssh -n root@${IP} uname -o -m
8989
done < machines.txt
9090
```
@@ -104,8 +104,8 @@ To configure the hostname for each machine, run the following commands on the `j
104104
Set the hostname on each machine listed in the `machines.txt` file:
105105

106106
```bash
107-
while read IP FQDN HOST SUBNET; do
108-
CMD="sed -i 's/^127.0.1.1.*/127.0.1.1\t${FQDN} ${HOST}/' /etc/hosts"
107+
while read IP FQDN HOST SUBNET; do
108+
CMD="sed -i 's/^127.0.0.1.*/127.0.0.1\t${FQDN} ${HOST} localhost/' /etc/hosts"
109109
ssh -n root@${IP} "$CMD"
110110
ssh -n root@${IP} hostnamectl hostname ${HOST}
111111
done < machines.txt
@@ -127,7 +127,7 @@ node-1.kubernetes.local
127127

128128
## Host Lookup Table
129129

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`.
130+
In this section you will generate a `hosts` file which will be appended to `/etc/hosts` file on the `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

@@ -139,7 +139,7 @@ echo "# Kubernetes The Hard Way" >> hosts
139139
Generate a host entry for each machine in the `machines.txt` file and append it to the `hosts` file:
140140

141141
```bash
142-
while read IP FQDN HOST SUBNET; do
142+
while read IP FQDN HOST SUBNET; do
143143
ENTRY="${IP} ${FQDN} ${HOST}"
144144
echo $ENTRY >> hosts
145145
done < machines.txt
@@ -184,8 +184,6 @@ cat /etc/hosts
184184
ff02::1 ip6-allnodes
185185
ff02::2 ip6-allrouters
186186
187-
188-
189187
# Kubernetes The Hard Way
190188
XXX.XXX.XXX.XXX server.kubernetes.local server
191189
XXX.XXX.XXX.XXX node-0.kubernetes.local node-0
@@ -220,6 +218,6 @@ while read IP FQDN HOST SUBNET; do
220218
done < machines.txt
221219
```
222220

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`.
221+
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`.
224222

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

docs/04-certificate-authority.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ In this lab you will provision a [PKI Infrastructure](https://en.wikipedia.org/w
44

55
## Certificate Authority
66

7-
In this section you will provision a Certificate Authority that can be used to generate additional TLS certificates for the other Kubernetes components. Setting up CA and generating certificates using `openssl` can be time-consuming, especially when doing it for the first time. To streamline this lab, I've included an openssl configuration file `ca.conf`, which defines all the details needed to generate certificates for each Kubernetes component.
7+
In this section you will provision a Certificate Authority that can be used to generate additional TLS certificates for the other Kubernetes components. Setting up CA and generating certificates using `openssl` can be time-consuming, especially when doing it for the first time. To streamline this lab, I've included an openssl configuration file `ca.conf`, which defines all the details needed to generate certificates for each Kubernetes component.
88

99
Take a moment to review the `ca.conf` configuration file:
1010

@@ -57,7 +57,7 @@ for i in ${certs[*]}; do
5757
openssl req -new -key "${i}.key" -sha256 \
5858
-config "ca.conf" -section ${i} \
5959
-out "${i}.csr"
60-
60+
6161
openssl x509 -req -days 3653 -in "${i}.csr" \
6262
-copy_extensions copyall \
6363
-sha256 -CA "ca.crt" \
@@ -81,15 +81,15 @@ Copy the appropriate certificates and private keys to the `node-0` and `node-1`
8181

8282
```bash
8383
for host in node-0 node-1; do
84-
ssh root@$host mkdir /var/lib/kubelet/
85-
86-
scp ca.crt root@$host:/var/lib/kubelet/
87-
88-
scp $host.crt \
89-
root@$host:/var/lib/kubelet/kubelet.crt
90-
91-
scp $host.key \
92-
root@$host:/var/lib/kubelet/kubelet.key
84+
ssh root@${host} mkdir /var/lib/kubelet/
85+
86+
scp ca.crt root@${host}:/var/lib/kubelet/
87+
88+
scp ${host}.crt \
89+
root@${host}:/var/lib/kubelet/kubelet.crt
90+
91+
scp ${host}.key \
92+
root@${host}:/var/lib/kubelet/kubelet.key
9393
done
9494
```
9595

docs/05-kubernetes-configuration-files.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ In this section you will generate kubeconfig files for the `kubelet` and the `ad
88

99
### The kubelet Kubernetes Configuration File
1010

11-
When generating kubeconfig files for Kubelets the client certificate matching the Kubelet's node name must be used. This will ensure Kubelets are properly authorized by the Kubernetes [Node Authorizer](https://kubernetes.io/docs/admin/authorization/node/).
11+
When generating kubeconfig files for Kubelets the client certificate matching the Kubelet's node name must be used. This will ensure Kubelets are properly authorized by the Kubernetes [Node Authorizer](https://kubernetes.io/docs/reference/access-authn-authz/node/).
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 for the node-0 worker node:
15+
Generate a kubeconfig file for the `node-0` and `node-1` worker nodes:
1616

1717
```bash
1818
for host in node-0 node-1; do
@@ -184,21 +184,21 @@ admin.kubeconfig
184184

185185
## Distribute the Kubernetes Configuration Files
186186

187-
Copy the `kubelet` and `kube-proxy` kubeconfig files to the node-0 instance:
187+
Copy the `kubelet` and `kube-proxy` kubeconfig files to the `node-0` and `node-1` machines:
188188

189189
```bash
190190
for host in node-0 node-1; do
191-
ssh root@$host "mkdir /var/lib/{kube-proxy,kubelet}"
192-
191+
ssh root@${host} "mkdir -p /var/lib/{kube-proxy,kubelet}"
192+
193193
scp kube-proxy.kubeconfig \
194-
root@$host:/var/lib/kube-proxy/kubeconfig \
195-
194+
root@${host}:/var/lib/kube-proxy/kubeconfig \
195+
196196
scp ${host}.kubeconfig \
197-
root@$host:/var/lib/kubelet/kubeconfig
197+
root@${host}:/var/lib/kubelet/kubeconfig
198198
done
199199
```
200200

201-
Copy the `kube-controller-manager` and `kube-scheduler` kubeconfig files to the controller instance:
201+
Copy the `kube-controller-manager` and `kube-scheduler` kubeconfig files to the `server` machine:
202202

203203
```bash
204204
scp admin.kubeconfig \

0 commit comments

Comments
 (0)