POD with Tools

Sundar Pasupathy 21 Reputation points
2021-12-14T18:50:32.337+00:00

Do we have any PODS available with all standard tools installed?

If we want to check dns resolution from POD , or check connectivity or use other standard command line tools we normally use from Linux OX command line, How do we do it? I wish we have a POD with all the standard tools and gets installed as part of every cluster

This may be a dumb question- Please forgive me. :)

Azure Kubernetes Service
Azure Kubernetes Service
An Azure service that provides serverless Kubernetes, an integrated continuous integration and continuous delivery experience, and enterprise-grade security and governance.
2,447 questions
Community Center Not monitored
0 comments No comments
{count} votes

Accepted answer
  1. SRIJIT-BOSE-MSFT 4,346 Reputation points Microsoft Employee
    2021-12-16T08:03:26.423+00:00

    @Sundar Pasupathy , thank you for your question.

    While the ask is definitely understandable, the standard of utilities/command-line tools is very subjective when it comes to open source technologies (like Linux), varying across the needs of different use cases and different degrees of security concerns. Also different Linux distributions have different utilities to handle the same objective and not every user might be well versed with a particular distribution.

    So ultimately, the responsibility of creating a reasonably secure container image with all required utilities lies with the user of the Kubernetes cluster.

    For instance, you can set up your own Ubuntu debugging image as follows:

    1. Create a file ./Dockerfile. [Dockerfile reference]: FROM library/centos:7
      RUN yum update -y
      RUN yum install nmap git net-tools iproute -y # You can install more tools if you want to CMD ["bash"]
    2. Build the container image: docker build -t <RegistryName>/<RepositoryName>:<tag> .
    3. Login to the Container Registry: docker login <registry-server>
    4. Push the container image: docker push <RegistryName>/<RepositoryName>:<tag>

    From AKS v1.23 one can expect to be able to use ephemeral containers with Pods on-demand.

    Pods are the fundamental building block of Kubernetes applications. Since Pods are intended to be disposable and replaceable, you cannot add a container to a Pod once it has been created. Instead, you usually delete and replace Pods in a controlled fashion using deployments.

    Sometimes it's necessary to inspect the state of an existing Pod, however, for example to troubleshoot a hard-to-reproduce bug. In these cases you can run an ephemeral container in an existing Pod to inspect its state and run arbitrary commands. [Reference]

    Debugging with an ephemeral debug container

    FEATURE STATE: Kubernetes v1.23 [beta]

    Ephemeral containers (a container that you can run temporarily inside a Pod) are useful for interactive troubleshooting when kubectl exec is insufficient because a container has crashed or a container image doesn't include debugging utilities, such as with distroless images.

    For examples please check here. You can also run kubectl debug --help.


    Hope this helps.

    Please "Accept as Answer" if it helped, so that it can help others in the community looking for help on similar topics.

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Sundar Pasupathy 21 Reputation points
    2021-12-20T05:52:56.973+00:00

    Thanks much for the details . This will help us to carve a story for doing additional analysis in our Cloud migration sprint

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.