Nginx ingress controller at kubernetes not allowing installation of some package

10/9/2019

I am looking to execute

apt install tcpdump

but facing permission denial, upon looking to set the directory to root, it is asking me for password and I don't know from where to get that password.

I installed nginx helm chart from stable/nginx repository with no RBAC

Please see snapshot for details on error, while I tried installing tcpdump in the pod after doing ssh into it.enter image description here

-- Tushar Mahajan
kubernetes
nginx-ingress

1 Answer

10/10/2019

In Using GDB with Nginx, you can find troubleshooting section:

Shortly:

  • find the node where your pod is running (kubectl get pods -o wide)
  • ssh into the node
  • find the docker_ID for this image (docker ps | grep pod_name)
  • run docker exec -it --user=0 --privileged docker_ID bash

Note: Runtime privilege and Linux capabilities

When the operator executes docker run --privileged, Docker will enable access to all devices on the host as well as set some configuration in AppArmor or SELinux to allow the container nearly all the same access to the host as processes running outside containers on the host. Additional information about running with --privileged is available on the Docker Blog.

Additional resources:

Hope this help.

-- Hanx
Source: StackOverflow