Skip to content

Commit 6a6b0b0

Browse files
authored
Merge pull request #8612 from upodroid/scale-patch
create the scale-cache-puller in the prow-build project
2 parents d6a6ae3 + 868c394 commit 6a6b0b0

File tree

2 files changed

+55
-0
lines changed

2 files changed

+55
-0
lines changed
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
/*
2+
Copyright 2021 The Kubernetes Authors.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
// The 5k scale projects require a service account that can pull from a dedicated AR registry in the 5k project
18+
// However, the account must be created in the prow-build project to avoid boskos deleting the keys and the account on cleanup.
19+
// Service Accounts don't supports labels yet, if it did we could tell boskos to skip the account based on the labels
20+
21+
resource "google_service_account" "scale_cache" {
22+
account_id = "scale-cache-puller"
23+
display_name = "Scale Test Cache Puller"
24+
project = module.project.project_id
25+
}
26+
27+
resource "google_service_account_key" "scale_cache" {
28+
service_account_id = google_service_account.scale_cache.id
29+
}
30+
31+
resource "google_secret_manager_secret" "scale_cache_key" {
32+
project = module.project.project_id
33+
secret_id = "scale-cache-puller-key"
34+
replication {
35+
auto {}
36+
}
37+
}
38+
39+
resource "google_secret_manager_secret_version" "scale_cache_key" {
40+
secret = google_secret_manager_secret.scale_cache_key.id
41+
secret_data = "Basic ${base64encode("_json_key_base64:${google_service_account_key.scale_cache.private_key}")}"
42+
}

kubernetes/gke-prow-build/prow/externalsecrets.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,16 @@ spec:
2020
secretStoreRef:
2121
kind: ClusterSecretStore
2222
name: broadcom-451918
23+
---
24+
apiVersion: external-secrets.io/v1beta1
25+
kind: ExternalSecret
26+
metadata:
27+
name: scale-pull-cache-token
28+
spec:
29+
data:
30+
- remoteRef:
31+
key: scale-cache-puller-key
32+
secretKey: token
33+
secretStoreRef:
34+
kind: ClusterSecretStore
35+
name: k8s-infra-prow-build

0 commit comments

Comments
 (0)