Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to configure traefik? #450

Closed
mattfysh opened this issue Feb 19, 2025 · 2 comments
Closed

How to configure traefik? #450

mattfysh opened this issue Feb 19, 2025 · 2 comments

Comments

@mattfysh
Copy link

When deploying the k3s node with traefik, is there a way to change:

  1. the default TLS options
  2. disable port 80 on the loadbalancer
  3. change the websecure port to something other than 443?
@alexellis
Copy link
Owner

Hi @mattfysh if this is the route you'd like go down, then the pre-installed Traefik is probably not the best option for you.

Instead, install with --no-traefik and then use arkade install traefik and pass in the various --set arguments you wish to use, or simply install Traefik in a completely customised fashion using its values.yaml file.

We cannot support you with Traefik directly, but I'm sure you can find what you need in their docs.

Alex

@mattfysh
Copy link
Author

this seems to work, given that k3s allows you to customize bundled components. the only thing I couldn't use was asDefault which appears to be a traefik v3 feature, whereas k3s has bundled v2

traefik-config.yaml

apiVersion: helm.cattle.io/v1
kind: HelmChartConfig
metadata:
  name: traefik
  namespace: kube-system
spec:
  valuesContent: |-
    ports:
      web:
        expose:
          default: false
      websecure:
        # asDefault: true
        exposedPort: 31111
    tlsOptions:
      default:
        labels: {}
        sniStrict: true
        alpnProtocols: ['http/1.1']
scp traefik-config.yaml $SERVER:/home/debian/traefik-config.yaml

ssh $SERVER sudo \
  mv traefik-config.yaml /var/lib/rancher/k3s/server/manifests/traefik-config.yaml

it seems to survive k3sup install upgrades too 🎉

Repository owner locked and limited conversation to collaborators Feb 20, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants