AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题

问题[deployment-manager](server)

Martin Hope
Carlos Rodriguez
Asked: 2021-07-14 01:05:49 +0800 CST

由于缺少 storage.buckets.get 访问权限,用于创建存储桶的 GCP 部署失败

  • 0

我想使用部署管理器以编程方式创建云存储桶,但部署失败并出现以下错误:

ERROR: (gcloud.deployment-manager.deployments.create) Error in Operation [operation-1626165906845-5c6fd413930ca-1a833b6c-81671664]: errors:
- code: RESOURCE_ERROR
  location: /deployments/example-config/resources/storage-bucket
  message: '{"ResourceType":"storage.v1.bucket","ResourceErrorCode":"403","ResourceErrorMessage":{"code":403,"errors":[{"domain":"global","message":"[email protected]
    does not have storage.buckets.get access to the Google Cloud Storage bucket.","reason":"forbidden"}],"message":"[email protected]
    does not have storage.buckets.get access to the Google Cloud Storage bucket.","statusMessage":"Forbidden","requestPath":"https://storage.googleapis.com/storage/v1/b/storage-bucket","httpMethod":"GET","suggestion":"Consider
    granting permissions to [email protected]"}}'

但是,我已添加roles/storage-admin到错误中提到的帐户,并根据策略疑难解答授予storage.buckets.getAPI 调用访问权限:

在此处输入图像描述

这是yaml我使用的文件:

imports:
  - path: template.jinja

resources:
  - name: template
    type: template.jinja
    properties:
      storage:
        bucket: qa-bucket-68586

这是jinja模板:

resources:
  - name: storage-bucket
    type: storage.v1.bucket
    properties:
      kind: storage#bucket
      name: {{ properties["storage"]["bucket"] }}
      location: EU
      projectNumber: {{ env["project_number"] }}
      storageClass: STANDARD
google-cloud-platform google-cloud-storage google-iam deployment-manager
  • 1 个回答
  • 307 Views
Martin Hope
Martijn Heemels
Asked: 2021-04-09 10:16:57 +0800 CST

使用 Deployment Manager 将 Workload Identity 服务帐户绑定到 GKE 服务帐户?

  • 0

我已经在我们的 GKE 集群上启用了 Workload Identity。现在我正在向 GKE 部署一个应用程序,它使用 WI 对另一个 Google 服务进行身份验证。我已经使用 Deployment Manager 创建了一个有权访问 Google 服务的 IAM 服务帐户。我还使用自己的 GKE 服务帐户将应用程序部署到集群。

最后,我需要将两种不同类型的服务帐户绑定在一起。这允许 Kubernetes 服务帐户充当 Google 服务帐户,从而允许 pod 访问云服务。

该文档使用gcloudCLI 工具添加策略绑定,如下所示:

gcloud iam service-accounts add-iam-policy-binding \
  --role roles/iam.workloadIdentityUser \
  --member "serviceAccount:PROJECT_ID.svc.id.goog[K8S_NAMESPACE/KSA_NAME]" \
  GSA_NAME@PROJECT_ID.iam.gserviceaccount.com

当然,我想通过 GCP 部署管理器(infra-as-code 和所有这些)来完成,但我无法弄清楚正确的 DM 语法!?

我通常通过gcp-types/cloudresourcemanager-v1:virtual.projects.iamMemberBinding类型进行角色绑定,就像在代码示例中一样,但我不知道如何复制上述gcloud命令,也找不到任何公共示例。请问谁能帮忙?

我认为以前actions会使用它们,但由于它们已被弃用,我宁愿不将它们用于新代码。iamMemberBinding似乎是推荐的方式。

google-cloud-platform kubernetes google-kubernetes-engine deployment-manager
  • 1 个回答
  • 154 Views
Martin Hope
solr
Asked: 2021-04-08 12:44:07 +0800 CST

GCP 部署管理器:在哪里可以找到正确创建 YAML 配置和模板文件的参考指南?

  • 0

我应客户的要求开始使用谷歌云部署管理器,使用 YAML 配置文件,但我在任何地方都找不到如何映射https://cloud.google.com/deployment-manager/docs/configuration中显示的参考/supported-resource-types我实际使用的。

特别是,我需要在创建时将现有的外部弹性 IP 附加到实例,但我无法在任何地方找到这样做的配置文件架构(即,就像在https://eksctl.xmleksctl找到的配置文件架构文档一样) io/用法/模式/):

resources:
- type: compute.v1.instance
  name: nextcloud-vm
  properties:
    natIP: nextcloud-vm
    # The properties of the resource depend on the type of resource. For a list
    # of properties, see the API reference for the resource.
    zone: us-west1-a
    # Replace martin-dev-391362 with your project ID
    machineType: https://www.googleapis.com/compute/v1/projects/martin-dev-391362/zones/us-west1-a/machineTypes/n2-standard-4
    disks:
    - deviceName: boot
      type: PERSISTENT
      boot: true
      autoDelete: true
      initializeParams:
        # See a full list of image families at https://cloud.google.com/compute/docs/images#os-compute-support
        # The format of the sourceImage URL is: https://www.googleapis.com/compute/v1/projects/[IMAGE_PROJECT]/global/images/family/[FAMILY_NAME]
        sourceImage: https://www.googleapis.com/compute/v1/projects/ubuntu-os-cloud/global/images/family/ubuntu-2004-lts
        diskSizeGb: 20
    # Replace martin-dev-391362 with your project ID
    networkInterfaces:
    - network: https://www.googleapis.com/compute/v1/projects/martin-dev-391362/global/networks/default
      # Access Config required to give the instance a public IP address
      accessConfigs:
      - name: nextcloud-vm
        type: ONE_TO_ONE_NAT

上面的代码不起作用,因为它尝试使用该名称创建一个新的 IP 地址,而不是使用已经存在的弹性 IP 地址。问题是我在任何地方都找不到正确的符号:)

如果有人能指出正确的方向,我将不胜感激,因为解决这个很小的问题只是冰山一角,因为我将与 Deployment Manager 进行大量工作,因此我需要全面了解如何使用它。

google-cloud-platform yaml deployment-manager
  • 1 个回答
  • 149 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve