Skip to content

Commit

Permalink
Merge pull request #1012 from civo/changeTraefikPort
Browse files Browse the repository at this point in the history
Fix: make Traefik2-nodeport to use a different port than 9100
  • Loading branch information
Praveen005 authored Jan 22, 2025
2 parents b3fd86c + aac6a86 commit c49ad2c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
8 changes: 4 additions & 4 deletions traefik2-nodeport/app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ spec:
metadata:
annotations:
prometheus.io/path: /metrics
prometheus.io/port: "9100"
prometheus.io/port: "9910"
prometheus.io/scrape: "true"
labels:
app.kubernetes.io/instance: traefik-kube-system
Expand All @@ -110,7 +110,7 @@ spec:
- args:
- --global.checknewversion
- --global.sendanonymoususage
- --entrypoints.metrics.address=:9100/tcp
- --entrypoints.metrics.address=:9910/tcp
- --entrypoints.traefik.address=:9000/tcp
- --entrypoints.web.address=:80/tcp
- --entrypoints.websecure.address=:443/tcp
Expand All @@ -136,8 +136,8 @@ spec:
timeoutSeconds: 2
name: traefik
ports:
- containerPort: 9100
hostPort: 9100
- containerPort: 9910
hostPort: 9910
name: metrics
protocol: TCP
- containerPort: 9000
Expand Down
4 changes: 4 additions & 0 deletions traefik2-nodeport/post_install.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,7 @@ spec:
This will open up `http://www.example.com` (assuming you pointed that non-real domain record to your cluster's IPs) to the whole world.

Port 80 and 443 are both exposed through a `NodePort` service.

## Metrics and Monitoring

Traefik exposes metrics on port 9910 for Prometheus scraping. To scrape metrics from Traefik, ensure your Prometheus configuration is updated to use port **9910**.

0 comments on commit c49ad2c

Please sign in to comment.