diff --git a/docs/01-prerequisites.md b/docs/01-prerequisites.md index 4e9ad1d..ef359e8 100644 --- a/docs/01-prerequisites.md +++ b/docs/01-prerequisites.md @@ -6,6 +6,8 @@ In this lab you will review the machine requirements necessary to follow this tu This tutorial requires four (4) virtual or physical ARM64 or AMD64 machines running Debian 12 (bookworm). The following table lists the four machines and their CPU, memory, and storage requirements. +The "jumpbox" is from where we will be administering/configuring the Kubernetes cluster. + | Name | Description | CPU | RAM | Storage | |---------|------------------------|-----|-------|---------| | jumpbox | Administration host | 1 | 512MB | 10GB | @@ -13,7 +15,12 @@ This tutorial requires four (4) virtual or physical ARM64 or AMD64 machines runn | node-0 | Kubernetes worker node | 1 | 2GB | 20GB | | node-1 | Kubernetes worker node | 1 | 2GB | 20GB | -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 OS requirements by viewing the `/etc/os-release` file: +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. + +> [!NOTE] +> You should configure these VMs in headless (no GUI/desktop) mode. Our labs will be performed entirely on the command line. + +Once you have all four machines provisioned, verify the OS requirements by viewing the `/etc/os-release` file: ```bash cat /etc/os-release diff --git a/docs/03-compute-resources.md b/docs/03-compute-resources.md index 3918244..c4caae9 100644 --- a/docs/03-compute-resources.md +++ b/docs/03-compute-resources.md @@ -214,8 +214,7 @@ Copy the `hosts` file to each machine and append the contents to `/etc/hosts`: ```bash while read IP FQDN HOST SUBNET; do scp hosts root@${HOST}:~/ - ssh -n \ - root@${HOST} "cat hosts >> /etc/hosts" + ssh -n root@${HOST} "cat hosts >> /etc/hosts" done < machines.txt ``` diff --git a/docs/05-kubernetes-configuration-files.md b/docs/05-kubernetes-configuration-files.md index 08a4ff7..0fe6b4d 100644 --- a/docs/05-kubernetes-configuration-files.md +++ b/docs/05-kubernetes-configuration-files.md @@ -45,106 +45,39 @@ node-0.kubeconfig node-1.kubeconfig ``` -### The kube-proxy Kubernetes Configuration File +### The Kubernetes Service Configuration Files -Generate a kubeconfig file for the `kube-proxy` service: +Generate a `.kubeconfig` file for the `kube-proxy`, `kube-controller-manager`, and `kube-scheduler` services: ```bash -{ +for service in proxy controller-manager scheduler; do kubectl config set-cluster kubernetes-the-hard-way \ --certificate-authority=ca.crt \ --embed-certs=true \ --server=https://server.kubernetes.local:6443 \ - --kubeconfig=kube-proxy.kubeconfig + --kubeconfig=kube-${service}.kubeconfig - kubectl config set-credentials system:kube-proxy \ - --client-certificate=kube-proxy.crt \ - --client-key=kube-proxy.key \ + kubectl config set-credentials system:kube-${service} \ + --client-certificate=kube-${service}.crt \ + --client-key=kube-${service}.key \ --embed-certs=true \ - --kubeconfig=kube-proxy.kubeconfig + --kubeconfig=kube-${service}.kubeconfig kubectl config set-context default \ --cluster=kubernetes-the-hard-way \ - --user=system:kube-proxy \ - --kubeconfig=kube-proxy.kubeconfig + --user=system:kube-${service} \ + --kubeconfig=kube-${service}.kubeconfig kubectl config use-context default \ - --kubeconfig=kube-proxy.kubeconfig -} + --kubeconfig=kube-${service}.kubeconfig +done ``` Results: ```text kube-proxy.kubeconfig -``` - -### The kube-controller-manager Kubernetes Configuration File - -Generate a kubeconfig file for the `kube-controller-manager` service: - -```bash -{ - kubectl config set-cluster kubernetes-the-hard-way \ - --certificate-authority=ca.crt \ - --embed-certs=true \ - --server=https://server.kubernetes.local:6443 \ - --kubeconfig=kube-controller-manager.kubeconfig - - kubectl config set-credentials system:kube-controller-manager \ - --client-certificate=kube-controller-manager.crt \ - --client-key=kube-controller-manager.key \ - --embed-certs=true \ - --kubeconfig=kube-controller-manager.kubeconfig - - kubectl config set-context default \ - --cluster=kubernetes-the-hard-way \ - --user=system:kube-controller-manager \ - --kubeconfig=kube-controller-manager.kubeconfig - - kubectl config use-context default \ - --kubeconfig=kube-controller-manager.kubeconfig -} -``` - -Results: - -```text kube-controller-manager.kubeconfig -``` - - -### The kube-scheduler Kubernetes Configuration File - -Generate a kubeconfig file for the `kube-scheduler` service: - -```bash -{ - kubectl config set-cluster kubernetes-the-hard-way \ - --certificate-authority=ca.crt \ - --embed-certs=true \ - --server=https://server.kubernetes.local:6443 \ - --kubeconfig=kube-scheduler.kubeconfig - - kubectl config set-credentials system:kube-scheduler \ - --client-certificate=kube-scheduler.crt \ - --client-key=kube-scheduler.key \ - --embed-certs=true \ - --kubeconfig=kube-scheduler.kubeconfig - - kubectl config set-context default \ - --cluster=kubernetes-the-hard-way \ - --user=system:kube-scheduler \ - --kubeconfig=kube-scheduler.kubeconfig - - kubectl config use-context default \ - --kubeconfig=kube-scheduler.kubeconfig -} -``` - -Results: - -```text kube-scheduler.kubeconfig ``` @@ -191,7 +124,7 @@ for host in node-0 node-1; do ssh root@${host} "mkdir -p /var/lib/{kube-proxy,kubelet}" scp kube-proxy.kubeconfig \ - root@${host}:/var/lib/kube-proxy/kubeconfig \ + root@${host}:/var/lib/kube-proxy/kubeconfig scp ${host}.kubeconfig \ root@${host}:/var/lib/kubelet/kubeconfig diff --git a/docs/11-pod-network-routes.md b/docs/11-pod-network-routes.md index 7e7cfd4..ccc1fb5 100644 --- a/docs/11-pod-network-routes.md +++ b/docs/11-pod-network-routes.md @@ -23,22 +23,16 @@ Print the internal IP address and Pod CIDR range for each worker instance: ``` ```bash -ssh root@server < 80 Forwarding from [::1]:8080 -> 80 ``` -In a new terminal make an HTTP request using the forwarding address: +In a new terminal/window, make an HTTP request using the forwarding address: ```bash curl --head http://127.0.0.1:8080