Search code examples
kubernetesdeploymentgoogle-kubernetes-engine

Is there any way to find out the AD in which a pod is deployed?


  1. I have deployed a pod in K8 cluster.
  2. Now i wish to know the Availablity domain in which the Pod is deployed.
  3. I have not used any node affinity, can I find this out?

Solution

  • A Pod itself is scheduled on a Node. The Node is the actual (virtual) machine that is deployed into a special availability zone.

    The availability zone of a node can usually be read from the labels topology.kubernetes.io/zone (new), or failure-domain.beta.kubernetes.io/zone (old)

    So to find out in which availability zone your pod is, you'll have to find out on which node it was scheduled and then check that node for those labels.

    You can do it like this:

    kubectl get node -o wide
    

    Copy the name of the node and then paste it into the following command:

    kubectl describe node <node-name>
    

    Under the section labels, you can then check for the labels described above to find out in which availability zone the node lives and hence - where your pod was scheduled.