diff --git a/apple-silicon/deploy-virtual-machines.sh b/apple-silicon/deploy-virtual-machines.sh index c2b557c..93c7406 100755 --- a/apple-silicon/deploy-virtual-machines.sh +++ b/apple-silicon/deploy-virtual-machines.sh @@ -17,11 +17,8 @@ echo -e "${BLUE}Checking system compatibility${NC}" MEM_GB=$(( $(sysctl hw.memsize | cut -d ' ' -f 2) / 1073741824 )) SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )/scripts -if [ $MEM_GB -lt 12 ] -then - echo -e "${RED}System RAM is ${MEM_GB}GB. This is insufficient to deploy a working cluster.${NC}" - exit 1 -fi +CPMEM="2048M" +WNMEM="2048M" if ! command -v multipass > /dev/null then @@ -35,13 +32,21 @@ then exit 1 fi +if [ $MEM_GB -lt 15 ] +then + CPMEM="768M" + WNMEM="512M" + echo -e "${YELLOW}System RAM is ${MEM_GB}GB. VM size is reduced." + echo -e "It will not be possible for you to run E2E tests (final step).${NC}" +fi + specs=/tmp/vm-specs cat < $specs -controlplane01,2,2048M,10G -controlplane02,2,2048M,5G +controlplane01,2,${CPMEM},10G +controlplane02,2,${CPMEM},5G loadbalancer,1,512M,5G -node01,2,2048M,5G -node02,2,2048M,5G +node01,2,${WNMEM},5G +node02,2,${WNMEM},5G EOF echo -e "${GREEN}System OK!${NC}" @@ -74,7 +79,7 @@ do multipass purge fi - echo -e "${BLUE}Launching ${node}${NC}" + echo -e "${BLUE}Launching ${node}. CPU: ${cpus}, MEM: ${ram}${NC}" multipass launch --disk $disk --memory $ram --cpus $cpus --name $node jammy echo -e "${GREEN}$node booted!${NC}" done diff --git a/apple-silicon/docs/01-prerequisites.md b/apple-silicon/docs/01-prerequisites.md index beff949..a6e43bc 100644 --- a/apple-silicon/docs/01-prerequisites.md +++ b/apple-silicon/docs/01-prerequisites.md @@ -5,7 +5,7 @@ This lab provisions 5 VMs on your workstation. That's a lot of compute resource! * Apple Silicon System (M1/M2/M3 etc) -* Minimum 16GB RAM.
Bear in mind that the unified memory architecture of Apple Silicon Macs means that the whole of the quoted memory is not available for software - some of it is used for the display, more if you have external displays.
This rules out 8GB models - sorry. +* 8GB RAM (16GB recommended).
Bear in mind that the unified memory architecture of Apple Silicon Macs means that the whole of the quoted memory is not available for software - some of it is used for the display, more if you have external displays. With less than 16GB, significantly smaller VMs will be deployed, which will not be sufficient to run the final step E2E tests. * Pro or Max CPU recommended for running the e2e-tests at the end of this lab. ## Required Software diff --git a/docs/11-tls-bootstrapping-kubernetes-workers.md b/docs/11-tls-bootstrapping-kubernetes-workers.md index 390abf8..94149d2 100644 --- a/docs/11-tls-bootstrapping-kubernetes-workers.md +++ b/docs/11-tls-bootstrapping-kubernetes-workers.md @@ -49,7 +49,7 @@ Run the following steps on `controlplane01` For the workers(kubelet) to access the Certificates API, they need to authenticate to the kubernetes api-server first. For this we create a [Bootstrap Token](https://kubernetes.io/docs/reference/access-authn-authz/bootstrap-tokens/) to be used by the kubelet -Bootstrap Tokens take the form of a 6 character token id followed by 16 character token secret separated by a dot. Eg: abcdef.0123456789abcdef. More formally, they must match the regular expression [a-z0-9]{6}\.[a-z0-9]{16} +Bootstrap Tokens take the form of a 6 character token id followed by 16 character token secret separated by a dot. Eg: abcdef.0123456789abcdef. More formally, they must match the regular expression `[a-z0-9]{6}\.[a-z0-9]{16}` Set an expiration date for the bootstrap token of 7 days from now (you can adjust this) @@ -460,7 +460,9 @@ At `node02` node, run the following, selecting option 5 Now, go back to `controlplane01` and approve the pending kubelet-serving certificate [//]: # (host:controlplane01) + [//]: # (command:sudo apt install -y jq) + [//]: # (command:kubectl certificate approve --kubeconfig admin.kubeconfig $(kubectl get csr --kubeconfig admin.kubeconfig -o json | jq -r '.items | .[] | select(.spec.username == "system:node:node02") | .metadata.name')) ```bash diff --git a/docs/15-dns-addon.md b/docs/15-dns-addon.md index 1701d4f..24dffc8 100644 --- a/docs/15-dns-addon.md +++ b/docs/15-dns-addon.md @@ -48,7 +48,7 @@ Reference: https://kubernetes.io/docs/tasks/administer-cluster/coredns/#installi Create a `busybox` pod: ```bash -kubectl run busybox -n default --image=busybox:1.28 --restart Never --command -- sleep 15 +kubectl run busybox -n default --image=busybox:1.28 --restart Never --command -- sleep 180 ``` [//]: # (command:kubectl wait pods -n default -l run=busybox --for condition=Ready --timeout=90s) diff --git a/docs/17-e2e-tests.md b/docs/17-e2e-tests.md index fd95ddb..a2ac3a3 100644 --- a/docs/17-e2e-tests.md +++ b/docs/17-e2e-tests.md @@ -1,6 +1,6 @@ # Run End-to-End Tests -Optional Lab. +Optional Lab. If you are running this on a system with less than 16GB RAM, this step will almost certainly fail spectacularly. Observations by Alistair (KodeKloud):