I have created a GKE Service Account.
I have been trying to use it within GKE, but I get the error:
pods "servicepod" is forbidden: error looking up service account service/serviceaccount: serviceaccount "serviceaccount" not found
I have followed the setup guide in this documentation.
1.Created a GCP Service Account called "serviceaccount"
2.I created, and downloaded the JSON key as key.json.
3.kubectl create secret generic serviceaccountkey --from-file key.json -n service
4.Added the following items to my deployment:
spec:
volumes:
- name: serviceaccountkey
secret:
secretName: serviceaccountkey
containers:
volumeMounts:
- name: serviceaccountkey
mountPath: /var/secrets/google
env:
- name: GOOGLE_APPLICATION_CREDENTIALS
value: /var/secrets/google/key.json
When I deploy this out, I get:
pods "service-7cdbcc67b9-" is forbidden: error looking up service account service/serviceaccount: serviceaccount "serviceaccount" not found
I'm not sure what else to do to get this working, I've followed the guide and can't see anything that's been missed.
Any help on this would be greatly appreciated!