Ask Your Question
1

How can SSL passthrough be implemented with Traefik in Kubernetes?

asked 2022-09-22 11:00:00 +0000

bukephalos gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2021-11-22 08:00:00 +0000

huitzilopochtli gravatar image

SSL passthrough can be implemented with Traefik in Kubernetes by following these steps:

  1. Disable SSL termination in Traefik by adding the following config to the Traefik deployment spec:
- --entrypoints.web.http.redirections.entryPoint.to=websecure
- --entrypoints.web.http.redirections.entryPoint.scheme=https
  1. Add a new entry point for SSL passthrough:
- --entrypoints.websecure.address=:443
  1. Add a new service to Kubernetes for SSL passthrough:
apiVersion: v1
kind: Service
metadata:
  name: my-service
  annotations:
    traefik.frontend.passHostHeader: "true"
spec:
  selector:
    app: my-app
  ports:
  - name: https
    port: 443
    protocol: TCP
    targetPort: 443
  1. Configure Traefik to use SSL passthrough for this service by adding the following to the Traefik deployment spec:
- --tcp.services=my-service
- --tcp.routers=my-service
- --tcp.routers.my-service.entrypoints=websecure
- --tcp.routers.my-service.rule=HostSNI(`mydomain.com`)
- --tcp.services.my-service.loadBalancer.server.port=443

Replace mydomain.com with the domain name used for SSL connections to the service.

  1. Apply the updated Traefik and Kubernetes configs.

After completing these steps, Traefik will pass SSL traffic through to the Kubernetes service without terminating the SSL connection.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2022-09-22 11:00:00 +0000

Seen: 17 times

Last updated: Nov 22 '21