Skip to content
K8s cluster with multiple namespaces and ingress routing based on hostname
Go Dockerfile
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
default
echo
.gitignore
Dockerfile
README.md
go.mod
main.go

README.md

Microk8s Example

This is a demo of Microk8s with multiple namespaces.

The reason for this repo is because I couldn't find something like this, so I created it.

Setup

1.) Do the quick start and enable the addons

microk8s.enable dns dashboard ingress

Note: this will expose the cluster on localhost:80 make sure this port is available, I am not sure how to change this.

2.) Apply the defualt configurations

microk8s.kubectl apply -f default/

3.) Apply the echo configurations

microk8s.kubectl apply -f echo/namespace.yml
microk8s.kubectl apply -f echo/

4.) Test!

this will resolve default.localhost to localhost and the default namespace

curl -L --insecure --resolve default.localhost:80:localhost http://default.localhost:80

this will resolve echo.localhost to localhost and the echo namespace

curl -L --insecure --resolve echo.localhost:80:localhost http://echo.localhost:80/echo/world

Helpful commands

microk8s.status
microk8s.start
microk8s.stop
microk8s.kubectl apply -f echo/
microk8s.kubectl delete -f echo/
microk8s.enable dns dashboard ingress
microk8s.disable dns dashboard ingress
microk8s.status | grep enabled
You can’t perform that action at this time.