GKE - ErrImagePull pulling from Google Container Registry

后端 未结 5 569
予麋鹿
予麋鹿 2020-12-11 23:18

I have a Google Kubernetes Engine cluster which until recently was happily pulling private container images from a Google Container Registry bucket. I haven\'t changed anyth

5条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-12 00:04

    I got the same issue when I created a cluster with terraform. Firstly, I only specified service_account in node_config so node pool was made with too small OAuth scopes. Explicitly write both service_account and oauth_scope like below, nodes are able to pull images from private GCR repositories.

    resource "google_container_node_pool" "primary_preemptible_nodes" {
      node_config {
        service_account = "${google_service_account.gke_nodes.email}"
    
        oauth_scopes = [
          "storage-ro",
          "logging-write",
          "monitoring"
        ]
      }
    }
    

提交回复
热议问题