Install k3s and get the kubeconfig

sudo apt update adduser eramax usermod -aG sudo eramax curl -sfL | K3S_KUBECONFIG_MODE=”644″ sh – kubectl get nodes cat /var/lib/rancher/k3s/server/node-token #Copy node token sudo kubectl create serviceaccount k8sadmin -n kube-system sudo kubectl create clusterrolebinding k8sadmin –clusterrole=cluster-admin –serviceaccount=kube-system:k8sadmin sudo kubectl -n kube-system describe secret $(sudo kubectl -n kube-system get secret | (grep k8sadmin || echo “$_”) | awk […]

Running CI tests in Kubernetes through Github Actions

Example  name: Main action on: [push] jobs: build: runs-on: ubuntu-latest timeout-minutes: 5 steps: – uses: actions/[email protected] – name: install k8s run: | curl -sfL | K3S_KUBECONFIG_MODE=777 sh – cat /etc/rancher/k3s/k3s.yaml mkdir -p ~/.kube cp /etc/rancher/k3s/k3s.yaml ~/.kube/config – name: example tests run: | kubectl cluster-info kubectl create deployment –image nginx my-nginx kubectl get po Source :

Deploy kubernetes cluster with multipass

multipass launch –name kms –cpus 1 –mem 1024M –disk 3G 16.04 multipass launch –name n1 –cpus 1 –mem 1024M –disk 3G 16.04 multipass launch –name n2 –cpus 1 –mem 1024M –disk 3G 16.04 multipass exec kms — /bin/bash -c “curl -sfL | K3S_KUBECONFIG_MODE=”644″ sh -” multipass shell kms sudo cat /var/lib/rancher/k3s/server/node-token # copy the token and ip […]

Ubuntu Core 18 running in VirtualBox

Download the Ubuntu Core 18 Stable image from here: 242 I then unxz the image: unxz ubuntu-core-18-amd.img.xz I then use VBoxManage to convert the raw disk image to VDI: VBoxManage convertdd ubuntu-core-18-amd64.img core18.vdi I then created a new Virtual Machine, said it was Linux and Ubuntu 64-bit, and pointed the storage to the vdi image I created in the previous step. Before you […]

1 2 3 5