Skip to content

Instantly share code, notes, and snippets.

@nakamorichi
Last active August 11, 2019 08:34
Show Gist options
  • Save nakamorichi/854720f804bf5b6f93c53ee492665055 to your computer and use it in GitHub Desktop.
Save nakamorichi/854720f804bf5b6f93c53ee492665055 to your computer and use it in GitHub Desktop.
Traefik 2.0 ingress definition
kind: Middleware
apiVersion: traefik.containo.us/v1alpha1
metadata:
name: traefik-dashboard-auth
namespace: traefik
spec:
basicAuth:
users:
# admin:password <do not use in production>
# better way would be to use Secret
- admin:$apr1$FGdrANYF$f0lAEDTXdWmxNfABopXX01
---
kind: IngressRoute
apiVersion: traefik.containo.us/v1alpha1
metadata:
name: traefik-dashboard
namespace: traefik
spec:
entryPoints: [https]
tls:
secretName: traefik-cert
routes:
- match: Host(`traefik.yourdomain.com`)
kind: Rule
services:
- name: traefik-dashboard
port: 8080
healthCheck:
path: /dashboard/
intervalSeconds: 3
timeoutSeconds: 60
middlewares:
- name: traefik-dashboard-auth
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment