From 91317bcceecf67e9c4cbbc7914da52aba2119753 Mon Sep 17 00:00:00 2001 From: Carlos Panato Date: Mon, 10 May 2021 10:35:20 +0200 Subject: [PATCH] capg: enable compute api for CAPG to build the node images --- .../prow-build/resources/build-serviceaccounts.yaml | 8 ++++++++ infra/gcp/ensure-staging-storage.sh | 10 ++++++++++ 2 files changed, 18 insertions(+) diff --git a/infra/gcp/clusters/projects/k8s-infra-prow-build/prow-build/resources/build-serviceaccounts.yaml b/infra/gcp/clusters/projects/k8s-infra-prow-build/prow-build/resources/build-serviceaccounts.yaml index 688b2c532139..da613b323e95 100644 --- a/infra/gcp/clusters/projects/k8s-infra-prow-build/prow-build/resources/build-serviceaccounts.yaml +++ b/infra/gcp/clusters/projects/k8s-infra-prow-build/prow-build/resources/build-serviceaccounts.yaml @@ -14,3 +14,11 @@ metadata: iam.gke.io/gcp-service-account: gcb-builder-releng-test@k8s-staging-releng-test.iam.gserviceaccount.com name: gcb-builder-releng-test namespace: test-pods +--- +kind: ServiceAccount +apiVersion: v1 +metadata: + annotations: + iam.gke.io/gcp-service-account: gcb-builder-cluster-api-gcp@k8s-staging-cluster-api-gcp.iam.gserviceaccount.com + name: gcb-builder-cluster-api-gcp + namespace: test-pods diff --git a/infra/gcp/ensure-staging-storage.sh b/infra/gcp/ensure-staging-storage.sh index fa060855f7b3..af3ea4ac1be9 100755 --- a/infra/gcp/ensure-staging-storage.sh +++ b/infra/gcp/ensure-staging-storage.sh @@ -311,3 +311,13 @@ color 6 "Configuring special case for k8s-staging-releng-test" ( ensure_staging_gcb_builder_service_account "releng-test" "k8s-infra-prow-build" ) + +# Special case: In order to build the node images using image-builder it needs +# the compute api to be enabled because it will create a VM +# to build the node image. +color 6 "Configuring special case for k8s-staging-cluster-api-gcp" +( + readonly STAGING_PROJECT="k8s-staging-cluster-api-gcp" + enable_api "${STAGING_PROJECT}" compute.googleapis.com + ensure_staging_gcb_builder_service_account "cluster-api-gcp" "k8s-infra-prow-build-trusted" +)