Skip to content

Instantly share code, notes, and snippets.

@lirlia
Created February 13, 2022 17:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lirlia/93889f0f57a8f8c1326c711a307829a7 to your computer and use it in GitHub Desktop.
Save lirlia/93889f0f57a8f8c1326c711a307829a7 to your computer and use it in GitHub Desktop.
apiVersion: v1
kind: Pod
metadata:
name: pod-without-sa
namespace: default
spec:
containers:
- image: gcr.io/google.com/cloudsdktool/cloud-sdk:slim
name: pod-without-sa
stdin: true
tty: true
---
apiVersion: v1
kind: Pod
metadata:
name: pod-with-sa
namespace: default
spec:
serviceAccountName: mypodserviceaccount
containers:
- image: gcr.io/google.com/cloudsdktool/cloud-sdk:slim
name: pod-with-sa
stdin: true
tty: true
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: mypodserviceaccount
namespace: default
annotations:
iam.gke.io/gcp-service-account: gke-workload@PROJECT_ID.iam.gserviceaccount.com
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment