Skip to content

K8s cluster with multiple namespaces and ingress routing based on hostname

Notifications You must be signed in to change notification settings

BenSlabbert/microk8s-multiple-namespaces-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

K8s cluster with multiple namespaces and ingress routing based on hostname

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published