[Python] How read a file from a pod in Azure Kubernetes Service (AKS) in a Pythonic way?

Discussão em 'Python' iniciado por Stack, Março 6, 2025.

  1. Stack

    Stack Membro Participativo

    I have a requirement to read a file which is located inside a particular folder in a pod in AKS.

    My manual flow would be to:

    1. exec into the pod with kubectl.
    2. cd to the directory where the file is located.
    3. cat the file to see it's contents.

    I want to automate all this purely using python. I am able to do it with subprocess but that would work only on a machine which has azure and kubectl setup.

    Thus, I am looking for a purely pythonic way of doing this. I have looked into the Kubernetes client for Python but I am not able to find a way to do everything which I listed above.

    Continue reading...

Compartilhe esta Página