Last active
June 21, 2025 10:22
-
-
Save AlexZ005/649ce95ee5d0bcc066a35d2373fdae3a to your computer and use it in GitHub Desktop.
Revisions
-
AlexZ005 renamed this gist
Jun 21, 2025 . 1 changed file with 13 additions and 10 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,8 +2,8 @@ Setting up a VirtualBox Machine and Preparing a Kubernetes Cluster Step 1: Download OVA Image Download the Ubuntu 25.04 Server Cloud image from: https://cloud-images.ubuntu.com/releases/plucky/release/ubuntu-25.04-server-cloudimg-amd64.ova Step 2: Import to VirtualBox * File > Import Appliance @@ -31,11 +31,10 @@ sudo apt install curl -y sudo apt-get install -y docker.io sudo apt-get install -y apt-transport-https ca-certificates curl gpg # Setting 1.33 version sudo mkdir -p -m 755 /etc/apt/keyrings curl -fsSL https://prod-cdn.packages.k8s.io/repositories/isv:/kubernetes:/core:/stable:/v1.33/deb/Release.key | sudo gpg --dearmor -o /etc/apt/keyrings/kubernetes-apt-keyring.gpg echo 'deb [signed-by=/etc/apt/keyrings/kubernetes-apt-keyring.gpg] https://pkgs.k8s.io/core:/stable:/v1.33/deb/ /' | sudo tee /etc/apt/sources.list.d/kubernetes.list sudo apt-get update sudo apt-get install -y kubeadm kubelet kubectl @@ -53,9 +52,13 @@ EOF Step 6: Execute master.sh Run ./master.sh to create the Kubernetes cluster. Step 7: Install Network CNI , for example Calico kubectl apply -f https://docs.projectcalico.org/manifests/calico.yaml kubectl get nodes #the node should become ready #Notes: # The version will be picked automatically from the repo (as of writing: v1.33.2) # Alternatively specific version could be set as following if present in repository: # sudo apt-get install -y kubeadm=1.33.2-1.1 kubelet=1.33.2-1.1 kubectl=1.33.2-1.1 # sudo kubeadm init --kubernetes-version 1.33.2 --pod-network-cidr 192.168.0.0/16 # kubectl taint nodes --all node-role.kubernetes.io/control-plane- -
AlexZ005 created this gist
Aug 9, 2024 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,61 @@ Setting up a VirtualBox Machine and Preparing a Kubernetes Cluster Step 1: Download OVA Image Download the Ubuntu 20.04 Server Cloud image from: https://cloud-images.ubuntu.com/releases/focal/release/ubuntu-20.04-server-cloudimg-amd64.ova Step 2: Import to VirtualBox * File > Import Appliance * Set: CPU: 4 RAM: 4096 GB * Increase disk space Step 3: Configure Networking and SSH Enter GRUB holding Shift, select advanced/recovery mode Change root password or add public key using the following command (use KeePass for Auto-Type): apt-get remove cloud-init -y && cd /etc/netplan && echo -e "network:\n version: 2\n renderer: networkd\n ethernets:\n enp0s3:\n dhcp4: true" > 01-netcfg.yaml && ssh-keygen -A && mkdir ~/.ssh && echo "<ssh-key>" > ~/.ssh/authorized_keys && echo "IP Address: \4" >> /etc/issue && reboot Step 4: Adjust Disk Size Run fdisk /dev/sda and type the following commands, hitting Enter after each comma: d,1,n,1,p,enter,enter,N,w resize2fs /dev/sda1 Step 5: Create master.sh Script Run the following command to create master.sh: cat << EOF > master.sh swapoff -a sudo apt-get update && sudo apt-get upgrade -y sudo apt install curl -y sudo apt-get install -y docker.io sudo apt-get install -y apt-transport-https ca-certificates curl gpg # Setting 1.27 version, update as after March 2024 Kubernetes package repositories (apt.kubernetes.io) were officially removed # https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/install-kubeadm/ sudo mkdir -p -m 755 /etc/apt/keyrings curl -fsSL https://pkgs.k8s.io/core:/stable:/v1.27/deb/Release.key | sudo gpg --dearmor -o /etc/apt/keyrings/kubernetes-apt-keyring.gpg echo 'deb [signed-by=/etc/apt/keyrings/kubernetes-apt-keyring.gpg] https://pkgs.k8s.io/core:/stable:/v1.27/deb/ /' | sudo tee /etc/apt/sources.list.d/kubernetes.list sudo apt-get update sudo apt-get install -y kubeadm kubelet kubectl sudo apt-mark hold kubelet kubeadm kubectl sudo kubeadm init --pod-network-cidr 192.168.0.0/16 mkdir -p $HOME/.kube sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config sudo chown $(id -u):$(id -g) $HOME/.kube/config # or under root # export KUBECONFIG=/etc/kubernetes/admin.conf # kubeadm token create --print-join-command EOF Step 6: Execute master.sh Run ./master.sh to create the Kubernetes cluster. #Notes: # The version will be picked automatically from the repo (as of writing: v1.27.16) # Alternatively specific version could be set as following if present in repository: # sudo apt-get install -y kubeadm=1.27.6-00 kubelet=1.27.6-00 kubectl=1.27.6-00 # kuber adm init will say remote version is much newer: v1.30.3; falling back to: stable-1.27 # Alternatively: sudo kubeadm init --kubernetes-version 1.27.6 --pod-network-cidr 192.168.0.0/16