HTTPS connection from Traefik to a JuypterHub Kubernetes Service does only work with insecureSkipVerify = true set in the global configuration.
To avoid insecureSkipVerify, I tried to configure serverstransport in the ingress configuration:
kind: Ingress
apiVersion: networking.k8s.io/v1beta1
metadata:
name: "jupyter"
namespace: namespace-jupyterhub
annotations:
traefik.ingress.kubernetes.io/service.serversscheme: https
traefik.ingress.kubernetes.io/service.serverstransport: jupyterhub@file
traefik.ingress.kubernetes.io/router.entrypoints: websecure
traefik.ingress.kubernetes.io/router.middlewares: secHeaders@file
traefik.ingress.kubernetes.io/router.tls: "true"
spec:
tls:
- hosts:
- xxx
secretName: jupyterhub-tls
rules:
- host: xxx
http:
paths:
- path: /
backend:
serviceName: proxy-public
servicePort: 443
and a dynamic configuration
[http.serversTransports.jupyterhub]
serverName = "xxx"
rootCAs = "/etc/ssl/chain.pem"
The serverstransport works with the same certificates for docker services.