...
1# External Repository Staging Area
2
3This directory is the staging area for packages that have been split to their
4own repository. The content here will be periodically published to respective
5top-level k8s.io repositories.
6
7Repositories currently staged here:
8
9- [`k8s.io/api`](https://github.com/kubernetes/api)
10- [`k8s.io/apiextensions-apiserver`](https://github.com/kubernetes/apiextensions-apiserver)
11- [`k8s.io/apimachinery`](https://github.com/kubernetes/apimachinery)
12- [`k8s.io/apiserver`](https://github.com/kubernetes/apiserver)
13- [`k8s.io/cli-runtime`](https://github.com/kubernetes/cli-runtime)
14- [`k8s.io/client-go`](https://github.com/kubernetes/client-go)
15- [`k8s.io/cloud-provider`](https://github.com/kubernetes/cloud-provider)
16- [`k8s.io/cluster-bootstrap`](https://github.com/kubernetes/cluster-bootstrap)
17- [`k8s.io/code-generator`](https://github.com/kubernetes/code-generator)
18- [`k8s.io/component-base`](https://github.com/kubernetes/component-base)
19- [`k8s.io/component-helpers`](https://github.com/kubernetes/component-helpers)
20- [`k8s.io/controller-manager`](https://github.com/kubernetes/controller-manager)
21- [`k8s.io/cri-api`](https://github.com/kubernetes/cri-api)
22- [`k8s.io/csi-translation-lib`](https://github.com/kubernetes/csi-translation-lib)
23- [`k8s.io/dynamic-resource-allocation`](https://github.com/kubernetes/dynamic-resource-allocation)
24- [`k8s.io/endpointslice`](https://github.com/kubernetes/endpointslice)
25- [`k8s.io/kms`](https://github.com/kubernetes/kms)
26- [`k8s.io/kube-aggregator`](https://github.com/kubernetes/kube-aggregator)
27- [`k8s.io/kube-controller-manager`](https://github.com/kubernetes/kube-controller-manager)
28- [`k8s.io/kube-proxy`](https://github.com/kubernetes/kube-proxy)
29- [`k8s.io/kube-scheduler`](https://github.com/kubernetes/kube-scheduler)
30- [`k8s.io/kubectl`](https://github.com/kubernetes/kubectl)
31- [`k8s.io/kubelet`](https://github.com/kubernetes/kubelet)
32- [`k8s.io/legacy-cloud-providers`](https://github.com/kubernetes/legacy-cloud-providers)
33- [`k8s.io/metrics`](https://github.com/kubernetes/metrics)
34- [`k8s.io/mount-utils`](https://github.com/kubernetes/mount-utils)
35- [`k8s.io/pod-security-admission`](https://github.com/kubernetes/pod-security-admission)
36- [`k8s.io/sample-apiserver`](https://github.com/kubernetes/sample-apiserver)
37- [`k8s.io/sample-cli-plugin`](https://github.com/kubernetes/sample-cli-plugin)
38- [`k8s.io/sample-controller`](https://github.com/kubernetes/sample-controller)
39
40The code in the staging/ directory is authoritative, i.e. the only copy of the
41code. You can directly modify such code.
42
43## Using staged repositories from Kubernetes code
44
45Kubernetes code uses the repositories in this directory via a Go workspace and
46module `replace` statements. For example, when Kubernetes code imports a
47package from the `k8s.io/client-go` repository, that import is resolved to
48`staging/src/k8s.io/client-go` relative to the project root:
49
50```go
51// pkg/example/some_code.go
52package example
53
54import (
55 "k8s.io/client-go/dynamic" // resolves to staging/src/k8s.io/client-go/dynamic
56)
57```
58
59## Creating a new repository in staging
60
61### Adding the staging repository in `kubernetes/kubernetes`:
62
631. Send an email to the SIG Architecture [mailing
64 list](https://groups.google.com/forum/#!forum/kubernetes-sig-architecture)
65 and the mailing list of the SIG which would own the repo requesting approval
66 for creating the staging repository.
67
682. Once approval has been granted, create the new staging repository.
69
703. Update
71 [`import-restrictions.yaml`](/staging/publishing/import-restrictions.yaml)
72 to add the list of other staging repos that this new repo can import.
73
744. Add all mandatory template files to the staging repo as mentioned in
75 https://github.com/kubernetes/kubernetes-template-project.
76
775. Make sure that the `.github/PULL_REQUEST_TEMPLATE.md` and `CONTRIBUTING.md`
78 files mention that PRs are not directly accepted to the repo.
79
806. Ensure that `docs.go` file is added. Refer to
81 [#kubernetes/kubernetes#91354](https://github.com/kubernetes/kubernetes/blob/release-1.24/staging/src/k8s.io/client-go/doc.go)
82 for reference.
83
847. NOTE: Do not edit go.mod or go.sum in the new repo (staging/src/k8s.io/<newrepo>/) manually. Run the following instead:
85
86```
87 ./hack/update-vendor.sh
88```
89
908. Run [`./hack/update-go-workspace.sh`](/hack/update-go-workspace.sh) to add
91 the module to the workspace.
92
93### Creating the published repository
94
951. Create an [issue](https://github.com/kubernetes/org/issues/new?template=repo-create.md)
96in the `kubernetes/org` repo to request creation of the respective published
97repository in the Kubernetes org. The published repository **must** have an
98initial empty commit. It also needs specific access rules and branch settings.
99See [#kubernetes/org#58](https://github.com/kubernetes/org/issues/58)
100for an example.
101
1022. Setup branch protection and enable access to the `stage-bots` team
103by adding the repo in
104[`prow/config.yaml`](https://github.com/kubernetes/test-infra/blob/master/config/prow/config.yaml).
105See [#kubernetes/test-infra#9292](https://github.com/kubernetes/test-infra/pull/9292)
106for an example.
107
1083. Once the repository has been created in the Kubernetes org,
109update the publishing-bot to publish the staging repository by updating:
110
111 - [`rules.yaml`](/staging/publishing/rules.yaml):
112 Make sure that the list of dependencies reflects the staging repos in the `Godeps.json` file.
113
114 - [`repos.sh`](https://github.com/kubernetes/publishing-bot/blob/master/hack/repos.sh):
115 Add the staging repo in the list of repos to be published.
116
1174. Add the staging and published repositories as a subproject for the
118SIG that owns the repos in
119[`sigs.yaml`](https://github.com/kubernetes/community/blob/master/sigs.yaml).
120
1215. Add the repo to the list of staging repos in this `README.md` file.
View as plain text