Can't make it work with microk8s

Hi daniel, thanks for you quick response.

traefik version is 1.72. installed by helm.

what I'm trying to do is:

on a ubuntu 18.04 server, i installed microk8s, then enable dns dashboard. Traefik, and some ingress,

I want to open traefik dashboard in traefik.k8s.example.com without a node port. and other service as well. commands for test as below.

snap install microk8s helm --classic
microk8s.enable dns dashboard


kubectl create ns t1
kubectl create ns t2
kubectl run hello-nginx --image=nginx --port=80 -n t1
kubectl run hello-nginx --image=nginx --port=80 -n t2
kubectl expose deployment hello-nginx --port=80 -n t1
kubectl expose deployment hello-nginx --port=80 -n t2


helm install stable/traefik --set dashboard.enabled=true,dashboard.domain=traefik.k8s.example.com

for cross namespace routing. I create a svc.yaml with externalName

apiVersion: v1
kind: Service
metadata:
  name: service-1
  namespace: default
spec:
  type: ExternalName
  externalName: hello-nginx.t1.svc.cluster.local
  ports:
  - name: http
    port: 80
    targetPort: 80
    protocol: TCP

---

apiVersion: v1
kind: Service
metadata:
  name: service-2
  namespace: default
spec:
  type: ExternalName
  externalName: hello-nginx.t2.svc.cluster.local
  ports:
  - name: http
    port: 80
    targetPort: 80
    protocol: TCP
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  annotations:
    kubernetes.io/ingress.class: traefik
    traefik.frontend.rule.type: PathPrefixStrip
  name: ingress-to-other-ns
  namespace: default
spec:
  rules:
  - host: t1.k8s.example.com
    http:
      paths:
      - backend:
          serviceName: service-1
          servicePort: 80
        path: /
  - host: t2.k8s.example.com
    http:
      paths:
      - backend:
          serviceName: service-2
          servicePort: 80
        path: /

on docker for Mac, I can get it to work with these yaml, I can open t1.localhost, t2.localhost, dashboard.localhost. without any port. the load balancer ip for helm install is "localhost"

on ubuntu vps, the load balancer ip for helm install is always "pending". I've tried to use metallb with traefik for assign load balancer ip. but I can't get it work. here is my config.

apiVersion: v1
kind: ConfigMap
metadata:
  namespace: metallb-system
  name: config
data:
  config: |
    address-pools:
    - name: default
      protocol: layer2
      addresses:
      - 103.61.38.208

103.61.38.208 is the public ip for the vps.

kubectl apply -f https://raw.githubusercontent.com/google/metallb/v0.8.1/manifests/metallb.yaml

it seems it's more likely a problem for microk8s, as I can get it work on docker for Mac.

I just searched your answer on this question, can you elaborate a little bit ?