mirror of
https://github.com/kelseyhightower/kubernetes-the-hard-way.git
synced 2025-12-15 17:28:58 +03:00
Support 8GB Macs
This commit is contained in:
@@ -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 <<EOF > $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
|
||||
|
||||
@@ -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.<br/>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.<br/>This rules out 8GB models - sorry.
|
||||
* 8GB RAM (16GB recommended).<br/>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
|
||||
|
||||
Reference in New Issue
Block a user