Skip to content

Commit 7d9403a

Browse files
committed
releng: Add new projects for staging/releasing Kubernetes
Here we add three new projects: - k8s-staging-kubernetes - k8s-staging-release - k8s-release-admin k8s-staging-kubernetes will be the official project for staging and releasing Kubernetes. k8s-staging-release will be used to stage Release Engineering images. k8s-release-admin will be a limited-scope near-prod project for Release Admins (Stephen, Tim, Caleb), which will contain KMS keys to be leveraged during staging and release. We add ensure-release-kms.sh, which configures the new k8s-release-admin GCP project now and grants KMS admin access to k8s-infra-release-admins. Staging release project settings have been replicated in the ensure-staging-storage.sh script. Signed-off-by: Stephen Augustus <[email protected]>
1 parent ae3147c commit 7d9403a

File tree

11 files changed

+217
-3
lines changed

11 files changed

+217
-3
lines changed

OWNERS_ALIASES

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,21 @@ aliases:
1111
- dims
1212
- justaugustus
1313
- listx
14+
release-engineering-approvers:
15+
- calebamiles # subproject owner
16+
- dougm # Patch Release Team
17+
- feiskyer # Patch Release Team
18+
- hoegaarden # Patch Release Team
19+
- idealhack # Patch Release Team
20+
- justaugustus # subproject owner / Patch Release Team
21+
- tpepper # subproject owner / Patch Release Team
22+
release-engineering-reviewers:
23+
- calebamiles # subproject owner
24+
- cpanato # Branch Manager
25+
- dougm # Patch Release Team
26+
- feiskyer # Patch Release Team
27+
- hoegaarden # Patch Release Team
28+
- idealhack # Patch Release Team
29+
- justaugustus # subproject owner / Patch Release Team
30+
- saschagrunert # Branch Manager
31+
- tpepper # subproject owner / Patch Release Team

groups/groups.yaml

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -719,6 +719,16 @@ groups:
719719
720720
721721

722+
- email-id: [email protected]
723+
name: k8s-infra-staging-kubernetes
724+
description: |-
725+
ACL for staging Kubernetes
726+
settings:
727+
ReconcileMembers: "true"
728+
members:
729+
# TODO(justaugustus): Add editors group after k8s.gcr.io domain flip
730+
731+
722732
- email-id: [email protected]
723733
name: k8s-infra-staging-kube-state-metrics
724734
description: |-
@@ -793,20 +803,29 @@ groups:
793803
794804
795805

806+
- email-id: [email protected]
807+
name: k8s-infra-staging-release
808+
description: |-
809+
ACL for staging release
810+
settings:
811+
ReconcileMembers: "true"
812+
members:
813+
814+
815+
796816
- email-id: [email protected]
797817
name: k8s-infra-staging-release-test
798818
description: |-
799819
ACL for staging release-test
800820
settings:
801821
ReconcileMembers: "true"
802822
members:
803-
823+
824+
804825
805826
806827
807-
808828
809-
810829

811830
- email-id: [email protected]
812831
name: k8s-infra-staging-scl-image-builder

infra/gcp/ensure-release-kms.sh

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
#!/usr/bin/env bash
2+
#
3+
# Copyright 2019 The Kubernetes Authors.
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
17+
# This script is used to ensure Release Engineering subproject owners have the
18+
# appropriate access to SIG Release prod GCP projects.
19+
#
20+
# Projects:
21+
# - k8s-release-admin - Stores KMS objects which other release projects will
22+
# be granted permission to decrypt e.g., GITHUB_TOKEN
23+
24+
set -o errexit
25+
set -o nounset
26+
set -o pipefail
27+
28+
SCRIPT_DIR=$(dirname "${BASH_SOURCE[0]}")
29+
. "${SCRIPT_DIR}/lib.sh"
30+
31+
function usage() {
32+
echo "usage: $0 [project...]" > /dev/stderr
33+
echo "example:" > /dev/stderr
34+
echo " $0 # do all release projects" > /dev/stderr
35+
echo " $0 k8s-release-admin # just do one" > /dev/stderr
36+
echo > /dev/stderr
37+
}
38+
39+
# NB: Please keep this sorted.
40+
PROJECTS=(
41+
k8s-release-admin
42+
)
43+
44+
if [ $# = 0 ]; then
45+
# default to all release projects
46+
set -- "${PROJECTS[@]}"
47+
fi
48+
49+
for PROJECT; do
50+
color 3 "Configuring: ${PROJECT}"
51+
52+
# Make the project, if needed
53+
color 6 "Ensuring project exists: ${PROJECT}"
54+
ensure_project "${PROJECT}"
55+
56+
# Enable admins to use the UI
57+
color 6 "Empowering ${RELEASE_ADMINS} as project viewers"
58+
empower_group_as_viewer "${PROJECT}" "${RELEASE_ADMINS}"
59+
60+
# Enable KMS APIs
61+
color 6 "Enabling the KMS API"
62+
enable_api "${PROJECT}" cloudkms.googleapis.com
63+
64+
# Let project admins use KMS.
65+
color 6 "Empowering ${RELEASE_ADMINS} as KMS admins"
66+
empower_group_for_kms "${PROJECT}" "${RELEASE_ADMINS}"
67+
68+
color 6 "Done"
69+
done

infra/gcp/ensure-staging-storage.sh

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,14 @@ STAGING_PROJECTS=(
5959
kops
6060
kube-state-metrics
6161
kubeadm
62+
kubernetes
6263
metrics-server
6364
multitenancy
6465
nfd
6566
npd
6667
provider-azure
6768
publishing-bot
69+
release
6870
release-test
6971
scl-image-builder
7072
service-apis
@@ -103,6 +105,13 @@ for REPO; do
103105
color 6 "Empowering ${WRITERS} as project viewers"
104106
empower_group_as_viewer "${PROJECT}" "${WRITERS}"
105107

108+
# Enable Release Manager Associates view access to
109+
# Release Engineering projects
110+
if [[ $REPO == "kubernetes" ]] || [[ $REPO == "release" ]] || [[ $REPO == "release-test" ]]; then
111+
color 6 "Empowering ${RELEASE_VIEWERS} as project viewers"
112+
empower_group_as_viewer "${PROJECT}" "${RELEASE_VIEWERS}"
113+
fi
114+
106115
# Every project gets a GCR repo
107116

108117
# Enable container registry APIs
@@ -161,5 +170,19 @@ for REPO; do
161170
color 6 "Empowering Prow"
162171
empower_prow "${PROJECT}" "${GCB_BUCKET}"
163172

173+
# TODO(justaugustus): Remove once k8s-release-admin is configured and
174+
# KMS assets have been transferred over.
175+
if [[ $PROJECT == "k8s-staging-release-test" ]]; then
176+
# Enable KMS APIs
177+
color 6 "Enabling the KMS API"
178+
enable_api "${PROJECT}" cloudkms.googleapis.com
179+
180+
RELEASE_ADMINS="[email protected]"
181+
182+
# Let project admins use KMS.
183+
color 6 "Empowering ${RELEASE_ADMINS} as KMS admins"
184+
empower_group_for_kms "${PROJECT}" "${RELEASE_ADMINS}"
185+
fi
186+
164187
color 6 "Done"
165188
done

infra/gcp/lib.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,14 @@ PROW_SVCACCT="[email protected]"
5757
GCP_ORG="758905017065" # kubernetes.io
5858
GCP_BILLING="018801-93540E-22A20E"
5959

60+
# Release Engineering umbrella groups
61+
# - admins - edit and KMS access (Release Engineering subproject owners)
62+
# - managers - access to run stage/release jobs (Patch Release Team / Branch Managers)
63+
# - viewers - view access to Release Engineering projects (Release Manager Associates)
64+
RELEASE_ADMINS="[email protected]"
65+
RELEASE_MANAGERS="[email protected]"
66+
RELEASE_VIEWERS="[email protected]"
67+
6068
# Get the GCS bucket name that backs a GCR repo.
6169
# $1: The GCR repo (same as the GCP project name)
6270
# $2: The GCR region (optional)
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# See the OWNERS docs at https://go.k8s.io/owners
2+
3+
options:
4+
no_parent_owners: true
5+
approvers:
6+
- release-engineering-approvers
7+
- cblecker
8+
- dims
9+
- listx
10+
- thockin
11+
reviewers:
12+
- release-engineering-reviewers
13+
14+
labels:
15+
- sig/release
16+
- area/release-eng
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
### ATTENTION ###
2+
# k8s-staging-kubernetes is the staging container registry for ROOT level k8s.gcr.io images.
3+
# Image promotion for this project is restricted to Release Managers.
4+
#
5+
# The following images are managed within this project:
6+
# - cloud-controller-manager
7+
# - conformance (will likely be moved to another staging project)
8+
# - hyperkube (to be deprecated in a future release)
9+
# - kube-apiserver
10+
# - kube-controller-manager
11+
# - kube-proxy
12+
# - kube-scheduler
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# See the OWNERS docs at https://go.k8s.io/owners
2+
3+
options:
4+
no_parent_owners: true
5+
approvers:
6+
- release-engineering-approvers
7+
- cblecker
8+
- dims
9+
- listx
10+
- thockin
11+
reviewers:
12+
- release-engineering-reviewers
13+
14+
labels:
15+
- sig/release
16+
- area/release-eng

k8s.gcr.io/images/k8s-staging-release/images.yaml

Whitespace-only changes.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
### ATTENTION ###
2+
# k8s-staging-kubernetes is the staging container registry for ROOT level k8s.gcr.io images.
3+
# Image promotion for this project is restricted to Release Managers.
4+
#
5+
# The following images are managed within this project:
6+
# - cloud-controller-manager
7+
# - conformance (will likely be moved to another staging project)
8+
# - hyperkube (to be deprecated in a future release)
9+
# - kube-apiserver
10+
# - kube-controller-manager
11+
# - kube-proxy
12+
# - kube-scheduler
13+
#
14+
# google group for gcr.io/k8s-staging-kubernetes is [email protected]
15+
registries:
16+
- name: gcr.io/k8s-staging-kubernetes
17+
src: true
18+
- name: us.gcr.io/k8s-artifacts-prod
19+
service-account: k8s-infra-gcr-promoter@k8s-artifacts-prod.iam.gserviceaccount.com
20+
- name: eu.gcr.io/k8s-artifacts-prod
21+
service-account: k8s-infra-gcr-promoter@k8s-artifacts-prod.iam.gserviceaccount.com
22+
- name: asia.gcr.io/k8s-artifacts-prod
23+
service-account: k8s-infra-gcr-promoter@k8s-artifacts-prod.iam.gserviceaccount.com

0 commit comments

Comments
 (0)