You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -84,14 +92,18 @@ and this will implicitly achieve the main goal of
84
92
## Proposal
85
93
86
94
- Make the infrastructure generic and simple enough to be easily handed off to the CNCF
87
-
- Storage buckets (to store the staged/released packages) or anything similar
88
-
- DNS entries (e.g. apt.kubernetes.io, ...)
89
-
- package mirror (e.g. a self hosted aptly/artifactory/... or as a service)
90
-
- have multiple channels, e.g. `stable`, `dev`, `nightly`
95
+
- Choose a Packages as a Service solution (e.g. Open Build Service...) or build
96
+
the infrastructure manually. In case we build the infrastructure manually, we need
97
+
at least:
98
+
- Storage buckets (to store the staged/released packages) or anything similar
99
+
- DNS entries (e.g. apt.kubernetes.io, ...)
100
+
- Package mirror (e.g. a self hosted aptly/artifactory/... or as a service)
101
+
- have multiple channels, e.g. `stable`, `dev`, `nightly`
91
102
- Run the package builds as part of [krel stage and release]
92
103
- Have a safe way to store the signing key and make it available to the release team and release tooling
104
+
- Making key available to the Release Team/Managers is not a requirement if using 'as a service' solution
93
105
- Automatically sign the repository and packages
94
-
- Automatically build and publish packages on a nightly basis
106
+
- Automatically build and publish packages on a nightly basis (not required)
95
107
96
108
[krel stage and release]: https://github.com/kubernetes/release/blob/master/docs/krel/README.md#usage
97
109
@@ -151,49 +163,182 @@ Scenario: [...]
151
163
152
164
### Implementation Details/Notes/Constraints
153
165
154
-
Packages will be published for different:
166
+
Packages will be built and published using [Open Build Service (OBS)][obs]. openSUSE will sponsor the Kubernetes
167
+
project by giving us access to the [OBS instance hosted by openSUSE][obs-build].
168
+
169
+
[obs]: https://openbuildservice.org/
170
+
[obs-build]: https://build.opensuse.org/
171
+
172
+
#### Using OBS instead of manually building and hosting packages
173
+
174
+
The reasons for using Open Build Service (OBS) instead of building and hosting packages ourselves are:
175
+
176
+
- We want to handoff managing GPG keys to the third-party
177
+
- Managing GPG keys ourselves represents a security risk. For example, if a Release Manager with access to the GPG key
178
+
steps down, we might need to rotate the key. This is a process that affects End Users, therefore
179
+
we want to avoid it
180
+
- In this case, GPG keys are securely managed by the OBS platform hosted by openSUSE. No one from the Kubernetes
181
+
project will have direct access to the key, mitigating one of the main risks of this proposal
182
+
- We want to avoid managing the infrastructure ourselves, including buckets, mirrors/CDNs...
183
+
- We want to provide 'as a service' access to the packages infrastructure to Release Managers and eventually other
184
+
Kubernetes maintainers for their subprojects
185
+
186
+
#### How Open Build Service works?
187
+
188
+
From the [OBS website](https://openbuildservice.org/):
189
+
190
+
> The Open Build Service (OBS) is a generic system to build and distribute binary packages from sources in an automatic, consistent and reproducible way. You can release packages as well as updates, add-ons, appliances and entire distributions for a wide range of operating systems and hardware architectures.
191
+
192
+
OBS works in a way that we push sources and package spec files. Upon pushing packages/changes, OBS automatically
193
+
triggers builds for all chosen operating systems and architectures. Under the hood, OBS uses the same set of tools that
194
+
we use for building packages: `dpkg-buildpackage` and `rpmbuild`.
195
+
196
+
OBS implements a simple source-control management (SCM) system. It provides a complete history for all packages
197
+
allowing users to see what spec files and sources we used to build the concrete package. The history is accessible
198
+
via the OBS web interface.
199
+
200
+
Interaction with the OBS platform is done mainly via the [`osc` command-line tool][osc]. Alternatively, it's possible
201
+
to interact via the web interface. Currently there are no (Go) libraries that we can use instead of the `osc` tool.
The subprojects can be created manually via the web interface. Upon creating a **`${k8s_release}`** subproject,
255
+
the target operating systems and architectures (listed at the beginning of this subheading) must be configured for
256
+
the subproject (via the Repositories option). This is to be done by the Release Managers before cutting the first
257
+
alpha release for that minor release.
188
258
189
-
Different architectures will be published into the same repos, it is up to the package managers to pull and install the correct package for the target platform.
259
+
Note: it's important to ensure that the subproject and created packages are configured in a way to keep
260
+
previous build (i.e. previous patch releases).
261
+
262
+
#### Packages in OBS
263
+
264
+
Before pushing packages, a **Package** object must be created in each **`${k8s_release}`** subproject for each package
265
+
that we want to publish. This can be done via the `osc` command-line tool or the web interface. The created package
266
+
inherits information about the target operating systems and architectures from the subproject. Creating packages is
267
+
to be done by the Release Managers before cutting the first alpha release for that minor release.
268
+
269
+
Once all Package objects are created, sources and spec files can be pushed to those packages using `osc`.
270
+
271
+
#### Package Sources
272
+
273
+
We'll push pre-built binaries to OBS instead of pushing sources and then building binaries in the OBS pipeline.
274
+
The reasoning for this is:
275
+
276
+
- We already have our own release pipeline. Adding another release pipeline would increase the maintenance burden for
277
+
Release Managers
278
+
- It would increase the effort for updating build dependencies such as Go
279
+
- It would increase the effort for validating correctness of created binaries
280
+
- Binary published by our release process would differ to binaries built by OBS
281
+
- Additional efforts would be needed to get reproducible builds working
282
+
- We would also lose cosign signatures for binaries built by OBS
283
+
284
+
`kubepkg` will be extended with a subcommand to create a tarball with all required binaries and files (e.g. systemd
285
+
units and config files). The tarball is supposed to be created with the maximum compression to save on bandwidth and
286
+
storage. The structure of the tarball is supposed to be:
287
+
288
+
- Root of tarball:
289
+
- LICENSE file
290
+
- All accompanying files (e.g. systemd units)
291
+
- Subdirectory for each target architecture:
292
+
- Binary for that architecture (e.g. `kubectl`)
293
+
294
+
#### Package Specs
295
+
296
+
There are two key changes to the package specs compared to what specs we have at the time of writing this KEP:
297
+
298
+
- We'll maintain specs only for the RPM-based distros
299
+
- We'll have a dedicated spec for each package
300
+
- Right now, for RPM-based distros, we have one spec file that builds all packages
301
+
- This is to make it easier to maintain and update those spec files / packages, as well as, to make it easier for
302
+
distributors to consume and use those spec files
303
+
304
+
The starting point for creating RPM specs is going to be the [RPM specs currently embedded in `kubepkg`][kubepkg-rpm].
305
+
The following changes are needed to those RPM specs:
306
+
307
+
- Parametrize specs so the build tooling is able to pick a binary for the correct target architecture
308
+
- Ensure all spec files are passing rpm-lint
309
+
310
+
The reason for dropping deb specs is that maintaining and generating those specs is much more complicated than
311
+
maintaining RPM specs. Considering that we use pre-built binaries, we can easily convert RPM specs to Debian specs
312
+
using the [`debbuild` tool][debbuild]. The `debbuild` tool is already available in the OBS pipeline. This tool
313
+
can also be used by distributors if they want to build deb packages on their own.
314
+
315
+
The RPM specs will be generated by `kubepkg`, which already supports this. We only need to update the spec files.
Different architectures will be published into the same repos, it is up to the package managers to pull and install the correct package for the target platform.
217
397
218
398
### Risks and Mitigations
219
399
220
-
-_Risk_: We don't find a proper way to share secrets like the signing key
221
-
_Mitigation_: Using a third party tool like 1Password
400
+
-_Risk_: The OBS installation provided by openSUSE is unable to serve the load generated by the Kubernetes project
401
+
_Mitigation_: We can host our own mirrors and take some load from openSUSE (e.g. on Equinix Metal)
222
402
-_Risk_: Building all the packages for all the distributions and their version takes too long to be done nightly or via cutting the release
223
-
_Mitigation_: We do not deliver nightly packages.
403
+
_Mitigation_: We do not deliver nightly packages or wait for packages to be published in the release pipeline.
224
404
225
405
## Design Details
226
406
@@ -261,15 +441,15 @@ Once the tests show that the mirrors are good, we can adapt the official documen
261
441
262
442
#### Alpha
263
443
264
-
- Needed infrastructure is in place (buckets, DNS, repos, …)
444
+
- Open Build Service is configured and ready to host packages
445
+
- Spec files are ready and can be used in OBS to bulid packages
265
446
- There is a documented process to create and publish deb and rpm packages of Kubernetes components
266
447
- It is possible to consume the published deb and rpm packages using steps similar to the documented process
267
448
268
449
#### Alpha -> Beta Graduation
269
450
270
-
-[ ][krel]creates deb and rpm packages of Kubernetes components
451
+
-[ ][krel]interacts with Open Build Service to automatically trigger package builds and publishing
271
452
-[ ] Packages are signed
272
-
-[ ] Repository indices are updated after packages are copied to the repositories
273
453
-[ ] Post-publish tests are written and run as part of the release process
274
454
-[ ] Nightly builds will be built and published on a daily basis using [krel] which will be improved to take over this task from [kubepkg] making use of [pre-existing periodic jobs] (https://github.com/kubernetes/test-infra/blob/97cb34fa9e2bfc4af35de3e561cb9fc5a1094da1/config/jobs/kubernetes/sig-release/kubernetes-builds.yaml#L120-L166)
275
455
-[ ] Documentation written checked to be complete and correct.
@@ -312,9 +492,3 @@ N/A
312
492
## Alternatives [optional]
313
493
314
494
N/A
315
-
316
-
## Infrastructure Needed
317
-
318
-
New infrastructure is required to manage keys used to sign the deb and rpm
319
-
artifacts so as to remove the dependency on existing infrastructure and
0 commit comments