Microk8s on LXD
Jump to navigation
Jump to search
Kubernetes Cluster in less than 15 minutes on Ubuntu
- https://linuxcontainers.org/lxd/getting-started-cli/
- https://medium.com/@ridwanfajar/getting-started-with-microk8s-up-and-running-kubernetes-locally-310640dae156
- https://microk8s.io/docs/lxd
Begin with a simple Ubuntu 20.04 host with LXD installed: snap install lxd - https://linuxcontainers.org/lxd/getting-started-cli/
lxc profile create microk8s wget https://raw.githubusercontent.com/ubuntu/microk8s/master/tests/lxc/microk8s-zfs.profile -O microk8s.profile cat microk8s.profile | lxc profile edit microk8s lxc launch -p default -p microk8s ubuntu:20.04 h1 lxc launch -p default -p microk8s ubuntu:20.04 h2 lxc launch -p default -p microk8s ubuntu:20.04 h3
h1
lxc exec h1 /bin/bash snap install microk8s --classic --channel=1.19/stable microk8s status microk8s add-node
h2
snap install microk8s --classic --channel=1.19/stable microk8s join 10.28.99.198:25000/<output from existing node microk8s add-node>
h3
snap install microk8s --classic --channel=1.19/stable microk8s join 10.28.99.198:25000/<output from existing node microk8s add-node>
Enable dash on h1
microk8s enable dashboard token=$(microk8s kubectl -n kube-system get secret | grep default-token | cut -d " " -f1) microk8s kubectl -n kube-system describe secret $token microk8s kubectl port-forward -n kube-system service/kubernetes-dashboard 11443:443
lxc config device add h1 tcp33443 proxy listen=tcp:0.0.0.0:33443 connect=tcp:127.0.0.1:11443
browse to https://mylxdhostfromcmdabove:33443/
Namespace Getters in kubernetes
- https://kubernetes.io/docs/reference/kubectl/cheatsheet/#viewing-finding-resources
- https://microk8s.io/docs
# alias kubectl='microk8s kubectl' microk8s kubectl get all microk8s kubectl get nodes microk8s kubectl get services microk8s kubectl get pods
Other
LXD issues with app armour
Run on all k8s nodes
aa-status apparmor_parser --add /var/lib/snapd/apparmor/profiles/snap.microk8s.*
micro-k8s status micro-k8s add-node
Refs
- https://microk8s.io/high-availability
- https://microk8s.io/docs/clustering
- https://microk8s.io/docs/addon-dashboard
- https://blog.getambassador.io/explore-the-ambassador-api-gateway-with-microk8s-f75a7a295113#:~:text=With%20MicroK8s%20v1.,a%20great%20fit%20for%20MicroK8s.&text=Ambassador%20is%20now%20ready%20for,Controller%20in%20your%20local%20cluster.
- https://www.getambassador.io/docs/latest/topics/running/running/
- https://kubernetes.io/docs/tutorials/stateless-application/expose-external-ip-address/