Vagrant Box Packaging for Kubernetes.
This Vagrant Box provides Libvirt and VirtualBox image for running a Certified Kubernetes environment in single node all-in-one mode.
- Packaging with Packer
- Minimal Vagrant base box implementation
- Support QEMU Guest Agent
- Support VirtualBox Guest Additions
- Support Vagrant synced folder with rsync
- Support Vagrant provisioner with Ansible
- Standardize disk partition with GPT
- Standardize file system mount with UUID
- Standardize network interface with
eth0
Once you have Vagrant and VirtaulBox installed, run the following commands under your project directory:
# Initialize Vagrant
cat > Vagrantfile <<-EOF
Vagrant.configure('2') do |config|
config.vm.hostname = 'kubernetes-1.31'
config.vm.box = 'alvistack/kubernetes-1.31'
config.vm.provider :libvirt do |libvirt|
libvirt.cpu_mode = 'host-passthrough'
libvirt.cpus = 2
libvirt.disk_bus = 'virtio'
libvirt.disk_driver :cache => 'writeback'
libvirt.driver = 'kvm'
libvirt.memory = 8192
libvirt.memorybacking :access, :mode => 'shared'
libvirt.nested = true
libvirt.nic_model_type = 'virtio'
libvirt.storage :file, bus: 'virtio', cache: 'writeback'
libvirt.video_type = 'virtio'
end
config.vm.provider :virtualbox do |virtualbox|
config.vm.disk :disk, name: 'sdb', size: '10GB'
virtualbox.cpus = 2
virtualbox.customize ['modifyvm', :id, '--cpu-profile', 'host']
virtualbox.customize ['modifyvm', :id, '--nested-hw-virt', 'on']
virtualbox.memory = 8192
end
end
EOF
# Start the virtual machine
export VAGRANT_EXPERIMENTAL='1'
vagrant up
# SSH into this machine
vagrant ssh
# Terminate the virtual machine
vagrant destroy --force
You could also run our Molecule test cases if you have Vagrant and Libvirt installed, e.g.
# Run Molecule on Kubernetes 1.31
molecule converge -s kubernetes-1.31-libvirt
Please refer to .gitlab-ci.yml for more information on running Molecule.
Release tags could be find from GitHub Release of this repository. Thus using these tags will ensure you are running the most up to date stable version of this image.
Version tags ended with .0.0
are rolling release rebuild by GitLab
pipeline
in weekly basis. Thus using these tags will ensure you are running the
latest packages provided by the base image project.
- Code released under Apache License 2.0
- Docs released under CC BY 4.0
- Wong Hoi Sing Edison