|
| 1 | +--- |
| 2 | +layout: blog |
| 3 | +title: "CRI-O is moving towards pkgs.k8s.io" |
| 4 | +date: 2023-10-10 |
| 5 | +slug: cri-o-community-package-infrastructure |
| 6 | +--- |
| 7 | + |
| 8 | +**Author:** Sascha Grunert |
| 9 | + |
| 10 | +The Kubernetes community [recently announced](/blog/2023/08/31/legacy-package-repository-deprecation/) |
| 11 | +that their legacy package repositories are frozen, and now they moved to |
| 12 | +[introduced community-owned package repositories](/blog/2023/08/15/pkgs-k8s-io-introduction) powered by the |
| 13 | +[OpenBuildService (OBS)](https://build.opensuse.org/project/subprojects/isv:kubernetes). |
| 14 | +CRI-O has a long history of utilizing |
| 15 | +[OBS for their package builds](https://github.com/cri-o/cri-o/blob/e292f17/install.md#install-packaged-versions-of-cri-o), |
| 16 | +but all of the packaging efforts have been done manually so far. |
| 17 | + |
| 18 | +The CRI-O community absolutely loves Kubernetes, which means that they're |
| 19 | +delighted to announce that: |
| 20 | + |
| 21 | +**All future CRI-O packages will be shipped as part of the officially supported |
| 22 | +Kubernetes infrastructure hosted on pkgs.k8s.io!** |
| 23 | + |
| 24 | +There will be a deprecation phase for the existing packages, which is currently |
| 25 | +being [discussed in the CRI-O community](https://github.com/cri-o/cri-o/discussions/7315). |
| 26 | +The new infrastructure will only support releases of CRI-O `>= v1.28.2` as well as |
| 27 | +release branches newer than `release-1.28`. |
| 28 | + |
| 29 | +## How to use the new packages |
| 30 | + |
| 31 | +In the same way as the Kubernetes community, CRI-O provides `deb` and `rpm` |
| 32 | +packages as part of a dedicated subproject in OBS, called |
| 33 | +[`isv:kubernetes:addons:cri-o`](https://build.opensuse.org/project/show/isv:kubernetes:addons:cri-o). |
| 34 | +This project acts as an umbrella and provides `stable` (for CRI-O tags) as well as |
| 35 | +`prerelease` (for CRI-O `releaes-1.y` and `main` branches) package builds. |
| 36 | + |
| 37 | +**Stable Releases:** |
| 38 | + |
| 39 | +- [`isv:kubernetes:addons:cri-o:stable`](https://build.opensuse.org/project/show/isv:kubernetes:addons:cri-o:stable): Stable Packages |
| 40 | + - [`isv:kubernetes:addons:cri-o:stable:v1.29`](https://build.opensuse.org/project/show/isv:kubernetes:addons:cri-o:stable:v1.29): `v1.29.z` tags |
| 41 | + - [`isv:kubernetes:addons:cri-o:stable:v1.28`](https://build.opensuse.org/project/show/isv:kubernetes:addons:cri-o:stable:v1.28): `v1.28.z` tags |
| 42 | + |
| 43 | +**Prereleases:** |
| 44 | + |
| 45 | +- [`isv:kubernetes:addons:cri-o:prerelease`](https://build.opensuse.org/project/show/isv:kubernetes:addons:cri-o:prerelease): Prerelease Packages |
| 46 | + - [`isv:kubernetes:addons:cri-o:prerelease:main`](https://build.opensuse.org/project/show/isv:kubernetes:addons:cri-o:prerelease:main): [`main`](https://github.com/cri-o/cri-o/commits/main) branch |
| 47 | + - [`isv:kubernetes:addons:cri-o:prerelease:v1.29`](https://build.opensuse.org/project/show/isv:kubernetes:addons:cri-o:prerelease:v1.29): [`release-1.29`](https://github.com/cri-o/cri-o/commits/release-1.29) branch |
| 48 | + - [`isv:kubernetes:addons:cri-o:prerelease:v1.28`](https://build.opensuse.org/project/show/isv:kubernetes:addons:cri-o:prerelease:v1.28): [`release-1.28`](https://github.com/cri-o/cri-o/commits/release-1.28) branch |
| 49 | + |
| 50 | +There are no stable releases available in the v1.29 repository yet, because |
| 51 | +v1.29.0 will be released in December. The CRI-O community will also **not** |
| 52 | +support release branches older than `release-1.28`, because there have been CI |
| 53 | +requirements merged into `main` which could be only backported to `release-1.28` |
| 54 | +with appropriate efforts. |
| 55 | + |
| 56 | +For example, If an end-user would like to install the latest available version |
| 57 | +of the CRI-O `main` branch, then they can add the repository in the same way as |
| 58 | +they do for Kubernetes. |
| 59 | + |
| 60 | +### `rpm` Based Distributions |
| 61 | + |
| 62 | +For `rpm` based distributions, you can run the following commands as a `root` user |
| 63 | +to install CRI-O together with Kubernetes: |
| 64 | + |
| 65 | +#### Add the Kubernetes repo |
| 66 | + |
| 67 | +```bash |
| 68 | +cat <<EOF | tee /etc/yum.repos.d/kubernetes.repo |
| 69 | +[kubernetes] |
| 70 | +name=Kubernetes |
| 71 | +baseurl=https://pkgs.k8s.io/core:/stable:/v1.28/rpm/ |
| 72 | +enabled=1 |
| 73 | +gpgcheck=1 |
| 74 | +gpgkey=https://pkgs.k8s.io/core:/stable:/v1.28/rpm/repodata/repomd.xml.key |
| 75 | +EOF |
| 76 | +``` |
| 77 | + |
| 78 | +#### Add the CRI-O repo |
| 79 | + |
| 80 | +```bash |
| 81 | +cat <<EOF | tee /etc/yum.repos.d/cri-o.repo |
| 82 | +[cri-o] |
| 83 | +name=CRI-O |
| 84 | +baseurl=https://pkgs.k8s.io/addons:/cri-o:/prerelease:/main/rpm/ |
| 85 | +enabled=1 |
| 86 | +gpgcheck=1 |
| 87 | +gpgkey=https://pkgs.k8s.io/addons:/cri-o:/prerelease:/main/rpm/repodata/repomd.xml.key |
| 88 | +EOF |
| 89 | +``` |
| 90 | + |
| 91 | +#### Install official package dependencies |
| 92 | + |
| 93 | +```bash |
| 94 | +dnf install -y \ |
| 95 | + conntrack \ |
| 96 | + container-selinux \ |
| 97 | + ebtables \ |
| 98 | + ethtool \ |
| 99 | + iptables \ |
| 100 | + socat |
| 101 | +``` |
| 102 | + |
| 103 | +#### Install the packages from the added repos |
| 104 | + |
| 105 | +```bash |
| 106 | +dnf install -y --repo cri-o --repo kubernetes \ |
| 107 | + cri-o \ |
| 108 | + kubeadm \ |
| 109 | + kubectl \ |
| 110 | + kubelet |
| 111 | +``` |
| 112 | + |
| 113 | +### `deb` Based Distributions |
| 114 | + |
| 115 | +For `deb` based distributions, you can run the following commands as a `root` |
| 116 | +user: |
| 117 | + |
| 118 | +#### Install dependencies for adding the repositories |
| 119 | + |
| 120 | +```bash |
| 121 | +apt-get update |
| 122 | +apt-get install -y software-properties-common curl |
| 123 | +``` |
| 124 | + |
| 125 | +#### Add the Kubernetes repository |
| 126 | + |
| 127 | +```bash |
| 128 | +curl -fsSL https://pkgs.k8s.io/core:/stable:/v1.28/deb/Release.key | |
| 129 | + gpg --dearmor -o /etc/apt/keyrings/kubernetes-apt-keyring.gpg |
| 130 | +echo "deb [signed-by=/etc/apt/keyrings/kubernetes-apt-keyring.gpg] https://pkgs.k8s.io/core:/stable:/v1.28/deb/ /" | |
| 131 | + tee /etc/apt/sources.list.d/kubernetes.list |
| 132 | +``` |
| 133 | + |
| 134 | +#### Add the CRI-O repository |
| 135 | + |
| 136 | +```bash |
| 137 | +curl -fsSL https://pkgs.k8s.io/addons:/cri-o:/prerelease:/main/deb/Release.key | |
| 138 | + gpg --dearmor -o /etc/apt/keyrings/cri-o-apt-keyring.gpg |
| 139 | +echo "deb [signed-by=/etc/apt/keyrings/cri-o-apt-keyring.gpg] https://pkgs.k8s.io/addons:/cri-o:/prerelease:/main/deb/ /" | |
| 140 | + tee /etc/apt/sources.list.d/cri-o.list |
| 141 | +``` |
| 142 | + |
| 143 | +#### Install the packages |
| 144 | + |
| 145 | +```bash |
| 146 | +apt-get update |
| 147 | +apt-get install -y cri-o kubelet kubeadm kubectl |
| 148 | +``` |
| 149 | + |
| 150 | +#### Start CRI-O |
| 151 | + |
| 152 | +```bash |
| 153 | +systemctl start crio.service |
| 154 | +``` |
| 155 | + |
| 156 | +The Project's `prerelease:/main` prefix at the CRI-O's package path, can be replaced with |
| 157 | +`stable:/v1.28`, `stable:/v1.29`, `prerelease:/v1.28` or `prerelease:/v1.29` |
| 158 | +if another stream package is used. |
| 159 | + |
| 160 | +Bootstrapping [a cluster using `kubeadm`](/docs/setup/production-environment/tools/kubeadm/install-kubeadm/) |
| 161 | +can be done by running `kubeadm init` command, which automatically detects that |
| 162 | +CRI-O is running in the background. There are also `Vagrantfile` examples |
| 163 | +available for [Fedora 38](https://github.com/cri-o/packaging/blob/main/test/rpm/Vagrantfile) |
| 164 | +as well as [Ubuntu 22.04](https://github.com/cri-o/packaging/blob/main/test/deb/Vagrantfile) |
| 165 | +for testing the packages together with `kubeadm`. |
| 166 | + |
| 167 | +## How it works under the hood |
| 168 | + |
| 169 | +Everything related to these packages lives in the new |
| 170 | +[CRI-O packaging repository](https://github.com/cri-o/packaging). |
| 171 | +It contains a [daily reconciliation](https://github.com/crio/packaging/actions/workflows/schedule.yml) |
| 172 | +GitHub action workflow, for all supported release branches as well as tags of |
| 173 | +CRI-O. A [test pipeline](https://github.com/cri-o/packaging/actions/workflows/obs.yml) |
| 174 | +in the OBS workflow ensures that the packages can be correctly installed and |
| 175 | +used before being published. All of the staging and publishing of the |
| 176 | +packages is done with the help of the [Kubernetes Release Toolbox (krel)](https://github.com/kubernetes/release/blob/master/docs/krel/README.md), |
| 177 | +which is also used for the official Kubernetes `deb` and `rpm` packages. |
| 178 | + |
| 179 | +The package build inputs will undergo daily reconciliation and will be supplied by |
| 180 | +CRI-O's [static binary bundles](https://console.cloud.google.com/storage/browser/cri-o/artifacts). |
| 181 | +These bundles are built and signed for each commit in the CRI-O CI, |
| 182 | +and contain everything CRI-O requires to run on a certain architecture. |
| 183 | +The static builds are reproducible, powered by [nixpkgs](https://github.com/NixOS/nixpkgs) |
| 184 | +and available only for `x86_64`, `aarch64` and `ppc64le` architecture. |
| 185 | + |
| 186 | +The CRI-O maintainers will be happy to listen to any feedback or suggestions on the new |
| 187 | +packaging efforts! Thank you for reading this blog post, feel free to reach out |
| 188 | +to the maintainers via the Kubernetes [Slack channel #crio](https://kubernetes.slack.com/messages/CAZH62UR1) |
| 189 | +or create an issue in the [packaging repository](https://github.com/cri-o/packaging/issues). |
0 commit comments