Skip to content

Instantly share code, notes, and snippets.

@andrewpsp
Created July 13, 2023 20:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andrewpsp/1f5a10db9c108c35e88f00969d4c5eb0 to your computer and use it in GitHub Desktop.
Save andrewpsp/1f5a10db9c108c35e88f00969d4c5eb0 to your computer and use it in GitHub Desktop.
Kubernetes 1.27 VagrantFile
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/jammy64"
config.vm.network "forwarded_port", guest: 80, host: 8080
config.vm.provision "shell", inline: <<-SHELL
# Update the Snap package manager
sudo snap refresh
# Install Cluster
if snap list | grep microk8s; then
echo "Updating Current Version..."
sudo snap refresh microk8s
else
echo "Installing latest version."
sudo snap install microk8s --classic
fi
# Set kubectl
if [ -z "$(which kubectl)" ]; then
echo "Creating an alias for kubectl..."
sudo snap alias microk8s.kubectl kubectl
fi
# Enable Features 1.27
echo "Enabling ingress and Kubernetes dashboard..."
microk8s enable ingress
microk8s enable dashboard
echo "Kubernetes with Kubectl, Ingress and Dashboard is Live"
SHELL
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment