<p>I want to find the region and node of my node, I need this to log monitoring data.
kubernetes spec and metadata doesn't provide this information. I checked out
<a href="https://github.com/kubernetes/client-go" rel="nofollow noreferrer">https://github.com/kubernetes/client-go</a> which looks promising but I can't find
the info I am looking for.</p>
<p>Any suggestion? Thanks</p>

RandomQuests
<p>This is what I ended up doing.</p>
<ul>
<li>Enabled <a href="https://cloud.google.com/kubernetes-engine/docs/how-to/workload-identity" rel="nofollow noreferrer">Workload Identity</a></li>
</ul>
<pre><code>gcloud container clusters update &lt;CLUSTER_NAME&gt; \
  --workload-pool=&lt;PROJECT_ID&gt;.svc.id.goog
</code></pre>
<ul>
<li>Updated Node pool to use workload identity</li>
</ul>
<pre><code>gcloud container node-pools update &lt;NODEPOOL_NAME&gt; \
  --cluster=&lt;CLUSTER_NAME&gt; \
  --workload-metadata=&lt;GKE_METADATA&gt;
</code></pre>
<ul>
<li>Created a service account for my app</li>
<li>bind my KSA to GSA</li>
</ul>
<pre><code>gcloud iam service-accounts add-iam-policy-binding \
  --role roles/iam.workloadIdentityUser \
  --member &quot;serviceAccount:&lt;PROJECT_ID&gt;.svc.id.goog[&lt;K8S_NAMESPACE&gt;/&lt;KSA_NAME]&quot; \
  &lt;GSA_NAME&gt;@&lt;PROJECT_ID&gt;.iam.gserviceaccount.com
</code></pre>
<ul>
<li>Annotated service account using the email address of the GSA</li>
</ul>
<pre><code>apiVersion: v1
kind: ServiceAccount
metadata:
  annotations:
    iam.gke.io/gcp-service-account: &lt;GSA_NAME&gt;@&lt;PROJECT_ID&gt;.iam.gserviceaccount.com
  name: KSA_NAME
  namespace: &lt;K8S_NAMESPACE&gt;
</code></pre>
<p>This authenticated by container with GSA and I was able to get the metadata info using <a href="https://cloud.google.com/compute/docs/storing-retrieving-metadata" rel="nofollow noreferrer">https://cloud.google.com/compute/docs/storing-retrieving-metadata</a></p>
