---
apiVersion: traefik.io/v1alpha1
kind: Middleware
metadata:
  name: redirect-https
  namespace: joplin
spec:
  redirectScheme:
    scheme: https
    permanent: true
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: joplin
  namespace: joplin
  annotations:
    cert-manager.io/cluster-issuer: letsencrypt
    traefik.ingress.kubernetes.io/router.entrypoints: web,websecure
    traefik.ingress.kubernetes.io/router.middlewares: joplin-redirect-https@kubernetescrd
spec:
  ingressClassName: traefik
  rules:
    - host: note.expertfab.de
      http:
        paths:
          - path: /
            pathType: Prefix
            backend:
              service:
                name: joplin
                port:
                  number: 22300
  tls:
    - hosts:
        - note.expertfab.de
      secretName: joplin-tls
