Install and use ingress in Microk8s integrator

Tram Ho

In this post, I need to add 1 VM to install Nginx to load balancer here I will create 1 more VM ubuntu 22.04

IPHostnamevCPURAMDISK cores8G100G cores12G100G cores12G100G cores12G100G

We install according to the model image.png

Install Nginx on Ubuntu 22.04

Connect to VM nginx (

Step 1 – Install Nginx

Update apt-install packages

Install Nginx

Step 2 – Grant HTTP Firewall Permissions

Step 3 – Check Your Web Host

Check if nginx service is working?



To enable Microk8s Inpress Controller we use the command:


After successful activation, we will try to create an ingress file of the dashboard

Czech: ingress-dashboard.yaml

Run the command microk8s kubectl apply -f ingress-dashboard.yaml


When successful, we go to the link to check


Configure nginx Reverse Proxy

Step 1: go to the hosts file to add a line at the end of the machine you are using, here I use Windows

Windows Path: C:WindowsSystem32driversetchosts

MacOS & Linux Path: /etc/hosts


Step 2: Configure nginx

Connect to VM nginx (

then go to directory: /etc/nginx/sites-enabled

create file kubernetes-dashboard.localhost.conf

copy the config and add it to the file kubernetes-dashboard.localhost.conf

Save and check the config is correct: sudo nginx -t

Restart the service:

Configure ingress-dashboard.yaml

Add the host line: kubernetes-dashboard.localhost to

Run config again: microk8s kubectl apply -f ingress-dashboard.yaml


If you find this post helpful, please give me a like and subscribe to support me. Thank you so much


Share the news now

Source : Viblo