GithubHelp home page GithubHelp logo

Comments (2)

manugarg avatar manugarg commented on May 23, 2024

@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 details on this:

// Use datagram socket for ICMP.
.

In Kubernetes environment, you'll need to add a securityContext to your pod config, to run the sysctl command above, for example:

apiVersion: ..
kind: Pod
metadata:
  name: cloudprober-with-sysctl
spec:
  securityContext:
    sysctls:
    - name: net.ipv4.ping_group_range
      value: "0 5000"
  ...

Another option is to give your container NET_RAW capability, like this (you'll need to set use_datagram_socket: false in your cloudprober config) :

apiVersion: ...
kind: Pod
metadata:
  name: cloudprober-with-net-cap-raw
spec:
  containers:
  - name: cloudprober
    image: cloudprober/cloudprober
    securityContext:
      capabilities:
        add: ["NET_RAW"]
...

Doing one of these should resolve your issue.

from cloudprober.

manugarg avatar manugarg commented on May 23, 2024

Changing the label to question. I'll document it somewhere before closing it.

from cloudprober.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.