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/bashAnd 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