启用 Binary Authorization 服务

本页面介绍如何在部署者项目中启用 Binary Authorization。

首先,您需要创建或选择一个项目。您可以在部署容器的 Google Cloud 项目中启用 Binary Authorization。该项目就是您在其中运行 支持的平台(例如 Google Kubernetes Engine [GKE]、Cloud Run 或 Google Distributed Cloud)的项目。

如需启用 Binary Authorization,请按以下步骤操作:

  1. In the Google Cloud console, on the project selector page, select or create a Google Cloud project.

    Roles required to select or create a project

    • Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
    • Create a project: To create a project, you need the Project Creator role (roles/resourcemanager.projectCreator), which contains the resourcemanager.projects.create permission. Learn how to grant roles.

    Go to project selector

  2. Verify that billing is enabled for your Google Cloud project.

  3. Enable the Binary Authorization API.

    Roles required to enable APIs

    To enable APIs, you need the serviceusage.services.enable permission. If you created the project, then you likely already have this permission through the Owner role (roles/owner). Otherwise, you can get this permission through the Service Usage Admin role (roles/serviceusage.serviceUsageAdmin). Learn how to grant roles.

    Enable the API

  4. 安装 Google Cloud CLI。

  5. 配置 gcloud CLI 以使用您的联合身份。

    如需了解详情,请参阅使用联合身份登录 gcloud CLI

  6. 如需初始化 gcloud CLI,请运行以下命令:

    gcloud init

已启用 Binary Authorization。您现在可以使用容器管理平台对其进行设置。

后续步骤