-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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 to configure Ingress when deploying on K3S with Traefik? #9554
Comments
I can't figure this out either. Documentation only supports |
I have managed to expose the dashboard through traefik ingress by ignoring the helm-generated ingress, and disabling kong proxy. My helm values file ...
kong:
enabled: false
... Ingress: apiVersion: traefik.containo.us/v1alpha1
kind: Middleware
metadata:
name: dashboard-http-redirect
namespace: kube-dashboard
spec:
redirectScheme:
scheme: https
permanent: true
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: dashboard-http-redirect
namespace: kube-dashboard
annotations:
traefik.ingress.kubernetes.io/router.entrypoints: web
# MUST be <namespace>-<name>@kubernetescrd
traefik.ingress.kubernetes.io/router.middlewares: kube-dashboard-dashboard-http-redirect@kubernetescrd
spec:
rules:
- host: dashboard-ingress.k3s.local
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: kubernetes-dashboard-web
port:
number: 8000
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: dashboard-https
namespace: kube-dashboard
annotations:
traefik.ingress.kubernetes.io/router.entrypoints: websecure
traefik.ingress.kubernetes.io/router.tls: "true"
spec:
rules:
- host: dashboard-ingress.k3s.local
http:
paths:
- path: /api/v1/login
pathType: Prefix
backend:
service:
name: kubernetes-dashboard-auth
port:
number: 8000
- path: /api/v1/csrftoken/login
pathType: Prefix
backend:
service:
name: kubernetes-dashboard-auth
port:
number: 8000
- path: /api/v1/me
pathType: Prefix
backend:
service:
name: kubernetes-dashboard-auth
port:
number: 8000
- path: /api
pathType: Prefix
backend:
service:
name: kubernetes-dashboard-api
port:
number: 8000
- path: /metrics
pathType: Prefix
backend:
service:
name: kubernetes-dashboard-api
port:
number: 8000
- path: /
pathType: Prefix
backend:
service:
name: kubernetes-dashboard-web
port:
number: 8000
Please note that i generate three thing in the ingress.
The dashboard cannot be exposed on http. It will work on http, but you will not be able to login. See #9252 and #9448 (in particular #9448 (comment)) |
l0ner this solution worked for me, many thanks! One small change, added the TLS secret from Let's Encrypt...
|
What would you like to be added?
Add values.yaml instructions on how to configure ingress to be set on K3S when using default ingress Traefik.
Why is this needed?
Additional support for Traefik.
The text was updated successfully, but these errors were encountered: