microk8s icon indicating copy to clipboard operation
microk8s copied to clipboard

Can not run ping with non-root user in a pod of the microk8s

Open xunavy opened this issue 6 months ago • 0 comments

Summary

I have a linux machine with microk8s installed, and then I have an application docker image enable microdnf install -y shadow-utils procps iputils &&, But when I go into docker image and ping www.google.com, nothing returns Here the user with below info: uid=20001(abc)gid=20001(syn) groups=20001(syn) bash-5.1$ ping ping: usage error: Destination address required bash-5.1$ ping www.google.com

but I use the busybox container with root user,we can ping successully. microk8s kubectl run -i --tty busybox --image=busybox --restart=Never -- sh

What Should Happen Instead?

Reproduction Steps

  1. ... uid=20001(abc)gid=20001(syn) groups=20001(syn) bash-5.1$ ping ping: usage error: Destination address required bash-5.1$ ping www.google.com
  2. ... microk8s kubectl run -i --tty busybox --image=busybox --restart=Never -- sh If you don't see a command prompt, try pressing enter. / # / # / # ping www.baidu.com PING www.baidu.com (103.235.47.188): 56 data bytes 64 bytes from 103.235.47.188: seq=0 ttl=42 time=240.718 ms 64 bytes from 103.235.47.188: seq=1 ttl=42 time=252.253 ms ^C --- www.baidu.com ping statistics --- 3 packets transmitted, 2 packets received, 33% packet loss round-trip min/avg/max = 240.718/246.485/252.253 ms

Introspection Report

microk8s.inspect Inspecting system Inspecting Certificates Inspecting services Service snap.microk8s.daemon-cluster-agent is running Service snap.microk8s.daemon-containerd is running Service snap.microk8s.daemon-kubelite is running Service snap.microk8s.daemon-k8s-dqlite is running Service snap.microk8s.daemon-apiserver-kicker is running Copy service arguments to the final report tarball Inspecting AppArmor configuration Gathering system information Copy processes list to the final report tarball Copy disk usage information to the final report tarball Copy memory usage information to the final report tarball Copy server uptime to the final report tarball Copy openSSL information to the final report tarball Copy snap list to the final report tarball Copy VM name (or none) to the final report tarball Copy current linux distribution to the final report tarball Copy network configuration to the final report tarball Inspecting kubernetes cluster Inspect kubernetes cluster Inspecting dqlite Inspect dqlite

which: no dockerd in (/sbin:/bin:/usr/sbin:/usr/bin)

Can you suggest a fix?

Are you interested in contributing with a fix?

no

xunavy avatar Jul 25 '24 03:07 xunavy