Skip to content

Instantly share code, notes, and snippets.

@vvdaal
Last active January 5, 2023 14:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vvdaal/be697989618eb1b3c87167157aff015a to your computer and use it in GitHub Desktop.
Save vvdaal/be697989618eb1b3c87167157aff015a to your computer and use it in GitHub Desktop.
This shows a working example of a traefik-config.yaml override for k3s, this should be stored in /var/lib/rancher/k3s/server/manifests and allows letsencrypt via a web httpChallenge. The resolver is named letsencryptweb.
apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
namespace: apps
name: example-ingress
spec:
entryPoints:
- websecure
routes:
- match: Host(`your-own-awesome-domain.com`)
kind: Rule
services:
- name: your-awesome-service
port: port-of-your-service
tls:
certResolver: letsencryptweb
apiVersion: helm.cattle.io/v1
kind: HelmChartConfig
metadata:
name: traefik
namespace: kube-system
spec:
valuesContent: |-
logs:
access:
enabled: true
ports:
web:
port: 80
websecure:
port: 443
persistence:
enabled: true
certResolvers:
letsencryptweb:
email: "yourownvalidemail"
httpChallenge:
entrypoint: "web"
storage: /data/acme.json
@vvdaal
Copy link
Author

vvdaal commented Jan 5, 2023

Installation:

  • Modify traefik-config.yaml to reference a valid email that will receive ACME notifications.
  • Modify example-ingress-traefik.yaml to reference to your own service and port

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment