Skip to content

Commit 894da22

Browse files
committed
Add blog post for pkgs.k8s.io
Signed-off-by: Marko Mudrinić <[email protected]>
1 parent ac9880b commit 894da22

File tree

1 file changed

+205
-0
lines changed

1 file changed

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

0 commit comments

Comments
 (0)