fix(dev_up): rootless podman cannot bind 80/443 — publish ingress higher - #37
Open
mdheller wants to merge 2 commits into
Open
fix(dev_up): rootless podman cannot bind 80/443 — publish ingress higher#37mdheller wants to merge 2 commits into
mdheller wants to merge 2 commits into
Conversation
scripts/dev_up.sh fails at cluster-create for any rootless-podman user: rootlessport cannot expose privileged port 80, you can add 'net.ipv4.ip_unprivileged_port_start=80' to /etc/sysctl.conf (currently 1024) local/kind-cluster.yaml maps host 80/443 so ingress-nginx is reachable at localhost. Rootless podman cannot bind below ip_unprivileged_port_start, so the create dies BEFORE any workload exists -- the whole dev loop is unavailable, not degraded. Given the estate is podman-first on workstations, this likely affects most users. Asking every operator to edit /etc/sysctl.conf for a dev loop is the wrong trade: it needs root, it is a persistent host change, and it is invisible to anyone who did not read the error. Instead the runtime is detected and the ingress is published where it can actually bind -- 8080/8443 under rootless podman, 80/443 everywhere else -- with a warning naming the ports. The committed kind-cluster.yaml keeps the canonical 80/443 shape and the ports are substituted at create time, so one file serves both runtimes and nothing drifts. SHIM_SHELL_BASE follows the chosen port so porter-shim's links stay correct. Verified: substitution yields a valid kind Cluster for both port pairs, and 'bash -n' passes.
…f-line
My first commit's sed used 'hostPort: 80$' — an end-of-line anchor. The mappings are
inline flow style:
- { containerPort: 80, hostPort: 80, protocol: TCP }
so the anchor matched NOTHING and the cluster was created with the original privileged
ports. The fix silently did nothing, which is worse than not shipping it: rootless
podman would still fail and the code would look like it had been handled.
Now anchored on the containerPort that precedes each hostPort, and verified for BOTH
pairs rather than assumed:
host 80/443 -> [(80, 80), (443, 443)]
host 8080/8443 -> [(80, 8080), (443, 8443)]
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.
scripts/dev_up.shfails at cluster-create for any rootless podman user:local/kind-cluster.yamlmaps host 80/443 so ingress-nginx is reachable at localhost. Rootless podman cannot bind belowip_unprivileged_port_start, so the create dies before any workload exists — the dev loop is unavailable, not degraded. Given the estate is podman-first on workstations, this likely affects most users.Why not just tell people to fix sysctl
It needs root, it's a persistent host change, and it's invisible to anyone who didn't read the error. Poor trade for a dev loop.
Instead the runtime is detected and the ingress is published where it can bind — 8080/8443 under rootless podman, 80/443 everywhere else — with a warning naming the ports.
SHIM_SHELL_BASEfollows so porter-shim's links stay correct. The committedkind-cluster.yamlkeeps the canonical 80/443 shape; ports are substituted at create time, so one file serves both runtimes.A correction worth reading
My first commit's
sedused an end-of-line anchor (hostPort: 80$). The mappings are inline flow style, so it matched nothing and the cluster came up with the original privileged ports — the fix silently did nothing, which is worse than not shipping it. Second commit anchors on the precedingcontainerPortand verifies both pairs:[(80, 80), (443, 443)][(80, 8080), (443, 8443)]Context
Found while bringing the noetica-impair rig up on the continuum local PaaS. Other agents are active here, so this is deliberately on a branch and is one possible pattern, not the only one — a conditional config or a generator would serve equally. The property that matters is that a rootless-podman user can run
dev_up.shat all.