Skip to content

Commit

Permalink
fix(Traefik)!: 💥 set 8080 as default port for traefik entrypoint
Browse files Browse the repository at this point in the history
  • Loading branch information
mloiseleur authored Oct 30, 2024
1 parent 323e139 commit 2b32ce7
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 17 deletions.
10 changes: 5 additions & 5 deletions EXAMPLES.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,10 @@ ingressRoute:
The traefik admin port can be forwarded locally:

```bash
kubectl port-forward $(kubectl get pods --selector "app.kubernetes.io/name=traefik" --output=name) 9000:9000
kubectl port-forward $(kubectl get pods --selector "app.kubernetes.io/name=traefik" --output=name) 8080:8080
```

This command makes the dashboard accessible on the url: http://127.0.0.1:9000/dashboard/
This command makes the dashboard accessible on the url: http://127.0.0.1:8080/dashboard/

# Publish and protect Traefik Dashboard with basic Auth

Expand Down Expand Up @@ -173,7 +173,7 @@ extraObjects:
ports:
- port: 8080
name: traefik
targetPort: 9000
targetPort: 8080
protocol: TCP
- apiVersion: v1
Expand Down Expand Up @@ -305,7 +305,7 @@ extraObjects:
config:
type: HTTP
httpHealthCheck:
port: 9000
port: 8080
requestPath: /ping
targetRef:
group: ""
Expand Down Expand Up @@ -701,7 +701,7 @@ spec:
app.kubernetes.io/name: traefik
app.kubernetes.io/instance: traefik-traefik
ports:
- port: 9000
- port: 8080
name: "traefik"
targetPort: traefik
protocol: TCP
Expand Down
4 changes: 2 additions & 2 deletions traefik/VALUES.md
Original file line number Diff line number Diff line change
Expand Up @@ -207,10 +207,10 @@ Kubernetes: `>=1.22.0-0`
| ports.metrics.port | int | `9100` | When using hostNetwork, use another port to avoid conflict with node exporter: https://github.com/prometheus/prometheus/wiki/Default-port-allocations |
| ports.metrics.protocol | string | `"TCP"` | The port protocol (TCP/UDP) |
| ports.traefik.expose | object | `{"default":false}` | You SHOULD NOT expose the traefik port on production deployments. If you want to access it from outside your cluster, use `kubectl port-forward` or create a secure ingress |
| ports.traefik.exposedPort | int | `9000` | The exposed port for this service |
| ports.traefik.exposedPort | int | `8080` | The exposed port for this service |
| ports.traefik.hostIP | string | `nil` | Use hostIP if set. If not set, Kubernetes will default to 0.0.0.0, which means it's listening on all your interfaces and all your IPs. You may want to set this value if you need traefik to listen on specific interface only. |
| ports.traefik.hostPort | string | `nil` | Use hostPort if set. |
| ports.traefik.port | int | `9000` | |
| ports.traefik.port | int | `8080` | |
| ports.traefik.protocol | string | `"TCP"` | The port protocol (TCP/UDP) |
| ports.web.expose.default | bool | `true` | |
| ports.web.exposedPort | int | `80` | |
Expand Down
2 changes: 1 addition & 1 deletion traefik/tests/deployment-config_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ tests:
- --global.checknewversion
- --global.sendanonymoususage
- --entryPoints.metrics.address=:9100/tcp
- --entryPoints.traefik.address=:9000/tcp
- --entryPoints.traefik.address=:8080/tcp
- --entryPoints.web.address=:8000/tcp
- --entryPoints.websecure.address=:8443/tcp
- --api.dashboard=true
Expand Down
12 changes: 6 additions & 6 deletions traefik/tests/ports-config_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,25 +45,25 @@ tests:
path: spec.template.spec.containers[0].args
content: "--entryPoints.websecure.address=:8443/tcp"
template: deployment.yaml
- it: should have port 9000 of pod exposed for probes but NOT published to the service by default
- it: should have traefik port of pod exposed for probes but NOT published to the service by default
asserts:
- contains:
path: spec.template.spec.containers[0].ports
content:
name: traefik
containerPort: 9000
containerPort: 8080
protocol: TCP
template: deployment.yaml
- notContains:
path: spec.ports
content:
name: traefik
port: 9000
port: 8080
targetPort: traefik
template: service.yaml
- contains:
path: spec.template.spec.containers[0].args
content: "--entryPoints.traefik.address=:9000/tcp"
content: "--entryPoints.traefik.address=:8080/tcp"
template: deployment.yaml
- it: should have a custom port when specified via values
set:
Expand Down Expand Up @@ -185,7 +185,7 @@ tests:
content: "--entryPoints.websecure.address=:8443/tcp"
- contains:
path: spec.template.spec.containers[0].args
content: "--entryPoints.traefik.address=:9000/tcp"
content: "--entryPoints.traefik.address=:8080/tcp"

- it: should set probes host when hostIP is configured
template: deployment.yaml
Expand All @@ -196,7 +196,7 @@ tests:
asserts:
- contains:
path: spec.template.spec.containers[0].args
content: "--entryPoints.traefik.address=localhost:9000/tcp"
content: "--entryPoints.traefik.address=localhost:8080/tcp"
- equal:
path: spec.template.spec.containers[0].livenessProbe.httpGet.host
value: localhost
Expand Down
6 changes: 3 additions & 3 deletions traefik/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ deployment:
# postStart:
# httpGet:
# path: /ping
# port: 9000
# port: 8080
# host: localhost
# scheme: HTTP
# -- Set a runtimeClassName on pod
Expand Down Expand Up @@ -590,7 +590,7 @@ envFrom: []

ports:
traefik:
port: 9000
port: 8080
# -- Use hostPort if set.
hostPort: # @schema type:[integer, null]; minimum:0
# -- Use hostIP if set. If not set, Kubernetes will default to 0.0.0.0, which
Expand All @@ -608,7 +608,7 @@ ports:
expose:
default: false
# -- The exposed port for this service
exposedPort: 9000
exposedPort: 8080
# -- The port protocol (TCP/UDP)
protocol: TCP
web:
Expand Down

0 comments on commit 2b32ce7

Please sign in to comment.