Skip to content

fix(health): ping storage nodes without sudo - #1702

Merged
mxsrc merged 1 commit into
mainfrom
sudoless-ping
Nov 23, 2026
Merged

mxsrc merged 1 commit into
mainfrom
sudoless-ping

Conversation

@mxsrc

@mxsrc mxsrc commented Nov 23, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

ping_host ran sudo ping. On OpenShift's restricted-v2 SCC the control plane pods run as a random UID with privilege escalation off, so sudo fails and the storage node monitor reports every node unreachable (simplyblock-operator#954 worked around this by granting anyuid).

This drops sudo. The operator sets net.ipv4.ping_group_range=0 2147483647 on the control plane pods (simplyblock/simplyblock-operator#960), which lets any group open ICMP and ICMPv6 echo sockets. Despite its name, the sysctl governs IPv6 echo sockets too.

This is to address simplyblock/simplyblock-operator#946 by removing the sudo ping invokation altogether.

Merge order

Merge the operator PR first. This image on an operator without the sysctl cannot ping: UBI10's ping has neither setuid nor file capabilities.

Docker swarm

Swarm services run on the host network as simplyblock, so the host's net.ipv4.ping_group_range must include that user's group. Most systemd distributions default it to 0 2147483647. Hosts that do not need the sysctl set before upgrading.

Testing

  • tests/unit/test_node_reachability.py::test_ping_host_runs_ping_without_sudo, red before the change, green after. Full unit suite passes.
  • UBI10 container as UID 5000: ping -4 and ping -6 fail with "missing cap_net_raw+p capability or setuid?" by default and succeed with the sysctl set.

The control plane's pods on Kubernetes may run as a random UID with
privilege escalation off (OpenShift restricted-v2), where sudo fails and
every node is reported unreachable. The operator now sets
net.ipv4.ping_group_range on those pods, which lets any group open ICMP
and ICMPv6 echo sockets, so ping runs without sudo.
@mxsrc

mxsrc commented Nov 23, 2026

Copy link
Copy Markdown
Collaborator Author

Note that this does depend on a sysctl that's set in recent k8s and docker runtimes implicitly. Operator PR #960 sets it explicitly for documentation and backwards compatibility. On legacy docker, it's a host setting though. I've set this on all lab hosts to ensure we maintain compatiblity until docker deployments are phased out.

@mxsrc
mxsrc requested a review from boddumanohar November 23, 2026 11:36
@mxsrc
mxsrc merged commit 4e9022d into main Nov 23, 2026
24 checks passed
@mxsrc
mxsrc deleted the sudoless-ping branch November 23, 2026 14:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

target/main Targets the development branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants