K3S Traefik – HTTP Redirection

You want to redirect all trafic from http to https? You got a K3S Cluster with traefik installed? Fear not my friend.

I almost started crying, no matter what, it didn’t work. Finally I found the solution. We just create a HelmChartConfig which basically injects config into a helm chart, and add 3 lines to it. It will look something like this:

apiVersion: helm.cattle.io/v1
kind: HelmChartConfig
metadata:
  name: traefik
  namespace: kube-system
spec:
  valuesContent: |-
    ports:
      web:
        redirectTo:
          port: "websecure"

Now just apply this config and everything will be good. 🙂


Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.