![如何在 Ubuntu 上升级 kubernetes 仓库](https://linux22.com/image/791162/%E5%A6%82%E4%BD%95%E5%9C%A8%20Ubuntu%20%E4%B8%8A%E5%8D%87%E7%BA%A7%20kubernetes%20%E4%BB%93%E5%BA%93.png)
我有两个 Kubernetes 集群,一个在 Ubuntu 20.04.6 LTS 上(第一个),另一个在 Ubuntu 22.04.3 LTS 上(第二个)。它们都使用 Kubernetes 1.26.10。
我尝试将两者都升级到版本 1.27.x,但第一个 apt 找不到 1.27 软件包。第一个显示:
apt-cache madison kubeadm
kubeadm | 1.26.11-1.1 | https://pkgs.k8s.io/core:/stable:/v1.26/deb Packages
kubeadm | 1.26.10-1.1 | https://pkgs.k8s.io/core:/stable:/v1.26/deb Packages
kubeadm | 1.26.9-1.1 | https://pkgs.k8s.io/core:/stable:/v1.26/deb Packages
kubeadm | 1.26.8-1.1 | https://pkgs.k8s.io/core:/stable:/v1.26/deb Packages
kubeadm | 1.26.7-1.1 | https://pkgs.k8s.io/core:/stable:/v1.26/deb Packages
和存储库:
deb http://europe-north1.gce.archive.ubuntu.com/ubuntu/ focal main restricted
deb http://europe-north1.gce.archive.ubuntu.com/ubuntu/ focal-updates main restricted
deb http://europe-north1.gce.archive.ubuntu.com/ubuntu/ focal universe
deb http://europe-north1.gce.archive.ubuntu.com/ubuntu/ focal-updates universe
deb http://europe-north1.gce.archive.ubuntu.com/ubuntu/ focal multiverse
deb http://europe-north1.gce.archive.ubuntu.com/ubuntu/ focal-updates multiverse
deb http://europe-north1.gce.archive.ubuntu.com/ubuntu/ focal-backports main restricted universe multiverse
deb http://security.ubuntu.com/ubuntu focal-security main restricted
deb http://security.ubuntu.com/ubuntu focal-security universe
deb http://security.ubuntu.com/ubuntu focal-security multiverse
deb [signed-by=/etc/apt/keyrings/kubernetes-apt-keyring.gpg] https://pkgs.k8s.io/core:/stable:/v1.26/deb/ /
第二:
apt-cache madison kubeadm
kubeadm | 1.28.2-00 | http://apt.kubernetes.io kubernetes-xenial/main amd64 Packages
kubeadm | 1.28.1-00 | http://apt.kubernetes.io kubernetes-xenial/main amd64 Packages
kubeadm | 1.28.0-00 | http://apt.kubernetes.io kubernetes-xenial/main amd64 Packages
kubeadm | 1.27.6-00 | http://apt.kubernetes.io kubernetes-xenial/main amd64 Packages
kubeadm | 1.27.5-00 | http://apt.kubernetes.io kubernetes-xenial/main amd64 Packages
kubeadm | 1.27.4-00 | http://apt.kubernetes.io kubernetes-xenial/main amd64 Packages
kubeadm | 1.27.3-00 | http://apt.kubernetes.io kubernetes-xenial/main amd64 Packages
kubeadm | 1.27.2-00 | http://apt.kubernetes.io kubernetes-xenial/main amd64 Packages
kubeadm | 1.27.1-00 | http://apt.kubernetes.io kubernetes-xenial/main amd64 Packages
kubeadm | 1.27.0-00 | http://apt.kubernetes.io kubernetes-xenial/main amd64 Packages
kubeadm | 1.26.11-1.1 | https://pkgs.k8s.io/core:/stable:/v1.26/deb Packages
kubeadm | 1.26.10-1.1 | https://pkgs.k8s.io/core:/stable:/v1.26/deb Packages
kubeadm | 1.26.9-1.1 | https://pkgs.k8s.io/core:/stable:/v1.26/deb Packages
kubeadm | 1.26.9-00 | http://apt.kubernetes.io kubernetes-xenial/main amd64 Packages
kubeadm | 1.26.8-1.1 | https://pkgs.k8s.io/core:/stable:/v1.26/deb Packages
kubeadm | 1.26.8-00 | http://apt.kubernetes.io kubernetes-xenial/main amd64 Packages
kubeadm | 1.26.7-1.1 | https://pkgs.k8s.io/core:/stable:/v1.26/deb Packages
kubeadm | 1.26.7-00 | http://apt.kubernetes.io kubernetes-xenial/main amd64 Packages
和存储库:
deb http://europe-north1.gce.archive.ubuntu.com/ubuntu/ jammy main restricted
deb http://europe-north1.gce.archive.ubuntu.com/ubuntu/ jammy-updates main restricted
deb http://europe-north1.gce.archive.ubuntu.com/ubuntu/ jammy universe
deb http://europe-north1.gce.archive.ubuntu.com/ubuntu/ jammy-updates universe
deb http://europe-north1.gce.archive.ubuntu.com/ubuntu/ jammy multiverse
deb http://europe-north1.gce.archive.ubuntu.com/ubuntu/ jammy-updates multiverse
deb http://europe-north1.gce.archive.ubuntu.com/ubuntu/ jammy-backports main restricted universe multiverse
deb http://security.ubuntu.com/ubuntu jammy-security main restricted
deb http://security.ubuntu.com/ubuntu jammy-security universe
deb http://security.ubuntu.com/ubuntu jammy-security multiverse
deb [signed-by=/etc/apt/keyrings/kubernetes-apt-keyring.gpg] https://pkgs.k8s.io/core:/stable:/v1.26/deb/ /
deb [arch=amd64] https://download.docker.com/linux/ubuntu jammy stable
deb http://apt.kubernetes.io/ kubernetes-xenial main
可能与第二个有关
deb http://apt.kubernetes.io/ kubernetes-xenial main
但如果我将其删除,之后两者都可以看到 1.26。
Kubernetes 官方升级文档说,1.27 应该在
https://pkgs.k8s.io/core:/stable:/v1.26/deb/
答案1
阅读您正在链接的文档再次。
引述如下:
将 URL 中的版本更改为下一个可用的次要版本,例如:
deb [signed-by=/etc/apt/keyrings/kubernetes-apt-keyring.gpg] https://pkgs.k8s.io/core:/stable:/v1.27/deb/ /
附注:
您应该删除该
apt.kubernetes.io
repo。旧版软件包存储库(apt.kubernetes.io 和 yum.kubernetes.io)已于 2023 年 9 月 13 日起弃用并冻结。
Kubernetes v1.27 也已经过时了。