Is it possible for an app running inside a pod to get details/metadata about its own pod. I know this can be easily achieved using downwardAPI or env variables.
Is there a third way?
I want to find out the service account and namespace of the pod without using either of these approaches. Is it possible?
Any particular reason to decouple container details ? Bear in mind that the downward api is intended to get details such as service account. Now, responding to your question i envision two possible ways to achieve your objective, kubectl and API Server. I elaborated on the kubectl approach:
Kubernetes client (kubectl)
Following is a sample output:
Following is a sample output, notice the annotations section:
Theres a complete document here