Created
July 13, 2023 20:56
-
-
Save andrewpsp/1f5a10db9c108c35e88f00969d4c5eb0 to your computer and use it in GitHub Desktop.
Kubernetes 1.27 VagrantFile
This file contains 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 characters
# -*- 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