Skip to content
This repository has been archived by the owner on Nov 5, 2021. It is now read-only.

Socket: permission denied when run in Kubernetes #665

Answered by manugarg
nadenf asked this question in Q&A
Discussion options

You must be logged in to vote

@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>"

See the following for more…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by manugarg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
2 participants
Converted from issue

This discussion was converted from issue #663 on October 05, 2021 03:55.