Skip to content

Commit 2a8d704

Browse files
authored
Merge pull request #42023 from xmudrii/obs-feature-blog
Add "pkgs.k8s.io: Introducing Kubernetes community-owned package repositories" blog post
2 parents 700e788 + 758c669 commit 2a8d704

File tree

1 file changed

+207
-0
lines changed

1 file changed

+207
-0
lines changed
Lines changed: 207 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,207 @@
1+
---
2+
layout: blog
3+
title: "pkgs.k8s.io: Introducing Kubernetes Community-Owned Package Repositories"
4+
date: 2023-08-15T20:00:00+0000
5+
slug: pkgs-k8s-io-introduction
6+
---
7+
8+
**Author**: Marko Mudrinić (Kubermatic)
9+
10+
On behalf of Kubernetes SIG Release, I am very excited to introduce the
11+
Kubernetes community-owned software
12+
repositories for Debian and RPM packages: `pkgs.k8s.io`! The new package
13+
repositories are replacement for the Google-hosted package repositories
14+
(`apt.kubernetes.io` and `yum.kubernetes.io`) that we've been using since
15+
Kubernetes v1.5.
16+
17+
This blog post contains information about these new package repositories,
18+
what does it mean to you as an end user, and how to migrate to the new
19+
repositories.
20+
21+
## What you need to know about the new package repositories?
22+
23+
- This is an **opt-in change**; you're required to manually migrate from the
24+
Google-hosted repository to the Kubernetes community-owned repositories.
25+
See [how to migrate](#how-to-migrate) later in this announcement for migration information
26+
and instructions.
27+
- Access to the Google-hosted repository will remain intact for the foreseeable
28+
future. However, the Kubernetes project plans to stop publishing packages to
29+
the Google-hosted repository in the future. The project strongly recommends
30+
migrating to the Kubernetes package repositories going forward.
31+
- The Kubernetes package repositories contain packages beginning with those
32+
Kubernetes versions that were still under support when the community took
33+
over the package builds. This means that anything before v1.24.0 will only be
34+
available in the Google-hosted repository.
35+
- There's a dedicated package repository for each Kubernetes minor version.
36+
When upgrading to a different minor release, you must bear in mind that
37+
the package repository details also change.
38+
39+
## Why are we introducing new package repositories?
40+
41+
As the Kubernetes project is growing, we want to ensure the best possible
42+
experience for the end users. The Google-hosted repository has been serving
43+
us well for many years, but we started facing some problems that require
44+
significant changes to how we publish packages. Another goal that we have is to
45+
use community-owned infrastructure for all critical components and that
46+
includes package repositories.
47+
48+
Publishing packages to the Google-hosted repository is a manual process that
49+
can be done only by a team of Google employees called
50+
[Google Build Admins](/releases/release-managers/#build-admins).
51+
[The Kubernetes Release Managers team](/releases/release-managers/#release-managers)
52+
is a very diverse team especially in terms of timezones that we work in.
53+
Given this constraint, we have to do very careful planning for every release to
54+
ensure that we have both Release Manager and Google Build Admin available to
55+
carry out the release.
56+
57+
Another problem is that we only have a single package repository. Because of
58+
this, we were not able to publish packages for prerelease versions (alpha,
59+
beta, and rc). This made testing Kubernetes prereleases harder for anyone who
60+
is interested to do so. The feedback that we receive from people testing these
61+
releases is critical to ensure the best quality of releases, so we want to make
62+
testing these releases as easy as possible. On top of that, having only one
63+
repository limited us when it comes to publishing dependencies like `cri-tools`
64+
and `kubernetes-cni`.
65+
66+
Regardless of all these issues, we're very thankful to Google and Google Build
67+
Admins for their involvement, support, and help all these years!
68+
69+
## How the new package repositories work?
70+
71+
The new package repositories are hosted at `pkgs.k8s.io` for both Debian and
72+
RPM packages. At this time, this domain points to a CloudFront CDN backed by S3
73+
bucket that contains repositories and packages. However, we plan on onboarding
74+
additional mirrors in the future, giving possibility for other companies to
75+
help us with serving packages.
76+
77+
Packages are built and published via the [OpenBuildService (OBS) platform](http://openbuildservice.org).
78+
After a long period of evaluating different solutions, we made a decision to
79+
use OpenBuildService as a platform to manage our repositories and packages.
80+
First of all, OpenBuildService is an open source platform used by a large
81+
number of open source projects and companies, like openSUSE, VideoLAN,
82+
Dell, Intel, and more. OpenBuildService has many features making it very
83+
flexible and easy to integrate with our existing release tooling. It also
84+
allows us to build packages in a similar way as for the Google-hosted
85+
repository making the migration process as seamless as possible.
86+
87+
SUSE sponsors the Kubernetes project with access to their reference
88+
OpenBuildService setup ([`build.opensuse.org`](http://build.opensuse.org)) and
89+
with technical support to integrate OBS with our release processes.
90+
91+
We use SUSE's OBS instance for building and publishing packages. Upon building
92+
a new release, our tooling automatically pushes needed artifacts and
93+
package specifications to `build.opensuse.org`. That will trigger the build
94+
process that's going to build packages for all supported architectures (AMD64,
95+
ARM64, PPC64LE, S390X). At the end, generated packages will be automatically
96+
pushed to our community-owned S3 bucket making them available to all users.
97+
98+
We want to take this opportunity to thank SUSE for allowing us to use
99+
`build.opensuse.org` and their generous support to make this integration
100+
possible!
101+
102+
## What are significant differences between the Google-hosted and Kubernetes package repositories?
103+
104+
There are three significant differences that you should be aware of:
105+
106+
- There's a dedicated package repository for each Kubernetes minor release.
107+
For example, repository called `core:/stable:/v1.28` only hosts packages for
108+
stable Kubernetes v1.28 releases. This means you can install v1.28.0 from
109+
this repository, but you can't install v1.27.0 or any other minor release
110+
other than v1.28. Upon upgrading to another minor version, you have to add a
111+
new repository and optionally remove the old one
112+
- There's a difference in what `cri-tools` and `kubernetes-cni` package
113+
versions are available in each Kubernetes repository
114+
- These two packages are dependencies for `kubelet` and `kubeadm`
115+
- Kubernetes repositories for v1.24 to v1.27 have same versions of these
116+
packages as the Google-hosted repository
117+
- Kubernetes repositories for v1.28 and onwards are going to have published
118+
only versions that are used by that Kubernetes minor release
119+
- Speaking of v1.28, only kubernetes-cni 1.2.0 and cri-tols v1.28 are going
120+
to be available in the repository for Kubernetes v1.28
121+
- Similar for v1.29, we only plan on publishing cri-tools v1.29 and
122+
whatever kubernetes-cni version is going to be used by Kubernetes v1.29
123+
- The revision part of the package version (the `-00` part in `1.28.0-00`) is
124+
now autogenerated by the OpenBuildService platform and has a different format.
125+
The revision is now in the format of `-x.y`, e.g. `1.28.0-1.1`
126+
127+
## Does this in any way affect existing Google-hosted repositories?
128+
129+
The Google-hosted repository and all packages published to it will continue
130+
working in the same way as before. There are no changes in how we build and
131+
publish packages to the Google-hosted repository, all newly-introduced changes
132+
are only affecting packages publish to the community-owned repositories.
133+
134+
However, as mentioned at the beginning of this blog post, we plan to stop
135+
publishing packages to the Google-hosted repository in the future.
136+
137+
## How to migrate to the Kubernetes community-owned repositories? {#how-to-migrate}
138+
139+
### Debian, Ubuntu, and operating systems using `apt`/`apt-get` {#how-to-migrate-deb}
140+
141+
1. Replace the `apt` repository definition so that `apt` points to the new
142+
repository instead of the Google-hosted repository. Make sure to replace the
143+
Kubernetes minor version in the command below with the minor version
144+
that you're currently using:
145+
146+
```shell
147+
echo "deb [signed-by=/etc/apt/keyrings/kubernetes-apt-keyring.gpg] https://pkgs.k8s.io/core:/stable:/v1.28/deb/ /" | sudo tee /etc/apt/sources.list.d/kubernetes.list
148+
```
149+
150+
2. Download the public signing key for the Kubernetes package repositories.
151+
The same signing key is used for all repositories, so you can disregard the
152+
version in the URL:
153+
154+
```shell
155+
curl -fsSL https://pkgs.k8s.io/core:/stable:/v1.28/deb/Release.key | sudo gpg --dearmor -o /etc/apt/keyrings/kubernetes-apt-keyring.gpg
156+
```
157+
158+
3. Update the `apt` package index:
159+
160+
```shell
161+
sudo apt-get update
162+
```
163+
164+
### CentOS, Fedora, RHEL, and operating systems using `rpm`/`dnf` {#how-to-migrate-rpm}
165+
166+
1. Replace the `yum` repository definition so that `yum` points to the new
167+
repository instead of the Google-hosted repository. Make sure to replace the
168+
Kubernetes minor version in the command below with the minor version
169+
that you're currently using:
170+
171+
```shell
172+
cat <<EOF | sudo tee /etc/yum.repos.d/kubernetes.repo
173+
[kubernetes]
174+
name=Kubernetes
175+
baseurl=https://pkgs.k8s.io/core:/stable:/v1.28/rpm/
176+
enabled=1
177+
gpgcheck=1
178+
gpgkey=https://pkgs.k8s.io/core:/stable:/v1.28/rpm/repodata/repomd.xml.key
179+
exclude=kubelet kubeadm kubectl cri-tools kubernetes-cni
180+
EOF
181+
```
182+
183+
## Can I rollback to the Google-hosted repository after migrating to the Kubernetes repositories?
184+
185+
In general, yes. Just do the same steps as when migrating, but use parameters
186+
for the Google-hosted repository. You can find those parameters in a document
187+
like ["Installing kubeadm"](/docs/setup/production-environment/tools/kubeadm/install-kubeadm).
188+
189+
## Why isn’t there a stable list of domains/IPs? Why can’t I restrict package downloads?
190+
191+
Our plan for `pkgs.k8s.io` is to make it work as a redirector to a set of
192+
backends (package mirrors) based on user's location. The nature of this change
193+
means that a user downloading a package could be redirected to any mirror at
194+
any time. Given the architecture and our plans to onboard additional mirrors in
195+
the near future, we can't provide a list of IP addresses or domains that you
196+
can add to an allow list.
197+
198+
Restrictive control mechanisms like man-in-the-middle proxies or network
199+
policies that restrict access to a specific list of IPs/domains will break with
200+
this change. For these scenarios, we encourage you to mirror the release
201+
packages to a local package repository that you have strict control over.
202+
203+
## What should I do if I detect some abnormality with the new repositories?
204+
205+
If you encounter any issue with new Kubernetes package repositories, please
206+
file an issue in the
207+
[`kubernetes/release` repository](https://github.com/kubernetes/release/issues/new/choose).

0 commit comments

Comments
 (0)