You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 5, 2021. It is now read-only.
Repository navigation
This repository was archived by the owner on Nov 5, 2021. It is now read-only.
Socket: permission denied when run in Kubernetes #663
@nadenf Good question! Sending ICMP packets requires special privileges on any host. ping program on Linux machines gets around this requirement either by using setuid (so that process opens socket with root privileges), or by setting the cap_net_raw capability on the process, e.g.
getcap /bin/ping
/bin/ping cap_net_raw=ep
On a typical Linux machine:
You could run cloudprober as root or give it cap_net_raw capability to avoid this error (you will need to set use_datagram_socket: false in your config), or you could run the following command to give your user's group ability to open ping sockets: sudo sysctl -w net.ipv4.ping_group_range="0 <large valid group id>"
Activity
manugarg commentedon Sep 16, 2021
@nadenf Good question! Sending ICMP packets requires special privileges on any host.
pingprogram on Linux machines gets around this requirement either by using setuid (so that process opens socket with root privileges), or by setting the cap_net_raw capability on the process, e.g.On a typical Linux machine:
You could run cloudprober as root or give it cap_net_raw capability to avoid this error (you will need to set
use_datagram_socket: falsein your config), or you could run the following command to give your user's group ability to open ping sockets:sudo sysctl -w net.ipv4.ping_group_range="0 <large valid group id>"See the following for more details on this:
cloudprober/probes/ping/proto/config.proto
Line 18 in be17d75
In Kubernetes environment, you'll need to add a
securityContextto your pod config, to run the sysctl command above, for example:Another option is to give your container NET_RAW capability, like this (you'll need to set
use_datagram_socket: falsein your cloudprober config) :Doing one of these should resolve your issue.
manugarg commentedon Sep 17, 2021
Changing the label to question. I'll document it somewhere before closing it.