DEV Community

RodrigoMuneralha25
RodrigoMuneralha25

Posted on

How to install K8s locally in VirtualBox (self Lab for Beginner)

If you do not currently have an environment to test your workloads, run tests kubectl cmds, or build a beginner self-learning lab, my suggestion is to create your own lab environment using VirtualBox.

Pre-requisite

  1. Available resource computer in you locally machine (CPU, RAM, Storage)
  2. Familiarity with Linux environments (1 year of experience).
  3. Seeking and desire to learn about Kubernetes and different deployment models.

Steps:

  1. Download Oracle VirtualBox
  2. Download A ISO Oracle Linux 9.x (FREE)
  3. Create VM on VirtualBox
  4. Install Oracle Linux 9.x (Minimal)
  5. Install and prepare Kubernetes locally (single) dependencies and packages

Procedure

  1. Download Oracle VirtualBox
  • go to the URL https://virtualbox.org/wiki/Downloads
  • choose you type locally computer (the tuttorial is Windows Desktop)
  • install on local compute and apropriate drive (Next> Next> Finished)
  1. Download the ISO OL 9 Free

  1. Create VM on VirtualBox
    • click botton New Virtual Machine
    • follow the screen suggestion to create VM

--suggestion settings VMs
in System Settings Enter

-4 GB RAM
-2 Processor
-20 GB Storage
-MotherBoard >> Pointing Device change to USB Tablet
-in Network option (select Bridget) my preference

show the console Virtual Machine and select [I]

-Install Oracle Linux 9.7

-Select Language [English / English]

3 actions pending to complete default installition

  • Install Destination
  • root Password
  • User Creation

in install Destionation, select disk availalble

in root password, enter you password and enable "Allow root SSH with password" -"for lab not risk _ for Study"

in Software Selection, select option Minimal Install and Select Envrironment

after complete all pending / warning press botton "Begin Installation"

waiting all processing finished

after complete, check console VirtualBox Virtual Machine

now is possible to login locally in your network computer and establish ssh connection to new virtual machine

5. Install and prepare Kubernetes locally (single) dependencies and packages

running command to update all dependencies and packages

sudo dnf - y update
Enter fullscreen mode Exit fullscreen mode

make one Reboot ....

desative o swap

`sudo swapoff -a`
`sudo vi /etc/fstab``
Enter fullscreen mode Exit fullscreen mode

comente a linha swap
``

/dev/mapper/ol-swap

Configurar mรณdulos kernel

`shell
cat <<EOF | sudo tee /etc/sysctl.d/k8s.conf
net.bridge.bridge-nf-call-iptables = 1
net.bridge.bridge-nf-call-ip6tables = 1
net.ipv4.ip_forward = 1
`

cat <<EOF | sudo tee /etc/modules-load.d/k8s.conf
overlay
br_netfilter
EOF

`

Top comments (0)