# [k8s hard way] 01-prerequisites 실습

01-prerequisites (opens new window)

실행환경 - M3 Pro mac + vmware fusion

패키지 설치

brew tap hashicorp/tap
brew install hashicorp/tap/hashicorp-vagrant

vagrant plugin install vagrant-vmware-desktop

Vagrantfile

Vagrant.configure("2") do |config|
  config.vm.box = "bento/debian-12"
  config.vm.box_check_update = false

  nodes = {
    "jumpbox" => { memory: 512, cpus: 1 },
    "server"  => { memory: 2048, cpus: 1 },
    "node-0"  => { memory: 2048, cpus: 1 },
    "node-1"  => { memory: 2048, cpus: 1 }
  }

  nodes.each do |name, opts|
    config.vm.define name do |vm|
      vm.vm.hostname = name
      vm.vm.network "public_network", bridge: "en0: Wi-Fi (Wireless)"

      vm.vm.provider :vmware_fusion do |fusion|
        fusion.memory = opts[:memory]
        fusion.cpus = opts[:cpus]
      end

      vm.vm.provision "shell", inline: <<-SHELL
        echo "nameserver 8.8.8.8" > /etc/resolv.conf
        apt update -y
        apt install -y curl
      SHELL
    end
  end
end

# 실행
vagrant up
# 접속
vagrant ssh jumpbox
vagrant ssh server
vagrant ssh node-0
vagrant ssh node-1