One of the Google Kubernetes Engine (GKE) clusters ($GKE_CLUSTER
) within a Google Cloud Platform (GCP) project ($GCP_PROJECT
) seems to be unable to pull
Docker Images from Google Container Registry (GCR):
kubectl config current-context
#=>
$GKE_CLUSTER
and:
kubectl get pods --namespace=$NAMESPACE
#=>
NAME READY STATUS RESTARTS AGE
. . . . . . . . . . . . . . .
$SOME_POD 0/1 ImagePullBackOff 0 1m
. . . . . . . . . . . . . . .
and:
kubectl get events \
--field-selector involvedObject.name=$SOME_POD \
--namespace=$NAMESPACE
#=>
LAST SEEN TYPE REASON OBJECT MESSAGE
. . . . . . . . . . . . . . .
1m Normal BackOff pod/$SOME_POD Back-off pulling image "$SOME_IMAGE"
. . . . . . . . . . . . . . .
Where:
$SOME_POD
is of the form:deployment-replicaSet-pod
$SOME_IMAGE
is of the form:us.gcr.io/$GCP_PROJECT/name:tag
Listing only service accounts for $GCP_PROJECT
gives:
gcloud projects get-iam-policy $GCP_PROJECT \
--filter="serviceAccount" \
--flatten="bindings[].members" \
--format="value(bindings.members.split(':').slice(1:).flatten())"
#=>
[email protected]
[email protected]
[email protected]
[email protected]
service-XXXXXXXXXXXX@container-engine-robot.iam.gserviceaccount.com
[email protected]
[email protected]
[email protected]
[email protected]
Which of these service accounts is GKE using to access Docker Images hosted by GCR?