Serve PXE k3s credentials on pxe_web_port (8080) to avoid Traefik port 80 clash#123
Merged
Conversation
The pxe_controller role served the k3s token/kubeconfig over Apache on host port 80. When the PXE controller is co-located on a k3s node, that collides with k3s Traefik / ServiceLB, which binds host ports 80/443 for cluster ingress. Move the credential endpoint to a dedicated, configurable port (pxe_web_port, default 8080): add an Apache ports.conf and a dedicated vhost, disable the default site to free port 80, and point the agent k3s-auto-join URLs and the role's verification/summary at the new port. This is purely an internal endpoint reached by PXE agents on the node subnet, so the port number is arbitrary and 80/443 are left entirely to Traefik. Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The
pxe_controllerrole served the k3s token/kubeconfig over Apache on host port 80. When the PXE controller is co-located on a k3s node (e.g. the single-machine 3-node mini-cluster example), that collides with k3s Traefik / ServiceLB, which binds host ports 80/443 for cluster ingress.This moves the credential endpoint to a dedicated, configurable port (
pxe_web_port, default 8080):templates/apache-ports.conf.j2(Listen {{ pxe_web_port }}) and a dedicatedtemplates/pxe-http-vhost.conf.j2.000-default) to free host port 80, enable the PXE vhost, and flush the Apache handler.k3s-auto-join.shtoken/kubeconfig URLs, plus the role's verification task and summary, atpxe_web_port.pxe_web_portin role defaults and the PXE playbook vars.The
/k3s/endpoint is internal-only (reached by PXE agents on the node subnet), so the port is arbitrary and 80/443 are left entirely to Traefik. Setpxe_web_port: 80to restore the old behaviour on a dedicated service machine.Notes
:8080in thedocs-multi-node-pxe-examplebranch PR (docs: fix multi-AIPC deployment guide gaps and align k3s endpoint port #122).Test plan
pb-pxe-controller.yml; confirmapache2is active andcurl -I http://127.0.0.1:8080/k3s/returns 403:8080and joins the clusterMade with Cursor