Skip to content

Instantly share code, notes, and snippets.

@gbevan
Created April 23, 2024 09:20
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 gbevan/b1b7420c12e439fda942f53f6efd365e to your computer and use it in GitHub Desktop.
Save gbevan/b1b7420c12e439fda942f53f6efd365e to your computer and use it in GitHub Desktop.

Microk8s DEV on Ubuntu LXD Container(s)

Ref: https://microk8s.io/docs/install-lxd

Microk8s LXD profile

$ lxc profile create microk8s
$ wget https://raw.githubusercontent.com/ubuntu/microk8s/master/tests/lxc/microk8s.profile -O microk8s.profile
$ cat microk8s.profile | lxc profile edit microk8s

Start container machine host

$ lxc launch -p default -p microk8s ubuntu:jammy microk8sdev

$ lxc exec microk8sdev bash
root@microk8sdev:~# 

Ensure host has iptables forward accept rule

e.g.

# iptables -P FORWARD ACCEPT

Install Microk8s

root@microk8sdev:~# snap install microk8s --classic --channel=1.22
...

root@microk8sdev:~# snap alias microk8s.kubectl kubectl
Added:
  - microk8s.kubectl as kubectl

root@microk8sdev:~# kubectl get pods -A
NAMESPACE     NAME                                       READY   STATUS    RESTARTS   AGE
kube-system   calico-kube-controllers-6d7c7f545b-2dnhb   1/1     Running   0          38s
kube-system   calico-node-cj94w                          1/1     Running   0          39s

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment