⎈ k8s knowledge compiler

Changing The Kubernetes Package Repository [page]deterministic

tasks

This page explains how to enable a package repository for the desired Kubernetes minor release upon upgrading a cluster. This is only needed for users of the community-owned package repositories hosted at `pkgs.k8s.io`. Unlike the legacy package repositories, the community-owned package repositories are structured in a way that there's a dedicated package repository for each Kubernetes minor version.

This guide only covers a part of the Kubernetes upgrade process. Please see the [upgrade guide](/docs/tasks/administer-cluster/kubeadm/kubeadm-upgrade/) for more information about upgrading Kubernetes clusters.

This step is only needed upon upgrading a cluster to another minor release. If you're upgrading to another patch release within the same minor release (e.g. v.5 to v.7), you don't need to follow this guide. However, if you're still using the legacy package repositories, you'll need to migrate to the new community-owned package repositories before upgrading (see the next section for more details on how to do this).

##

This document assumes that you're already using the community-owned package repositories (`pkgs.k8s.io`). If that's not the case, it's strongly recommended to migrate to the community-owned package repositories as described in the [official announcement](/blog/2023/08/15/pkgs-k8s-io-introduction/).

### Verifying if the Kubernetes package repositories are used

If you're unsure whether you're using the community-owned package repositories or the legacy package repositories, take the following steps to verify:

Print the contents of the file that defines the Kubernetes `apt` repository:

```shell # On your system, this configuration file could have a different name pager /etc/apt/sources.list.d/kubernetes.list ```

If you see a line similar to:

``` deb [signed-by=/etc/apt/keyrings/kubernetes-apt-keyring.gpg] https://pkgs.k8s.io/core:/stable:/v/deb/ / ```

You're using the Kubernetes package repositories and this guide applies to you. Otherwise, it's strongly recommended to migrate to the Kubernetes package repositories as described in the [official announcement](/blog/2023/08/15/pkgs-k8s-io-introduction/).

Print the contents of the file that defines the Kubernetes `yum` repository:

```shell # On your system, this configuration file could have a different name cat /etc/yum.repos.d/kubernetes.repo ```

If you see a `baseurl` similar to the `baseurl` in the output below:

``` [kubernetes] name=Kubernetes baseurl=https://pkgs.k8s.io/core:/stable:/v/rpm/ enabled=1 gpgcheck=1 gpgkey=https://pkgs.k8s.io/core:/stable:/v/rpm/repodata/repomd.xml.key exclude=kubelet kubeadm kubectl ```

You're using the Kubernetes package repositories and this guide applies to you. Otherwise, it's strongly recommended to migrate to the Kubernetes package repositories as described in the [official announcement](/blog/2023/08/15/pkgs-k8s-io-introduction/).

Print the contents of the file that defines the Kubernetes `zypper` repository:

```shell # On your system, this configuration file could have a different name cat /etc/zypp/repos.d/kubernetes.repo ```

If you see a `baseurl` similar to the `baseurl` in the output below:

``` [kubernetes] name=Kubernetes baseurl=https://pkgs.k8s.io/core:/stable:/v/rpm/ enabled=1 gpgcheck=1 gpgkey=https://pkgs.k8s.io/core:/stable:/v/rpm/repodata/repomd.xml.key exclude=kubelet kubeadm kubectl ```

You're using the Kubernetes package repositories and this guide applies to you. Otherwise, it's strongly recommended to migrate to the Kubernetes package repositories as described in the [official announcement](/blog/2023/08/15/pkgs-k8s-io-introduction/).

The URL used for the Kubernetes package repositories is not limited to `pkgs.k8s.io`, it can also be one of:

  • `pkgs.k8s.io`
  • `pkgs.kubernetes.io`
  • `packages.kubernetes.io`

## Switching to another Kubernetes package repository

This step should be done upon upgrading from one to another Kubernetes minor relea …(trimmed)

Sources

tasks/administer-cluster/kubeadm/change-package-repository.md · docChanging The Kubernetes Package Repository

Related (4)

part_of {{% heading "prerequisites" %}}describes conf=1
part_of {{% heading "whatsnext" %}}describes conf=1

← all Docs