代码之家  ›  专栏  ›  技术社区  ›  dippynark

我需要为GKE节点池配置什么最小权限才能从同一项目中的私有GCR repo中提取?

  •  5
  • dippynark  · 技术社区  · 6 年前

    least privilege service account 并为其提供了 roles/storage.objectViewer

    但是,在尝试访问此图像时,我仍收到以下消息: Failed to pull image "eu.gcr.io/<project>/<image>": rpc error: code = Unknown desc = Error response from daemon: unauthorized: You don't have the needed permissions to perform this operation, and you may have invalid credentials. To authenticate your request, follow the steps in: https://cloud.google.com/container-registry/docs/advanced-authentication

    我还需要配置吗 imagePullSecrets 角色/storage.objectViewer 允许就足够了吗?

    1 回复  |  直到 6 年前
        1
  •  10
  •   Community CDub    4 年前

    此问题的根本原因是没有在群集实例上设置访问(OAuth)作用域,从而阻止服务帐户按预期工作。

    Compute service accounts :

    必须在实例上设置访问作用域才能授权访问。

    here here . 然后可以按照说明为集群节点创建一个最小特权服务帐户 here .

    如前所述 here 另一种选择是只授予 https://www.googleapis.com/auth/cloud-platform

    通过如上所述配置集群节点, imagePullSecrets 从同一项目中的GCR中提取私有映像时不需要。