Installing a simple application (like Superset) in microk8s using metallb and helm

The main ideas of the post:







  • Installing Kubernetes applications is not difficult.
  • You can use lightweight Kubernetes on your computer to quickly deploy applications.
  • It is possible to use ingress (nginx) locally using metallb
  • All actions and commands are similar to real commands that you will do in the cloud.


MicroK8s is a CNCF-certified local Kubernetes cluster deployment and is designed to quickly and easily set up a Kubernetes stream, isolated from your local environment. As a snap-in, it starts all Kubernetes services (i.e. no virtual machines), while packaging all the required set of libraries and files. This isolation is achieved by packaging all binaries for Kubernetes, Docker.io, iptables, and CNI into a single Snap package.







Benefits of microk8s:







  • uses only the resources it needs
  • clustering multiple microk8s
  • easy and simple installation in Ubuntu via snap, vaunted snap package isolation, easy rollback option
  • availability of addons


Snaps are cross-distribution, independent and easy to install applications, packaged with all their dependencies to run on all major Linux distributions. Snaps are safe - they are limited and do not compromise the entire system. They operate under different levels of content (that is, the degree of isolation from the underlying system and from each other).







Apache Superset is a web based data search and visualization application.







Helm is a package manager for Kubernetes that makes it easy for developers and operators to package, configure, and deploy applications and services to Kubernetes clusters.







MetalLB โ€” Kubernetes ยซ ยป . IP, .







: Ubuntu 18.04







Snapd, git







sudo apt-get update && sudo apt-get install -y snapd git
      
      





microk8s 1.18







sudo snap install microk8s --classic --channel=1.18/stable && sudo snap install helm --classic
      
      





microk8s







sudo microk8s.start
      
      





microk8s







sudo usermod -a -G microk8s $USER
      
      





.kube







sudo chown -f -R $USER ~/.kube
      
      











exit
      
      





kubectl microk8s.kubectl







alias kubectl=microk8s.kubectl
      
      





microk8s. metallb IP . 1 , IP . microk8s , IP . microk8s. IP โ€” 192.168.22.7. .







microk8s enable dns ingress storage metallb:192.168.22.7-192.168.22.7 
      
      





Running







kubectl get all --all-namespaces
      
      





superset







git clone https://github.com/apache/superset.git
      
      





helm superset







cd superset/helm/superset
      
      





helm







helm dependency update
      
      





Kubernetes







sudo microk8s.kubectl config view --raw > $HOME/.kube/config
      
      





superset helm







helm install --set persistence.enabled=true,service.type=LoadBalancer,ingress.enabled=true,ingress.hosts[0]=superset.192.168.22.7.xip.io  superset ./
      
      





superset.192.168.22.7.xip.io โ€” .













admin/admin. Superset . .













If you need to delete the entire Kubernetes cluster in microk8s, you can use the reset command







microk8s reset --destroy-storage

      
      






All Articles