Difference between revisions of "Multipass"

From UVOO Tech Wiki
Jump to navigation Jump to search
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
# Using Hyper-V & Multipass to get Quick MicroK8s
 
# Using Hyper-V & Multipass to get Quick MicroK8s
 +
 +
 +
## MicroK8s using multipass on Windows using Virtualbox driver cuz hyperv gives fits on vpn
 +
- https://multipass.run/docs/set-up-the-driver#heading--use-virtualbox-to-view-multipass-instances-windows
  
 
```
 
```
 +
winget install Oracle.VirtualBox
 +
# set PATH=%PATH%;"C:\Program Files\Oracle\VirtualBox"
 +
 
winget install -e --id Canonical.Multipass
 
winget install -e --id Canonical.Multipass
multipass launch --cpus 2 --disk 20G --memory 2G
+
multipass set local.driver=virtualbox
 +
multipass find
 +
multipass launch --cpus 2 --disk 13G --memory 2G --name jammy 22.04
  
 
multipass shell jammy
 
multipass shell jammy
Line 13: Line 22:
 
kubectl get node -o wide
 
kubectl get node -o wide
 
```
 
```
 +
 +
Increasing resources
 +
```
 +
multipass set local.jammy.disk=20G
 +
multipass set local.jammy.cpus=2
 +
multipass set local.jammy.memory=2G
 +
```
 +
 +
## Helm - run as admin
 +
```
 +
choco list
 +
choco source enable -n chocolatey
 +
choco install kubernetes-helm
 +
helm
 +
```
 +
 +
# HAProxyIngress - https://github.com/haproxytech/helm-charts
 +
```
 +
helm repo add haproxytech https://haproxytech.github.io/helm-charts
 +
helm repo update
 +
helm search repo haproxytech/
 +
helm install main haproxytech/kubernetes-ingress
 +
```
 +
 +
##
  
 
# Install Multipass on windows and run ubuntu vm in hyperv
 
# Install Multipass on windows and run ubuntu vm in hyperv
Line 33: Line 67:
 
# server: https://127.0.0.1:16443
 
# server: https://127.0.0.1:16443
 
sudo microk8s.kubectl get node
 
sudo microk8s.kubectl get node
kubectl get node
+
kubectl get node -o wide
 
```
 
```
  
Line 57: Line 91:
 
     sudo usermod -a -G microk8s ubuntu
 
     sudo usermod -a -G microk8s ubuntu
 
     sudo chown -R ubuntu ~/.kube
 
     sudo chown -R ubuntu ~/.kube
 +
```
 +
 +
# Virtualbox Manual Cleanup
 +
```
 +
C:\Windows\System32\config\systemprofile\.VirtualBox\VirtualBox.xml
 +
C:\Windows\System32\config\systemprofile\VirtualBox VMs\Multipass\
 +
rm foo
 
```
 
```

Latest revision as of 22:06, 5 May 2023

Using Hyper-V & Multipass to get Quick MicroK8s

MicroK8s using multipass on Windows using Virtualbox driver cuz hyperv gives fits on vpn

winget install Oracle.VirtualBox
# set PATH=%PATH%;"C:\Program Files\Oracle\VirtualBox"

winget install -e --id Canonical.Multipass
multipass set local.driver=virtualbox
multipass find
multipass launch --cpus 2 --disk 13G --memory 2G --name jammy 22.04

multipass shell jammy
sudo snap install microk8s --classic
multipass list

mv ~/.kube.conf ~/.kube.conf.bkp
multipass exec jammy -- sudo microk8s config > ~/.kube.conf
kubectl get node -o wide

Increasing resources

multipass set local.jammy.disk=20G
multipass set local.jammy.cpus=2
multipass set local.jammy.memory=2G

Helm - run as admin

choco list
choco source enable -n chocolatey
choco install kubernetes-helm
helm

HAProxyIngress - https://github.com/haproxytech/helm-charts

helm repo add haproxytech https://haproxytech.github.io/helm-charts
helm repo update
helm search repo haproxytech/
helm install main haproxytech/kubernetes-ingress

#

Install Multipass on windows and run ubuntu vm in hyperv

winget install -e --id Canonical.Multipass
multipass find
multipass launch 22.04 --name jammy
multipass list
multipass shell jammy
multipass stop jammy

Microk8s in vm

multipass shell jammy
sudo snap install microk8s --classic
sudo snap install kubectl --classic
mkdir ~/.kube
sudo microk8s config > ~/.kube/config
# server: https://127.0.0.1:16443
sudo microk8s.kubectl get node
kubectl get node -o wide

Change size

multipass set [local.<instance-name>.(cpus|disk|memory)](https://multipass.run/t/)]=[value]

https://multipass.run/docs/modify-an-instance

$ multipass stop handsome-ling
$ multipass set local.handsome-ling.cpus=4
$ multipass set local.handsome-ling.disk=60G
$ multipass set local.handsome-ling.memory=7G

multipass stop jammy
multipass set local.jammy.memory=2G
multipass start jammy
multipass shell jammy

More notes

    sudo usermod -a -G microk8s ubuntu
    sudo chown -R ubuntu ~/.kube

Virtualbox Manual Cleanup

C:\Windows\System32\config\systemprofile\.VirtualBox\VirtualBox.xml
C:\Windows\System32\config\systemprofile\VirtualBox VMs\Multipass\
rm foo