@@ -8,7 +8,7 @@ Most of the deployment configuration is in [infra/gcp/terraform/k8s-infra-oci-pr
88
99# Managing Kubernetes container registries
1010
11- This directory is for tools and things that are used to administer the GCR/ AR
11+ This directory is for tools and things that are used to administer the AR
1212repositories used to publish official container images for Kubernetes.
1313
1414- [ Staging repos] ( #staging-repos )
@@ -20,14 +20,20 @@ repositories used to publish official container images for Kubernetes.
2020
2121## Staging repos
2222
23- Kubernetes subprojects may use a dedicated staging GCP project to build and
23+ ~~ Kubernetes subprojects may use a dedicated staging GCP project to build and
2424host container images. We refer to the GCR provided by each staging project
2525as a staging repository. Images are promoted from staging repositories into
26- the main Kubernetes image registry (registry.k8s.io).
26+ the main Kubernetes image registry (registry.k8s.io).~~
27+ This approach is deprecated and not accepted for new Kubernetes subprojects
2728
28- Access to each staging project is governed by a Google Group, which grants the
29- ability to manually trigger GCB or push container images in the event that
30- automated builds via something like prow.k8s.io are not setup or are broken.
29+ We have a GCP project called k8s-staging-images with a AR dedicated registry for
30+ each subproject. Maintainers can view the contents of the registry and push
31+ images in exceptional situations. You can also retrigger jobs in Prow
32+ if an image-push job failed by setting the rerun_auth_config as shown below.
33+
34+ > [ !CAUTION]
35+ > The staging image registries at us-central1-docker.pkg.dev/k8s-staging-images/\* have a 90 day retention policy.
36+ > Please don't serve images to end users from there and follow the image promotion process below.
3137
3238### Requirements
3339
@@ -43,39 +49,39 @@ For example:
4349
4450- CRI-O is not part of the kubernetes project, it does not meet the
4551 requirements to get a staging repo
46- - While etcd and coredns are not part of the kubernetes project, we do
52+ - While coredns is not part of the kubernetes project, we do
4753 bundle them with kubernetes as part of the release, so for this specific
4854 case are allowing a staging repo to host them (solely within the context
4955 of the kubernetes project)
5056
5157### Creating staging repos
5258
53- 3 . Add the project name to the ` infra.staging.projects ` list defined in
54- [ ` infra/gcp/infra.yaml ` ] [ infra.yaml ]
59+ 1 . Create a google group in the format ` k8s-infra-staging-<project-name>@kubernetes.io ` by using our [ ` groups ` ] ( ../groups/README.md ) tool.
60+
61+ 1 . Add the project name to the ` locals.registries ` list defined in
62+ [ ` infra/gcp/terraform/k8s-staging-images/registries.tf ` ] [ infra.yaml ]
5563
56- 4 . One your PR merges:
57- - a postsubmit job will create the necessary google group
58- - whoever approved your PR will run [ the necessary bash script(s)] [ staging-bash ]
59- to create the staging repo
64+ 1 . Someone from SIG K8s Lead will be pinged when you modify this file and apply the terraform changes on your behalf.
6065
6166### Enabling automatic builds
6267
6368Once your staging repo is up and running, you can enable automatic build and
64- push. For more info, see [ the instructions here] [ image-pushing-readme ]
69+ push. For more info, see [ the instructions here] [ image-pushing-readme ]
6570
66- NOTE: All sub-projects are * strongly * encouraged to use this mechanism, though
67- it is not mandatory yet. Over time this will become the primary way to build
71+ NOTE: All sub-projects are _ strongly _ encouraged to use this mechanism, though
72+ it is not mandatory yet. Over time this will become the primary way to build
6873and push images, and anything else will become exceptional.
6974
7075### Creating image promoter manifests
7176
72771 . Enable automatic builds and ensure and image has been published by Cloud Build
73- to the staging repo.
78+ to the staging repo.
7479
75801 . Create 3 files:
76- - ` images/k8s-staging-<project-name>/OWNERS `
77- - ` images/k8s-staging-<project-name>/images.yaml `
78- - ` manifests/k8s-staging-<project-name>/promoter-manifest.yaml `
81+
82+ - ` images/k8s-staging-<project-name>/OWNERS `
83+ - ` images/k8s-staging-<project-name>/images.yaml `
84+ - ` manifests/k8s-staging-<project-name>/promoter-manifest.yaml `
7985
8086The ` promoter-manifest.yaml ` file will house the credentials and other registry
8187metadata, whereas the ` images.yaml ` file will hold only the image data. You can
@@ -93,16 +99,22 @@ Be sure to add the project owners to the
9399` images/k8s-staging-<project-name>/OWNERS ` file to increase the number of
94100people who can approve new images for promotion for your project.
95101
102+ ### Complete Example
103+
104+ 1 . Adding new groups [ PR] ( https://github.com/kubernetes/k8s.io/pull/8447 ) .
105+ 1 . Staging Registry Creation & Image Promoter Manifest [ PR] ( https://github.com/kubernetes/k8s.io/pull/8448 ) .
106+ 1 . Prow job that builds images on merge to main [ PR] ( https://github.com/kubernetes/test-infra/pull/34376 ) .
107+
96108### Image Promoter
97109
98110Image promotion roughly follows the following steps:
99111
1001121 . Push your image to one of the above staging docker repos
101- e.g., gcr.io /k8s-staging-coredns
113+ e.g., us-central1-docker.pkg.dev /k8s-staging-images/minikube
1021142 . Fork this git repo
1031153 . Add the image into the promoter manifest
104- e.g., if you pushed gcr.io /k8s-staging-coredns /foo:1.3, then add a "foo"
105- image entry into the manifest in ` images/k8s-staging-coredns /images.yaml `
116+ e.g., if you pushed us-central1-docker.pkg.dev /k8s-staging-images/minikube /foo:1.3, then add a "foo"
117+ image entry into the manifest in ` images/k8s-staging-minikube /images.yaml `
1061184 . Create a PR to this git repo for your changes
1071195 . The PR should trigger a ` pull-k8sio-cip ` job which will validate and dry-run
108120 your changes; check that the ` k8s-ci-robot ` responds 'Job succeeded' for it.
@@ -120,8 +132,6 @@ requests, which is described in detail
120132[ google-groups ] : /groups/README.md
121133[ image-pushing-readme ] : https://git.k8s.io/test-infra/config/jobs/image-pushing/README.md
122134[ restrictions.yaml ] : /groups/restrictions.yaml
123- [ infra.yaml ] : /infra/gcp/infra.yaml
124- [ staging-bash ] : /infra/gcp/bash/ensure-staging-storage.sh
125135[ post-promo-job ] : https://testgrid.k8s.io/sig-release-releng-blocking#post-k8sio-image-promo
126136[ ci-promo-job ] : https://testgrid.k8s.io/sig-release-releng-blocking#ci-k8sio-image-promo
127137[ project-github ] : https://git.k8s.io/community/github-management#project-owned-organizations
@@ -137,4 +147,4 @@ publishing an image.
137147 This will be used later to promote these assets to ` registry.k8s.io `
1381484 . Update the image promoter manifest for your subproject (` registry.k8s.io/images/k8s-staging-SUBPROJECT/images.yaml ` ) to add the respective SHAs for the container images and the Helm charts that were pushed to the staging image repository
1391495 . Create a PR and make sure that it gets merged for the image promoter process to kick off
140- 6 . Once the PR is merged, ensure the image promoter job for your merge commit is successful, then confirm that all promoted artifacts are available (e.g. ` helm install subproject oci://registry.k8s.io/subproject/charts/subproject --version=$VERSION ` )
150+ 6 . Once the PR is merged, ensure the image promoter job for your merge commit is successful, then confirm that all promoted artifacts are available (e.g. ` helm install subproject oci://registry.k8s.io/subproject/charts/subproject --version=$VERSION ` )
0 commit comments