Skip to content

Instantly share code, notes, and snippets.

@derberg
Last active June 19, 2023 18:22
Show Gist options
  • Save derberg/5e2ae3badcca9ee2e302f86bd50a3f3c to your computer and use it in GitHub Desktop.
Save derberg/5e2ae3badcca9ee2e302f86bd50a3f3c to your computer and use it in GitHub Desktop.
Kyma on K3s on Multipass

Disclaimer: This is just for fun, to play with Kyma on something different then K8s cluster, Minikube or KIND. Do not use on production and at home.

Get Multipass VM on Mac

#Install Multipass
brew cask install multipass

#Get VM with Ubuntu that is large enough
multipass launch --name k3s --mem 8G --disk 20G

#Access the VM
multipass shell k3s

#Go into admin mode to not use sudo all the time
sudo su -

Read more on Multipass and running K3s on it:

Get K3s running

#Start lightweight k8s cluster
curl -sfL https://get.k3s.io | sh -

#Validate if starup is done, it make take up to 30sec
kubectl get po -A -w

Read more on K3s:

Get kubeconfig to use K3s cluster from local - optional

#Create kubeconfig file local system and past there kubeconfig details
#Get details from the VM with below
cat /etc/rancher/k3s/k3s.yaml

#Replace server IP 127.0.0.1 with IP that you get by runnig below, for example 192.168.64.40
#Get the IP of the VM from local system
$multipass list
Name                    State             IPv4             Image
k3s                     Running           192.168.64.40    Ubuntu 18.04 LTS
#Example kubeconfig file
apiVersion: v1
clusters:
- cluster:
    certificate-authority-data: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUJWakNCL3FBREFnRUNBZ0VBTUFvR0NDcUdTTTQ5QkFNQ01DTXhJVEFmQmdOVkJBTU1HR3N6Y3kxelpYSjIKWlhJdFkyRkFNVFUzTVRjM09EQTVPVEFlRncweE9URXdNakl5TVRBeE16bGFGdzB5T1RFd01Ua3lNVEF4TXpsYQpNQ014SVRBZkJnTlZCQU1NR0dzemN5MXpaWEoyWlhJdFkyRkFNVFUzTVRjM09EQTVPVEJaTUJNR0J5cUdTTTQ5CkFnRUdDQ3FHU000OUF3RUhBMElBQkJkNUVCaHVYaGM0WFlQQ05HdjkrOTNWNHd3UFRTdVRITXhjZE9qTFpSV3IKZEdqd3hKQUJBRTJ4V0E1aUtiVkJ6VkhldkYzZFBYaHFiMEExb3I2dEVlV2pJekFoTUE0R0ExVWREd0VCL3dRRQpBd0lDcERBUEJnTlZIUk1CQWY4RUJUQURBUUgvTUFvR0NDcUdTTTQ5QkFNQ0EwY0FNRVFDSUVQSGMzdFNpU0E3CmlOaUo1MlF4akV3TnpXL01ndG5CQWwwR0IxaFFwTDlPQWlBcno0ZE5YbHN6clpxRjBlWjBZZlJONUJXSzhsWjkKSFhTZk4wV0h3ZFBWTkE9PQotLS0tLUVORCBDRVJUSUZJQ0FURS0tLS0tCg==
    server: https://192.168.64.40:6443
  name: default
contexts:
- context:
    cluster: default
    user: default
  name: default
current-context: default
kind: Config
preferences: {}
users:
- name: default
  user:
    password: de88d1ca405dcfa2e53a1625f92d3862
    username: admin
#Use new kubeconfig for kubectl
export KUBECONFIG=$(pwd)/kubeconfig

#Get Pods and see it works like a charm
kubectl get pods -A

Install Kyma 1.6 Lite - WIP (hanging on istio so far)

# Setup version variable
export KYMA_VERSION=1.6.0

#Get Tiller
kubectl apply -f https://raw.githubusercontent.com/kyma-project/kyma/$KYMA_VERSION/installation/resources/tiller.yaml

#Trigger installation
kubectl apply -f https://github.com/kyma-project/kyma/releases/download/$KYMA_VERSION/kyma-installer-local.yaml

#Installation is in progress and you can see if new pods are showing up in the system or no errors show up in installation
while true; do \
  kubectl -n default get installation/kyma-installation -o jsonpath="{'Status: '}{.status.state}{', description: '}{.status.description}"; echo; \
  sleep 5; \
done

Read more on Kyma:

I don't want to play with it anymore

#Remove VM with K3s and Kyma
multipass delete k3s --purge
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment