Hello all, I'm installing Traefik 2 in Azure Kubernetes Service using just plain yaml files (no Helm). I can see the controller is up&running and it loaded the config from a configmap (from TOML). The Ping works, if I go to http:///ping I get an OK response.
My problem is that I cannot get the dashboard to work. It's probably just a silly little setting somewhere or an inconsistency in the configs but I can't find it, hope someone can help me out by reviewing the info and configs below.
It looks like it does not register any routes but I can't see how to fix it. As a beginner in Traefik the documentation of Traefik and its settings is a bit thin. I used a lot of examples from blogs but it seems a lot of things changed over time and there are different styles of doing things - probably even different per platform. All of this makes it more difficult to find out what should work in my case.
Thanks in advance.
==================================================
All things are installed in a Kubernetes namespace called: traefik
When I visit http:/// I get a message "404 page not found", when trying another port like 8080 my browser just times out (ERR_CONNECTION_TIMED_OUT) with no response from the server.
When viewing the log of the controllers using
kubectl -n traefik logs traefik-ingress-controller-85d7db87-xdm7d
It shows:
time="2020-03-15T21:15:41Z" level=info msg="Configuration loaded from file: /config/traefik.toml"
The DNS zone of my AKS cluster is something like:
9d0a8406b5e571a2b150.westeurope.aksapp.io
So I thought I need to set the host of my dashboard ingress to be something like: traefik.traefik.9d0a8406b5e571a2b150.westeurope.aksapp.io
I added a DNS A-record to map it to the IP address of traefik (the one that responds to the ping)
These are my config files:
---
apiVersion: v1
kind: ConfigMap
metadata:
name: traefik-ingress-configmap
namespace: traefik
data:
traefik.toml: |
defaultEntryPoints = ["https","http"]
[entryPoints]
[entryPoints.http]
address = ":80"
[entryPoints.https]
address = ":443"
[entryPoints.traefik]
address = ":8080"
[providers]
[providers.kubernetesIngress]
namespaces = ["traefik"]
ingressclass = "traefik"
[providers.kubernetesIngress.ingressEndpoint]
publishedService = "traefik/traefik-ingress-controller-http-service"
[ping]
entryPoint = "http"
[api]
dashboard=true
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: traefik-ingress-serviceaccount
---
kind: Service
apiVersion: v1
metadata:
name: traefik-ingress-controller-http-service
namespace: traefik
annotations: {}
spec:
selector:
k8s-app: traefik-ingress-controller
ports:
- protocol: TCP
port: 80
name: http
- protocol: TCP
port: 443
name: https
type: NodePort
---
kind: Service
apiVersion: v1
metadata:
name: traefik-ingress-controller-dashboard-service
spec:
selector:
k8s-app: traefik-ingress-controller
ports:
- port: 8080
name: dashboard
---
kind: Deployment
apiVersion: apps/v1
metadata:
name: traefik-ingress-controller
namespace: traefik
labels:
k8s-app: traefik-ingress-controller
spec:
replicas: 1
selector:
matchLabels:
k8s-app: traefik-ingress-controller
template:
metadata:
labels:
k8s-app: traefik-ingress-controller
name: traefik-ingress-controller
spec:
serviceAccountName: traefik-ingress-serviceaccount
terminationGracePeriodSeconds: 35
volumes:
- name: traefik-ui-tls-cert
secret:
secretName: traefik-ui-tls-cert
- name: traefik-ingress-configmap
configMap:
name: traefik-ingress-configmap
containers:
- image: traefik
name: traefik-ingress-controller
imagePullPolicy: Always
resources:
limits:
cpu: 200m
memory: 384Mi
requests:
cpu: 25m
memory: 128Mi
livenessProbe:
failureThreshold: 2
httpGet:
path: /ping
port: 80
scheme: HTTP
initialDelaySeconds: 10
periodSeconds: 5
readinessProbe:
failureThreshold: 2
httpGet:
path: /ping
port: 80
scheme: HTTP
periodSeconds: 5
volumeMounts:
- mountPath: "/ssl"
name: "traefik-ui-tls-cert"
- mountPath: "/config"
name: "traefik-ingress-configmap"
ports:
- name: http
containerPort: 80
- name: https
containerPort: 443
- name: dashboard
containerPort: 8080
args:
- --log.level=DEBUG
- --configfile=/config/traefik.toml
---
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: traefik-ingress-controller-dashboard-ingress
namespace: traefik
annotations:
kubernetes.io/ingress.class: traefik
spec:
rules:
- host: traefik.9d0a8406b5e571a2b150.westeurope.aksapp.io
http:
paths:
- path: /
backend:
serviceName: traefik-ingress-controller-dashboard-service
servicePort: 8080
---
apiVersion: v1
kind: Secret
metadata:
name: traefik-ui-tls-cert
namespace: traefik
labels:
k8s-app: traefik-ingress-controller
type: kubernetes.io/tls
data:
tls.crt: LS0tLS1CRUd.... (abbreviated)
tls.key: LS0tLS1CRU...... (abbreviated)