gke - good way to spin up a pod and test workload identity

 

First create a pod under that namespace that you would like to test. Here we are using test namespace and service account sa. 


apiVersion: v1
kind: Pod
metadata:
  name: test-pod
  namespace: test
spec:
  serviceAccountName: sa
  containers:
  - name: test-pod
    image: google/cloud-sdk:slim
    command: ["sleep","infinity"]
    resources:
      requests:
        cpu: 500m
        memory: 512Mi
        ephemeral-storage: 10Mi

Next, we will 

kubectl exec -it pods/test-pod --namespace=test -- /bin/bash

And then run the following command

curl -X GET -H "Authorization: Bearer $(gcloud auth print-access-token)" "https://storage.googleapis.com/storage/v1/b/jerwotestbuckety/o"

Comments

Popular posts from this blog

gemini cli getting file not defined error

NodeJS: Error: spawn EINVAL in window for node version 20.20 and 18.20

vllm : Failed to infer device type