【发布时间】:2022-11-22 19:39:17
【问题描述】:
我正在运行一个 kind 集群并部署了一个 ubuntu pod
kubectl 运行 ubunt-test --rm -i --tty --image ubuntu -- bash
然后我尝试在 shell 上运行
apt-get update。输出是Get:1 http://security.ubuntu.com/ubuntu jammy-security InRelease Get:2 http://archive.ubuntu.com/ubuntu jammy InRelease Get:3 http://archive.ubuntu.com/ubuntu jammy-updates InRelease Get:4 http://archive.ubuntu.com/ubuntu jammy-backports InRelease Err:1 http://security.ubuntu.com/ubuntu jammy-security InRelease Clearsigned file isn't valid, got 'NOSPLIT' (does the network require authentication?) Err:2 http://archive.ubuntu.com/ubuntu jammy InRelease Clearsigned file isn't valid, got 'NOSPLIT' (does the network require authentication?) Err:3 http://archive.ubuntu.com/ubuntu jammy-updates InRelease Clearsigned file isn't valid, got 'NOSPLIT' (does the network require authentication?) Err:4 http://archive.ubuntu.com/ubuntu jammy-backports InRelease Clearsigned file isn't valid, got 'NOSPLIT' (does the network require authentication?) Reading package lists... Done N: See apt-secure(8) manpage for repository creation and user configuration details. N: Updating from such a repository can't be done securely, and is therefore disabled by default. E: The repository 'http://security.ubuntu.com/ubuntu jammy-security InRelease' is not signed. E: Failed to fetch http://security.ubuntu.com/ubuntu/dists/jammy-security/InRelease Clearsigned file isn't valid, got 'NOSPLIT' (does the network require authentication?) N: See apt-secure(8) manpage for repository creation and user configuration details. N: Updating from such a repository can't be done securely, and is therefore disabled by default. E: The repository 'http://archive.ubuntu.com/ubuntu jammy InRelease' is not signed. E: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/jammy/InRelease Clearsigned file isn't valid, got 'NOSPLIT' (does the network require authentication?) E: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/jammy-updates/InRelease Clearsigned file isn't valid, got 'NOSPLIT' (does the network require authentication?) E: The repository 'http://archive.ubuntu.com/ubuntu jammy-updates InRelease' is not signed. N: Updating from such a repository can't be done securely, and is therefore disabled by default. N: See apt-secure(8) manpage for repository creation and user configuration details. E: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/jammy-backports/InRelease Clearsigned file isn't valid, got 'NOSPLIT' (does the network require authentication?) E: The repository 'http://archive.ubuntu.com/ubuntu jammy-backports InRelease' is not signed. N: Updating from such a repository can't be done securely, and is therefore disabled by default. N: See apt-secure(8) manpage for repository creation and user configuration details.现在,当我使用 docker 运行 ubuntu 容器时,相同的更新命令起作用。
docker 运行 -it ubuntu bash
然后我运行
apt-get update命令,它成功了。输出是:Get:1 http://archive.ubuntu.com/ubuntu jammy InRelease [270 kB] Get:2 http://security.ubuntu.com/ubuntu jammy-security InRelease [110 kB] Get:3 http://archive.ubuntu.com/ubuntu jammy-updates InRelease [114 kB] Get:4 http://security.ubuntu.com/ubuntu jammy-security/universe amd64 Packages [767 kB] Get:5 http://archive.ubuntu.com/ubuntu jammy-backports InRelease [99.8 kB] Get:6 http://archive.ubuntu.com/ubuntu jammy/multiverse amd64 Packages [266 kB] Get:7 http://archive.ubuntu.com/ubuntu jammy/universe amd64 Packages [17.5 MB] Get:8 http://security.ubuntu.com/ubuntu jammy-security/main amd64 Packages [616 kB] Get:9 http://security.ubuntu.com/ubuntu jammy-security/multiverse amd64 Packages [4642 B] Get:10 http://security.ubuntu.com/ubuntu jammy-security/restricted amd64 Packages [522 kB] Get:11 http://archive.ubuntu.com/ubuntu jammy/main amd64 Packages [1792 kB] Get:12 http://archive.ubuntu.com/ubuntu jammy/restricted amd64 Packages [164 kB] Get:13 http://archive.ubuntu.com/ubuntu jammy-updates/universe amd64 Packages [955 kB] Get:14 http://archive.ubuntu.com/ubuntu jammy-updates/restricted amd64 Packages [573 kB] Get:15 http://archive.ubuntu.com/ubuntu jammy-updates/multiverse amd64 Packages [8056 B] Get:16 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 Packages [918 kB] Get:17 http://archive.ubuntu.com/ubuntu jammy-backports/universe amd64 Packages [7275 B] Get:18 http://archive.ubuntu.com/ubuntu jammy-backports/main amd64 Packages [3175 B] Fetched 24.7 MB in 33s (753 kB/s) Reading package lists... Done
apt-get update命令在主机和 docker 容器上都运行良好。我不知道 kind cluster pod 有什么问题。任何猜测?
【问题讨论】:
-
关于
apt-get工具的问题最好在另一个网站上提问,比如 Ask Ubuntu;这看起来不像是一个与编程相关的问题。您所描述的尝试在正在运行的 Pod 中进行更新的流程非常不寻常,因为这只会影响 Deployment 的一个副本,并且一旦 Pod 被删除就会丢失(如果节点出现故障,则可能超出您的控制范围)或变得过度投入)。 -
这不是我面临的确切问题。我的 kubernetes 操作员无法拉取 docker 镜像。它显示错误
"https://index.docker.io/v2/": x509: certificate is not valid for any names, but wanted to match index.docker.io。我开始调试并归结为这一点。 Ubuntu pod 无法下载更新。
标签: docker kubernetes networking ubuntu-22.04 kind