You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/labs/kubernetes-the-hard-way/lab0-README.md
+2-3Lines changed: 2 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,11 +4,10 @@ author: Wale Soyinka
4
4
contributors: Steven Spencer
5
5
---
6
6
7
-
This is a fork of the original ["Kubernetes the hard way"](https://github.com/kelseyhightower/kubernetes-the-hard-way) originally written by Kelsey Hightower (GitHub: kelseyhightower).
8
-
Unlike the original that bases itself on Debian like distributions for the ARM64 architecture, this fork targets Enterprise Linux distributions such as Rocky Linux running on x86_64 architecture.
9
-
10
7
# Kubernetes The Hard Way (Rocky Linux)
11
8
9
+
> This is a fork of the original ["Kubernetes the hard way"](https://github.com/kelseyhightower/kubernetes-the-hard-way) originally written by Kelsey Hightower (GitHub: kelseyhightower). Unlike the original that bases itself on Debian like distributions for the ARM64 architecture, this fork targets Enterprise Linux distributions such as Rocky Linux running on x86_64 architecture.
10
+
12
11
This tutorial walks you through setting up Kubernetes the hard way. This guide is not for someone looking for a fully automated tool to bring up a Kubernetes cluster. Kubernetes The Hard Way, designed for learning, means taking the long route to ensure you understand each task required to bootstrap a Kubernetes cluster.
13
12
14
13
Do not view the results of this tutorial as production ready, and it might not receive support from the community, but do not let that stop you from learning!
Copy file name to clipboardExpand all lines: docs/labs/kubernetes-the-hard-way/lab1-prerequisites.md
+2-3Lines changed: 2 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,11 +7,10 @@ tags:
7
7
- lab exercise
8
8
---
9
9
10
-
This is a fork of the original ["Kubernetes the hard way"](https://github.com/kelseyhightower/kubernetes-the-hard-way) originally written by Kelsey Hightower (GitHub: kelseyhightower).
11
-
Unlike the original that bases itself on Debian like distributions for the ARM64 architecture, this fork targets Enterprise Linux distributions such as Rocky Linux running on x86_64 architecture.
12
-
13
10
# Lab 1: Prerequisites
14
11
12
+
> This is a fork of the original ["Kubernetes the hard way"](https://github.com/kelseyhightower/kubernetes-the-hard-way) originally written by Kelsey Hightower (GitHub: kelseyhightower). Unlike the original that bases itself on Debian like distributions for the ARM64 architecture, this fork targets Enterprise Linux distributions such as Rocky Linux running on x86_64 architecture.
13
+
15
14
In this lab you will review the machine requirements necessary to follow this tutorial.
Copy file name to clipboardExpand all lines: docs/labs/kubernetes-the-hard-way/lab10-configuring-kubectl.md
+5-7Lines changed: 5 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,11 +11,9 @@ tags:
11
11
- kubectl
12
12
---
13
13
14
-
This is a fork of the original ["Kubernetes the hard way"](https://github.com/kelseyhightower/kubernetes-the-hard-way) originally written by Kelsey Hightower (GitHub: kelseyhightower).
15
-
Unlike the original that bases itself on Debian like distributions for the ARM64 architecture, this fork targets Enterprise Linux distributions such as Rocky Linux running on x86_64 architecture.
14
+
# Lab 10: Configuring `kubectl` for Remote Access
16
15
17
-
18
-
# Lab 10: Configuring kubectl for Remote Access
16
+
> This is a fork of the original ["Kubernetes the hard way"](https://github.com/kelseyhightower/kubernetes-the-hard-way) originally written by Kelsey Hightower (GitHub: kelseyhightower). Unlike the original that bases itself on Debian like distributions for the ARM64 architecture, this fork targets Enterprise Linux distributions such as Rocky Linux running on x86_64 architecture.
19
17
20
18
In this lab you will generate a kubeconfig file for the `kubectl` command line utility based on the `admin` user credentials.
21
19
@@ -25,7 +23,7 @@ In this lab you will generate a kubeconfig file for the `kubectl` command line u
25
23
26
24
Each kubeconfig requires a Kubernetes API Server to connect to.
27
25
28
-
You should be able to ping `server.kubernetes.local` based on the `/etc/hosts` DNS entry from a previous lap.
26
+
You should be able to ping `server.kubernetes.local` based on the `/etc/hosts` DNS entry from an earlier lab.
29
27
30
28
```bash
31
29
curl -k --cacert ca.crt \
@@ -64,8 +62,8 @@ Generate a kubeconfig file suitable for authenticating as the `admin` user:
The results of running the command above should create a kubeconfig file in the default location `~/.kube/config` used by the `kubectl` commandline tool. This also means you can run the `kubectl` command without specifying a config.
68
65
66
+
The results of running the command above should create a kubeconfig file in the default location `~/.kube/config` used by the `kubectl` command line tool. This also means you can run the `kubectl` command without specifying a config.
69
67
70
68
## Verification
71
69
@@ -87,7 +85,7 @@ List the nodes in the remote Kubernetes cluster:
Copy file name to clipboardExpand all lines: docs/labs/kubernetes-the-hard-way/lab11-pod-network-routes.md
+4-6Lines changed: 4 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,12 +11,11 @@ tags:
11
11
- kubectl
12
12
---
13
13
14
-
This is a fork of the original ["Kubernetes the hard way"](https://github.com/kelseyhightower/kubernetes-the-hard-way) originally written by Kelsey Hightower (GitHub: kelseyhightower).
15
-
Unlike the original that bases itself on Debian like distributions for the ARM64 architecture, this fork targets Enterprise Linux distributions such as Rocky Linux running on x86_64 architecture.
16
-
17
14
# Lab 11: Provisioning Pod Network Routes
18
15
19
-
Pods scheduled to a node receive an IP address from the node's Pod CIDR range. At this point pods can not communicate with other pods running on different nodes due to missing network [routes](https://cloud.google.com/compute/docs/vpc/routes).
16
+
> This is a fork of the original ["Kubernetes the hard way"](https://github.com/kelseyhightower/kubernetes-the-hard-way) originally written by Kelsey Hightower (GitHub: kelseyhightower). Unlike the original that bases itself on Debian like distributions for the ARM64 architecture, this fork targets Enterprise Linux distributions such as Rocky Linux running on x86_64 architecture.
17
+
18
+
Pods scheduled to a node receive an IP address from the node's Pod CIDR range. At this point pods cannot communicate with other pods running on different nodes due to missing network [routes](https://cloud.google.com/compute/docs/vpc/routes).
20
19
21
20
In this lab you will create a route for each worker node that maps the node's Pod CIDR range to the node's internal IP address.
22
21
@@ -57,7 +56,7 @@ ssh root@node-1 <<EOF
57
56
EOF
58
57
```
59
58
60
-
## Verification
59
+
## Verification
61
60
62
61
```bash
63
62
ssh root@server ip route
@@ -90,5 +89,4 @@ default via XXX.XXX.XXX.XXX dev ens160
90
89
XXX.XXX.XXX.0/24 dev ens160 proto kernel scope link src XXX.XXX.XXX.XXX
Copy file name to clipboardExpand all lines: docs/labs/kubernetes-the-hard-way/lab12-smoke-test.md
+10-13Lines changed: 10 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,11 +11,10 @@ tags:
11
11
- kubectl
12
12
---
13
13
14
-
This is a fork of the original ["Kubernetes the hard way"](https://github.com/kelseyhightower/kubernetes-the-hard-way) originally written by Kelsey Hightower (GitHub: kelseyhightower).
15
-
Unlike the original that bases itself on Debian like distributions for the ARM64 architecture, this fork targets Enterprise Linux distributions such as Rocky Linux running on x86_64 architecture.
16
-
17
14
# Lab 12: Smoke Test
18
15
16
+
> This is a fork of the original ["Kubernetes the hard way"](https://github.com/kelseyhightower/kubernetes-the-hard-way) originally written by Kelsey Hightower (GitHub: kelseyhightower). Unlike the original that bases itself on Debian like distributions for the ARM64 architecture, this fork targets Enterprise Linux distributions such as Rocky Linux running on x86_64 architecture.
17
+
19
18
In this lab you will complete a series of tasks to ensure your Kubernetes cluster is functioning correctly.
Print a hexdump of the `kubernetes-the-hard-way` secret stored in etcd:
31
+
Print a hexdump of the `kubernetes-the-hard-way` secret stored in `etcd`:
33
32
34
33
```bash
35
34
ssh root@server \
@@ -62,7 +61,7 @@ ssh root@server \
62
61
0000015a
63
62
```
64
63
65
-
The etcd key should be prefixed with `k8s:enc:aescbc:v1:key1`, which indicates the `aescbc` provider was used to encrypt the data with the `key1` encryption key.
64
+
You need to prefix the `etcd` key with `k8s:enc:aescbc:v1:key1`, which indicates using the `aescbc` provider to encrypt the data with the `key1` encryption key.
66
65
67
66
## Deployments
68
67
@@ -108,7 +107,7 @@ Forwarding from 127.0.0.1:8080 -> 80
108
107
Forwarding from [::1]:8080 -> 80
109
108
```
110
109
111
-
In a new terminal make an HTTP request using the forwarding address:
110
+
In a new terminal make an HTTP request with the forwarding address:
112
111
113
112
```bash
114
113
curl --head http://127.0.0.1:8080
@@ -126,7 +125,7 @@ ETag: "67a34638-267"
126
125
Accept-Ranges: bytes
127
126
```
128
127
129
-
Switch back to the previous terminal and stop the port forwarding to the `nginx` pod by typing `[CTRL]` + `[C]`:
128
+
Switch back to the previous terminal and stop the port forwarding to the `nginx` pod by typing ++ctrl+c++:
130
129
131
130
```text
132
131
Forwarding from 127.0.0.1:8080 -> 80
@@ -154,7 +153,7 @@ kubectl logs $POD_NAME
154
153
155
154
In this section you will verify the ability to [execute commands in a container](https://kubernetes.io/docs/tasks/debug-application-cluster/get-shell-running-container/#running-individual-commands-in-a-container).
156
155
157
-
Print the nginx version by executing the `nginx -v` command in the `nginx` container:
156
+
Print the `nginx` version by executing the `nginx -v` command in the `nginx` container:
158
157
159
158
```bash
160
159
kubectl exec -ti $POD_NAME -- nginx -v
@@ -166,7 +165,7 @@ nginx version: nginx/1.27.4
166
165
167
166
## Services
168
167
169
-
In this section you will verify the ability to expose applications using a [Service](https://kubernetes.io/docs/concepts/services-networking/service/).
168
+
In this section you will verify the ability to expose applications with a [Service](https://kubernetes.io/docs/concepts/services-networking/service/).
170
169
171
170
Expose the `nginx` deployment using a [NodePort](https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport) service:
> The LoadBalancer service type can not be used because your cluster is not configured with [cloud provider integration](https://kubernetes.io/docs/getting-started-guides/scratch/#cloud-provider). Setting up cloud provider integration is out of scope for this tutorial.
177
+
> You cannot use the LoadBalancer service type because your cluster is not configured with [cloud provider integration](https://kubernetes.io/docs/getting-started-guides/scratch/#cloud-provider). Setting up cloud provider integration is out of scope for this tutorial.
179
178
180
179
Retrieve the node port assigned to the `nginx` service:
181
180
@@ -184,9 +183,7 @@ NODE_PORT=$(kubectl get svc nginx \
Copy file name to clipboardExpand all lines: docs/labs/kubernetes-the-hard-way/lab13-cleanup.md
+3-5Lines changed: 3 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,17 +7,15 @@ tags:
7
7
- lab exercise
8
8
---
9
9
10
-
This is a fork of the original ["Kubernetes the hard way"](https://github.com/kelseyhightower/kubernetes-the-hard-way) originally written by Kelsey Hightower (GitHub: kelseyhightower).
11
-
Unlike the original that bases itself on Debian like distributions for the ARM64 architecture, this fork targets Enterprise Linux distributions such as Rocky Linux running on x86_64 architecture.
12
-
13
-
14
10
# Lab 13: Cleaning Up
15
11
12
+
> This is a fork of the original ["Kubernetes the hard way"](https://github.com/kelseyhightower/kubernetes-the-hard-way) originally written by Kelsey Hightower (GitHub: kelseyhightower). Unlike the original that bases itself on Debian like distributions for the ARM64 architecture, this fork targets Enterprise Linux distributions such as Rocky Linux running on x86_64 architecture.
13
+
16
14
In this lab you will delete the compute resources created during this tutorial.
17
15
18
16
## Compute Instances
19
17
20
-
Previous versions of this guide made use of GCP resources for various aspects of compute and networking. The current version is agnostic, and all configuration is performed on the `jumpbox`, `server`, or nodes.
18
+
Previous versions of this guide made use of GCP resources for various aspects of compute and networking. The current version is agnostic, and you perform all configurations on the `jumpbox`, `server`, or nodes.
21
19
22
20
Clean up is as simple as deleting all virtual machines you created for this exercise.
Copy file name to clipboardExpand all lines: docs/labs/kubernetes-the-hard-way/lab2-jumpbox.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,12 +1,12 @@
1
1
---
2
2
author: Wale Soyinka
3
+
contributors: Steven Spencer
3
4
tags:
4
5
- kubernetes
5
6
- k8s
6
7
- lab exercise
7
8
---
8
9
9
-
10
10
# Lab 2: Set Up The Jumpbox
11
11
12
12
In this lab you will set up one of the four machines to be a `jumpbox`. You will use this machine to run commands in this tutorial. While the use of a dedicated machine is to ensure consistency, you can run these commands from just about any machine, including your personal workstation running macOS or Linux.
@@ -56,7 +56,7 @@ pwd
56
56
57
57
## Download Binaries
58
58
59
-
Here you will download the binaries for the various Kubernetes components. Store these binaries in the `Downloads` directory on the `jumpbox`. This will reduce the amount of internet bandwidth required to complete this tutorial as you avoid downloading the binaries multiple times for each machine in our Kubernetes cluster.
59
+
Here you will download the binaries for the various Kubernetes components. Store these binaries in the `Downloads` directory on the `jumpbox`. This will reduce the amount of internet bandwidth required to complete this tutorial as you avoid downloading the binaries many times for each machine in our Kubernetes cluster.
60
60
61
61
The `download.txt` file lists the binaries you will download, which you can review using the `cat` command:
62
62
@@ -95,7 +95,7 @@ total 557M
95
95
-rw-r--r--. 1 root 11M Feb 13 20:19 runc.amd64
96
96
```
97
97
98
-
## Install kubectl
98
+
## Install `kubectl`
99
99
100
100
In this section you will install the `kubectl`, the official Kubernetes client command line tool, on the `jumpbox` machine. You will use `kubectl` to interact with the Kubernetes control plane after provisioning of your cluster completes later in this tutorial.
Copy file name to clipboardExpand all lines: docs/labs/kubernetes-the-hard-way/lab3-compute-resources.md
+2-1Lines changed: 2 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,6 @@
1
1
---
2
2
author: Wale Soyinka
3
+
contributors: Steven Spencer
3
4
tags:
4
5
- kubernetes
5
6
- k8s
@@ -42,7 +43,7 @@ You will use SSH to configure the machines in the cluster. Verify that you have
42
43
43
44
If you have `root` SSH access for each of your machines you can skip this section.
44
45
45
-
By default, a new `Rocky Linux` install disables SSH access for the `root` user. This is for security reasons, as the `root` user has total administrative control of unix-like systems. Weak passwords are very bad for internet connected machines. As mentioned earlier, you are going to enable `root` access over SSH to streamline the steps in this tutorial. Security is a trade-off, and in this case, you are optimizing for convenience.
46
+
By default, a new `Rocky Linux` install disables SSH access for the `root` user. This is for security reasons, as the `root` user has total administrative control of unix-like systems. Weak passwords are very bad for internet connected machines. As mentioned earlier, you are going to enable `root` access over SSH to streamline the steps in this tutorial. Security is a trade-off, and in this case, you are optimizing for convenience.
46
47
47
48
Log on to each machine using SSH and your user account, then switch to the `root` user with the `su` command:
Copy file name to clipboardExpand all lines: docs/labs/kubernetes-the-hard-way/lab4-certificate-authority.md
+17-8Lines changed: 17 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,29 +1,37 @@
1
1
---
2
2
author: Wale Soyinka
3
+
contributors: Steven Spencer
3
4
tags:
4
5
- kubernetes
5
6
- k8s
6
7
- lab exercise
7
8
---
8
9
9
-
10
10
# Lab 4: Provisioning a CA and Generating TLS Certificates
11
11
12
-
In this lab you will provision a [PKI Infrastructure](https://en.wikipedia.org/wiki/Public_key_infrastructure) using openssl to bootstrap a Certificate Authority, and generate TLS certificates for the following components: kube-apiserver, kube-controller-manager, kube-scheduler, kubelet, and kube-proxy. The commands in this section should be run from the `jumpbox`.
12
+
In this lab you will provision a [PKI Infrastructure](https://en.wikipedia.org/wiki/Public_key_infrastructure) using openssl to bootstrap a Certificate Authority, and generate TLS certificates for the following components:
13
+
14
+
* kube-apiserver
15
+
* kube-controller-manager
16
+
* kube-scheduler
17
+
* kubelet
18
+
* kube-proxy
19
+
20
+
Run commands in this section from the `jumpbox`.
13
21
14
22
## Certificate Authority
15
23
16
-
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.
24
+
In this section you will provision a Certificate Authority that you will use to generate additional TLS certificates for the other Kubernetes components. Setting up CA and generating certificates with`openssl` can be time-consuming, especially when doing it for the first time. To streamline this lab, the inclusion of an `openssl` configuration file,`ca.conf`, defines all the details needed to generate certificates for each Kubernetes component.
17
25
18
26
Take a moment to review the `ca.conf` configuration file:
19
27
20
28
```bash
21
29
cat ca.conf
22
30
```
23
31
24
-
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.
32
+
You do not 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.
25
33
26
-
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.
34
+
Every certificate authority starts with a private key and root certificate. In this section you are going to create a self-signed certificate authority, and while that is all you need for this tutorial, this is something you should not consider in a real-world production environment.
27
35
28
36
Generate the CA configuration file, certificate, and private key:
29
37
@@ -41,7 +49,8 @@ Results:
41
49
ca.crt ca.key
42
50
```
43
51
44
-
!!! Tip:
52
+
!!! Tip
53
+
45
54
To view the details encoded in the generated certificate file (ca.crt), you can use this openssl command `openssl x509 -in ca.crt -text -noout | less`.
46
55
47
56
## Create Client and Server Certificates
@@ -85,7 +94,7 @@ ls -1 *.crt *.key *.csr
85
94
86
95
## Distribute the Client and Server Certificates
87
96
88
-
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.
97
+
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, you would treat these certificates as a set of sensitive secrets, because Kubernetes uses these components as credentials to authenticate to each other.
89
98
90
99
Copy the appropriate certificates and private keys to the `node-0` and `node-1` machines:
91
100
@@ -113,6 +122,6 @@ scp \
113
122
root@server:~/
114
123
```
115
124
116
-
> The `kube-proxy`, `kube-controller-manager`, `kube-scheduler`, and `kubelet` client certificates will be used to generate client authentication configuration files in the next lab.
125
+
> You will use the `kube-proxy`, `kube-controller-manager`, `kube-scheduler`, and `kubelet` client certificates to generate client authentication configuration files in the next lab.
117
126
118
127
Next: [Generating Kubernetes Configuration Files for Authentication](lab5-kubernetes-configuration-files.md)
0 commit comments