Fix Tailscale ingress backends by removing spec.rules[].host #172
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.
Tailscale operator rejects ingresses with explicit
spec.rules[].host, emittingInvalidIngressBackendandNoValidBackendsevents. Operator requires "hostless" ingresses, determining hostname fromspec.tls[0].hosts[0].Changes
spec.rules[].hostfield (7 ingresses total)crafty-controllertocrafty-controller-portsto avoid collision with ingressExample
Before:
After:
Affected Resources
Original prompt
This section details on the original issue you should resolve
<issue_title>Fix Tailscale Ingress backends + split Crafty UI vs game ports exposure</issue_title>
<issue_description>Goal
Make all Tailscale-managed Ingress resources valid for the Tailscale k8s operator (stop
InvalidIngressBackend/NoValidBackends).For Crafty specifically:
Context / Current Symptoms
Tailscale operator events on ingresses:
InvalidIngressBackend ... rule with host "...ts.net" ignored, unsupportedNoValidBackends ... no valid backendsCurrent Crafty Ingress uses
spec.rules[].host: crafty-controller.rohu-shark.ts.net, which Tailscale operator treats as unsupported.Crafty Service is already annotated for service exposure and has valid EndpointSlices.
Scope
Only touch:
argocd/apps/**manifests that define Tailscale ingresses and the Crafty service/ingress.Do not change:
Requirements
1) Tailscale Ingress resources must be “hostless”
For any Ingress with
spec.ingressClassName: tailscale:spec.rules[].hostentirely.spec.rules[].http.paths[]intact.spec.tls[0].hosts[0]is set to the desired shortname (e.g.,crafty-controller,paperless,homepage, etc.). This is what Tailscale uses to create the tailnet hostname/service.Acceptance criteria
kubectl describe ingress <name>no longer shows:InvalidIngressBackend“host ignored, unsupported”NoValidBackendsTailscale operator logs show it successfully exposes the ingress.
2) Crafty: split UI ingress from game/service port exposure
2a) Crafty UI via Ingress
Crafty UI Ingress must:
ingressClassName: tailscalespec.rules[].host/to the Crafty UI backend service on port 443 (targetPort 8443 already).tls.hostsshould contain exactly:crafty-controller(shortname)Do not include
tailscale.com/expose: "true"on the Ingress unless it is already required in your repo patterns; prefer only the tags/hostname config needed for ingress.2b) Crafty game ports via Service (port exposure)
Keep Crafty Service exposing non-HTTP ports directly (Minecraft Java ports, Bedrock UDP, dynmap, voice chat, etc.).
Crafty Service should retain:
tailscale.com/expose: "true"tailscale.com/hostname: crafty-controller(BUT: hostname collisions must be avoided; see below)Important collision rule
You cannot have the Ingress and Service both trying to claim the same Tailscale hostname (
crafty-controller) unless you intentionally want only one and the other fails/flaps.So:
The Ingress should own the hostname
crafty-controllerfor the UI.The Service should use a distinct hostname for raw ports, e.g.:
crafty-controller-svccrafty-controller-portscrafty-mcPick one and apply consistently.
Acceptance criteria
https://crafty-controller.<tailnet-domain>(or whatever tailnet DNS pattern you use).<service-hostname>.<tailnet-domain>:25565etc.Implementation Tasks (Copilot steps)
Task A — Fix all Tailscale ingresses
Search repo for ingresses using Tailscale class:
ingressClassName: tailscaleFor each, remove
spec.rules[].hostkeys.Ensure
spec.rules[].http.paths[].backend.service.nameand.portremain correct.Ensure
spec.tls[0].hosts[0]exists and is a shortname (no.ts.net).Task B — Crafty-specific split
Update Crafty Ingress:
spec.rules[0].hostservice: crafty-controllerport443tls.hosts: [crafty-controller]Update Crafty Service annotations:
tailscale.com/expose: "true"tailscale.com/hostnameto a non-conflicting name, e.g.crafty-controller-portsTask C — Validation commands documented in PR description
Add to the PR description (not as code comments in manifests):
kubectl -n apps-crafty-controller describe ingress crafty-controllerkubectl -n apps-crafty-controller get ingress crafty-controller -o yamlkubectl -n apps-crafty-controller get svc crafty-controller -o yamlkubectl -n tailscale logs deploy/operator -c operator --tail=200Out of Scope (expl...
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.