Skip to content

Instantly share code, notes, and snippets.

@artbikes
Created June 18, 2020 20:47
Show Gist options
  • Save artbikes/a2784c2ae31bcbaab4ef8cd98bdfb3e2 to your computer and use it in GitHub Desktop.
Save artbikes/a2784c2ae31bcbaab4ef8cd98bdfb3e2 to your computer and use it in GitHub Desktop.
prometheus traefik
# static configuration
global:
checkNewVersion: true
serversTransport:
insecureSkipVerify: true
entryPoints:
traefik:
address: :8082
https:
address: :443
metrics:
address: :8083
providers:
providersThrottleDuration: 2s
file:
filename: "/etc/traefik/traefik.yml"
api:
dashboard: true
metrics:
prometheus:
manualRouting: true
buckets:
- 0.1
- 0.3
- 1.2
- 5.0
log:
level: WARN
format: json
filePath: "/logs/traefik.log.json"
accessLog:
format: json
filePath: "/logs/accessLogs.log.json"
---
## dynaminc configuration
tls:
stores:
default:
defaultCertificate:
certFile: /certs/servercert.pem
keyFile: /certs/serverkey.pem
http:
routers:
api:
rule: PathPrefix(`/`)
service: api@internal
entryPoints:
- traefik
middlewares:
- apiAuth
- compress
metrics:
rule: PathPrefix(`/metrics`)
service: prometheus@internal
entryPoints:
- metrics
middlewares:
- metricsAuth
middlewares:
apiAuth:
basicAuth:
users:
- "admin:ENCRYPTEDPASSWORD"
metricsAuth:
basicAuth:
users:
- "prometheus:ENCRYPTEDPASSWORD"
compress:
compress: {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment