8000 Traefik-passthrough doc file by ruchikajha95 · Pull Request #48556 · keycloak/keycloak · GitHub
[go: up one dir, main page]

Skip to content

Traefik-passthrough doc file - #48556

Merged
ahus1 merged 6 commits into
keycloak:mainfrom
ruchikajha95:feature-48127/traefic-replication
Apr 30, 2026
Merged

ahus1 merged 6 commits into
keycloak:mainfrom
ruchikajha95:feature-48127/traefic-replication

Conversation

@ruchikajha95
Copy link
Copy Markdown
Contributor

Replicated the adoc file for Traefik using Haproxy as a reference.

Closes #48128

Closes keycloak#48128
Signed-off-by: Ruchika <ruchika.jha1@ibm.com>
@ruchikajha95
ruchikajha95 requested review from ahus1 and pruivo April 28, 2026 14:36
Closes keycloak#48128
Signed-off-by: Ruchika <ruchika.jha1@ibm.com>
Closes keycloak#48128
Signed-off-by: Ruchika <ruchika.jha1@ibm.com>
@ahus1
ahus1 commented Apr 29, 2026
Copy link
Copy Markdown
Member

The PR looks good to me. Once Pedro's comments are addressed, this should be good for merging.

The experiment on what happens to open TCP connections once Traefik detects a backend is down could be handled as a follow-up if we want to get this merged earlier.

Closes keycloak#48128
Signed-off-by: Ruchika <ruchika.jha1@ibm.com>
@ruchikajha95 ruchikajha95 self-assigned this Apr 29, 2026
@ruchikajha95
ruchikajha95 requested a review from pruivo April 29, 2026 12:40
@ruchikajha95
Copy link
Copy Markdown
Contributor Author

The PR looks good to me. Once Pedro's comments are addressed, this should be good for merging.

The experiment on what happens to open TCP connections once Traefik detects a backend is down could be handled as a follow-up if we want to get this merged earlier.

All the comments above have been addressed . Thank you @pruivo @ahus1

@ruchikajha95
ruchikajha95 marked this pull request as ready for review April 29, 2026 12:42
@ruchikajha95
ruchikajha95 requested review from a team as code owners April 29, 2026 12:42
pruivo
pruivo previously requested changes Apr 29, 2026
<2> Ensures this router takes precedence over any other TCP routers that may be defined.
<3> Instructs Traefik to forward the raw TLS stream without terminating it.
{project_name} handles TLS termination directly.
<4> Enables link:https://doc.traefik.io/traefik/routing/services/#proxy-protocol[PROXY protocol v2] on all backend connections.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Link points to an incorrect page

Suggested change
<4> Enables link:https://doc.traefik.io/traefik/routing/services/#proxy-protocol[PROXY protocol v2] on all backend connections.
<4> Enables link:https://doc.traefik.io/traefik/reference/routing-configuration/tcp/serverstransport/#proxyprotocolversion[PROXY protocol v2] on all backend connections.

This allows {project_name} to read the real client IP address from the PROXY protocol header added by Traefik.
This requires {project_name} to be configured with `--proxy-protocol-enabled=true` (see <<keycloak-configuration>>).
<5> Links the load balancer to the named transport above, activating PROXY protocol v2 for all connections to the backend servers.
<6> Configures a link:https://doc.traefik.io/traefik/routing/services/#health-check_1[TCP-level health check] against {project_name}'s management port (`9000`).
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

incorrect link

Suggested change
<6> Configures a link:https://doc.traefik.io/traefik/routing/services/#health-check_1[TCP-level health check] against {project_name}'s management port (`9000`).
<6> Configures a link:https://doc.traefik.io/traefik/reference/routing-configuration/tcp/service/#health-check[TCP-level health check] against {project_name}'s management port (`9000`).

Comment on lines +142 to +144
Configures the management port (`9000`) to use plain HTTP instead of HTTPS.
Traefik cannot perform an HTTPS health check on a TCP passthrough service, so the management port must use plain HTTP.
This is safe because the management port is only reachable on the internal backend network and is not exposed to clients.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let me know if this sounds clearer @ruchikajha95 @ahus1

Suggested change
Configures the management port (`9000`) to use plain HTTP instead of HTTPS.
Traefik cannot perform an HTTPS health check on a TCP passthrough service, so the management port must use plain HTTP.
This is safe because the management port is only reachable on the internal backend network and is not exposed to clients.
Configures the management port (`9000`) to use plain HTTP instead of HTTPS.
Traefik does not support native HTTP health checks for TCP services; it can only send and match raw bytes over a plain TCP connection.
Disabling TLS on the management port allows the raw `send`/`expect` health check (see the health check configuration above) to communicate with {project_name} in plain HTTP.
This is safe because the management port is only reachable on the internal backend network and is not exposed to clients.


<1> Matches all TLS connections regardless of the SNI hostname.
This is suitable when Traefik is dedicated to {project_name} only.
If Traefik handles multiple backend services, use a specific hostname instead of a wildcard (for example, `HostSNI(`keycloak.example.com`)`) to avoid routing unintended traffic to {project_name}.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The rendering is broken.

Image

The suggestion below seems to fix it

Suggested change
If Traefik handles multiple backend services, use a specific hostname instead of a wildcard (for example, `HostSNI(`keycloak.example.com`)`) to avoid routing unintended traffic to {project_name}.
If Traefik handles multiple backend services, use a specific hostname instead of a wildcard (for example, ``HostSNI(`keycloak.example.com`)``) to avoid routing unintended traffic to {project_name}.

ruchikajha95 and others added 2 commits April 30, 2026 10:52
Closes keycloak#48128
Signed-off-by: Ruchika <ruchika.jha1@ibm.com>
…uations

Signed-off-by: Alexander Schwartz <alexander.schwartz@ibm.com>
@ahus1 ahus1 left a comment
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the PR. Pedro's review comments have been addressed. I did one more review, and I'm now merging this PR. Thanks!

@ahus1
ahus1 enabled auto-merge (squash) April 30, 2026 19:31
@ahus1
ahus1 merged commit 168da57 into keycloak:main Apr 30, 2026
63 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Traefik: Documentation for TLS passthrough in main Keycloak docs

3 participants

0