Traefik TLS Azure AKS not working

Hi Folks,

i am new in Kubernetes (AKS) and trying to make a simple “whoami” site running.

I have created a simple Azure AKS Service and deployed Traefik by HELM (helm install traefik traefik/traefik)

After that step I deployed a simple WHOAMI-Container, with its Service and Ingress

---
kind: Deployment
apiVersion: apps/v1
metadata:
  namespace: default
  name: whoami
  labels: 
    app: whoami
spec:
  replicas: 1
  selector:
    matchLabels:
      app: whoami
  template:
    metadata:
      labels:
        app: whoami
    spec:
      containers:
      - name: whoami-container
        image: containous/whoami
        ports: 
          - name: web
            containerPort: 80
---
kind: Service
apiVersion: v1
metadata:
  name: whoami-srv

spec:
  type: ClusterIP
  ports:
  - port: 80
    name: websecure
  selector:
    app: whoami
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: whoami-ingress
spec:
  tls:
    - hosts:
        - test.mydomain.de
      secretName: wildcardcert
  rules:
  - host: test.mydomain.de
    http:
      paths:
      - path: /
        pathType: ImplementationSpecific
        backend:
          service:
            name: whoami-srv
            port:
              number: 80

I can reach the WHOAMI by opening Http://test.mydomain.de. If I open HTTPS://test.mydomain.de I can see the right certificate but I still get a “404 page not found”

Any tips from your site? I trying back and forth a couple of times :slight_smile:

Thanks!

I replied to this on reddit with a pretty lazy answer.

Assuming you’re using v2 and it’s installed with a certificate resolver setup, this is what I’ve had to do. Here’s an excerpt from one of my helm charts.

{{- if .Capabilities.APIVersions.Has "traefik.containo.us/v1alpha1" }}
---
apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
  labels:
    {{- include "chart.labels" . | nindent 4 }}
  name: mediawiki-ingressroute-http
spec:
  entryPoints:
  - web
  routes:
  - kind: Rule
    match: {{ range .Values.hostnames }}Host(`{{ . }}`) && {{ end }}PathPrefix(`{{ .Values.pathPrefix }}`)
    services:
    - name: mediawiki-mediawiki
      port: 80
---
apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
  labels:
    {{- include "chart.labels" . | nindent 4 }}
  name: mediawiki-ingressroute-https
spec:
  entryPoints:
  - websecure
  routes:
  - kind: Rule
    match: {{ range .Values.hostnames }}Host(`{{ . }}`) && {{ end }}PathPrefix(`{{ .Values.pathPrefix }}`)
    services:
    - name: mediawiki-mediawiki
      port: 80
  tls:
    certResolver: myresolver
{{- end }}