이 페이지에서는 Binary Authorization에 현재 프로젝트와 다른 Google Cloud 프로젝트에 있는 정책 및 컨테이너 이미지에 액세스할 수 있는 권한을 부여하는 방법을 보여줍니다.
예를 들어 다른 프로젝트가 소유한 Artifact Registry 또는 Container Registry(지원 중단됨)저장소에서 Google Kubernetes Engine(GKE) 클러스터에 이미지를 배포하는 경우 프로젝트의 Binary Authorization 서비스에 소스 저장소의 이미지 메타데이터에 액세스할 수 있는 권한을 부여해야 합니다.
용어
이 문서에서는 다음 용어가 사용됩니다.
서비스 에이전트: Google Cloud관리형 서비스 계정입니다.
Binary Authorization은 서비스 에이전트를 사용하여 GKE 클러스터와 같은 Google Cloud리소스와 상호작용합니다.
정책 프로젝트: Binary Authorization 정책이 포함된 Google Cloud 프로젝트입니다.
클러스터 프로젝트: GKE 클러스터가 포함된 Google Cloud 프로젝트입니다.
아티팩트 프로젝트: Artifact Registry 또는 Container Registry(지원 중단됨) 저장소가 포함된 Google Cloud 프로젝트입니다.
프로젝트 간 액세스가 필요한 시나리오
다음과 같은 상황에서는 프로젝트 간 권한을 부여해야 합니다.
정책 프로젝트가 클러스터 프로젝트와 다릅니다.
클러스터 프로젝트가 아티팩트 프로젝트와 다릅니다.
시작하기 전에
Sign in to your Google Cloud account. If you're new to
Google Cloud,
create an account to evaluate how our products perform in
real-world scenarios. New customers also get $300 in free credits to
run, test, and deploy workloads.
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["이해하기 어려움","hardToUnderstand","thumb-down"],["잘못된 정보 또는 샘플 코드","incorrectInformationOrSampleCode","thumb-down"],["필요한 정보/샘플이 없음","missingTheInformationSamplesINeed","thumb-down"],["번역 문제","translationIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-09-04(UTC)"],[[["\u003cp\u003eThis document guides users on granting Binary Authorization access across different Google Cloud projects for policies and container images.\u003c/p\u003e\n"],["\u003cp\u003eCross-project access is required when the policy project, cluster project, and artifact project are not the same.\u003c/p\u003e\n"],["\u003cp\u003eThe Binary Authorization service agent in the cluster project needs the \u003ccode\u003eroles/binaryauthorization.policyEvaluator\u003c/code\u003e role on the policy project.\u003c/p\u003e\n"],["\u003cp\u003eThe Binary Authorization service agent in the cluster project needs the \u003ccode\u003eroles/artifactregistry.reader\u003c/code\u003e role on the artifact project.\u003c/p\u003e\n"],["\u003cp\u003eIf using Container Registry, the \u003ccode\u003eroles/storage.objectViewer\u003c/code\u003e role can be used instead, but migrating to Artifact Registry is recommended because Container Registry is deprecated.\u003c/p\u003e\n"]]],[],null,["# Configure cross-project access in GKE\n\nThis page shows you how to give Binary Authorization access to policies and container\nimages that exist in different Google Cloud projects than your current project.\nFor example, if you deploy images in your Google Kubernetes Engine (GKE) cluster\nfrom an Artifact Registry or Container Registry ([Deprecated](/container-registry/docs/deprecations/container-registry-deprecation))\nrepository that's owned by a different project, you'll need to give the\nBinary Authorization service in your project access to the image metadata in\nthe source repository.\n\nTerminology\n-----------\n\nThis document uses the following terms:\n\n- **Service agent:**A Google Cloud-managed service account. Binary Authorization uses a service agent to interact with your Google Cloud resources, like GKE clusters.\n- **Policy project:**The Google Cloud project that contains your Binary Authorization policy.\n- **Cluster project:**The Google Cloud project that contains your GKE cluster.\n- **Artifact project:** The Google Cloud project that contains your Artifact Registry or Container Registry ([Deprecated](/container-registry/docs/deprecations/container-registry-deprecation)) repository.\n\nScenarios that require cross-project access\n-------------------------------------------\n\nYou must grant cross-project permissions in situations like the following:\n\n- Your policy project is different than your cluster project.\n- Your cluster project is different than your artifact project.\n\nBefore you begin\n----------------\n\n- Sign in to your Google Cloud account. If you're new to Google Cloud, [create an account](https://console.cloud.google.com/freetrial) to evaluate how our products perform in real-world scenarios. New customers also get $300 in free credits to run, test, and deploy workloads.\n-\n [Install](/sdk/docs/install) the Google Cloud CLI.\n\n | **Note:** If you installed the gcloud CLI previously, make sure you have the latest version by running `gcloud components update`.\n- If you're using an external identity provider (IdP), you must first\n [sign in to the gcloud CLI with your federated identity](/iam/docs/workforce-log-in-gcloud).\n\n-\n To [initialize](/sdk/docs/initializing) the gcloud CLI, run the following command:\n\n ```bash\n gcloud init\n ```\n- [Create or select a Google Cloud project](https://cloud.google.com/resource-manager/docs/creating-managing-projects).\n\n | **Note**: If you don't plan to keep the resources that you create in this procedure, create a project instead of selecting an existing project. After you finish these steps, you can delete the project, removing all resources associated with the project.\n - Create a Google Cloud project:\n\n ```\n gcloud projects create PROJECT_ID\n ```\n\n Replace \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e with a name for the Google Cloud project you are creating.\n - Select the Google Cloud project that you created:\n\n ```\n gcloud config set project PROJECT_ID\n ```\n\n Replace \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e with your Google Cloud project name.\n-\n [Verify that billing is enabled for your Google Cloud project](/billing/docs/how-to/verify-billing-enabled#confirm_billing_is_enabled_on_a_project).\n\n-\n\n\n Enable the Binary Authorization API:\n\n\n ```bash\n gcloud services enable binaryauthorization.googleapis.com\n ```\n\n-\n [Install](/sdk/docs/install) the Google Cloud CLI.\n\n | **Note:** If you installed the gcloud CLI previously, make sure you have the latest version by running `gcloud components update`.\n- If you're using an external identity provider (IdP), you must first\n [sign in to the gcloud CLI with your federated identity](/iam/docs/workforce-log-in-gcloud).\n\n-\n To [initialize](/sdk/docs/initializing) the gcloud CLI, run the following command:\n\n ```bash\n gcloud init\n ```\n- [Create or select a Google Cloud project](https://cloud.google.com/resource-manager/docs/creating-managing-projects).\n\n | **Note**: If you don't plan to keep the resources that you create in this procedure, create a project instead of selecting an existing project. After you finish these steps, you can delete the project, removing all resources associated with the project.\n - Create a Google Cloud project:\n\n ```\n gcloud projects create PROJECT_ID\n ```\n\n Replace \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e with a name for the Google Cloud project you are creating.\n - Select the Google Cloud project that you created:\n\n ```\n gcloud config set project PROJECT_ID\n ```\n\n Replace \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e with your Google Cloud project name.\n-\n [Verify that billing is enabled for your Google Cloud project](/billing/docs/how-to/verify-billing-enabled#confirm_billing_is_enabled_on_a_project).\n\n-\n\n\n Enable the Binary Authorization API:\n\n\n ```bash\n gcloud services enable binaryauthorization.googleapis.com\n ```\n\n\u003cbr /\u003e\n\nCluster project different than the policy project\n-------------------------------------------------\n\nGrant the Binary Authorization service agent in the cluster project the\n[Binary Authorization Policy Evaluator](/iam/docs/understanding-roles#binaryauthorization.policyEvaluator)\n(`roles/binaryauthorization.policyEvaluator`)\nrole on the policy project. \n\n gcloud projects add-iam-policy-binding \u003cvar translate=\"no\"\u003ePOLICY_PROJECT_ID\u003c/var\u003e \\\n --member=\"serviceAccount:service-$(gcloud projects describe \u003cvar translate=\"no\"\u003eCLUSTER_PROJECT_ID\u003c/var\u003e --format='value(projectNumber)')@gcp-sa-binaryauthorization.iam.gserviceaccount.com\" \\\n --role=roles/binaryauthorization.policyEvaluator\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003ePOLICY_PROJECT_ID\u003c/var\u003e: the ID of the project that contains your policy.\n- \u003cvar translate=\"no\"\u003eCLUSTER_PROJECT_ID\u003c/var\u003e: the project ID of the cluster.\n\n\u003cbr /\u003e\n\nCluster project different than the artifact project\n---------------------------------------------------\n\nGrant the Binary Authorization service agent in the cluster project the\n[Artifact Registry Reader](/iam/docs/understanding-roles#artifactregistry.reader)\n(`roles/artifactregistry.reader`) role on the artifact project. \n\n gcloud projects add-iam-policy-binding \u003cvar translate=\"no\"\u003eARTIFACT_PROJECT_ID\u003c/var\u003e \\\n --member=\"serviceAccount:service-$(gcloud projects describe \u003cvar translate=\"no\"\u003eCLUSTER_PROJECT_ID\u003c/var\u003e --format='value(projectNumber)')@gcp-sa-binaryauthorization.iam.gserviceaccount.com\" \\\n --role=roles/artifactregistry.reader\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003eARTIFACT_PROJECT_ID\u003c/var\u003e: the ID of the project that contains your Artifact Registry repository. **Note:** If you use Container Registry, you can use the [Storage Object Viewer](/iam/docs/understanding-roles#storage.objectViewer) (`roles/storage.objectViewer`) role, but we recommend that you migrate to Artifact Registry. Container Registry is deprecated. For migration instructions, see [Transition from Container Registry](/artifact-registry/docs/transition/transition-from-gcr).\n- \u003cvar translate=\"no\"\u003eCLUSTER_PROJECT_ID\u003c/var\u003e: the project ID that runs your GKE clusters.\n\n\u003cbr /\u003e"]]