0

我正在使用来自 aws 的 ec2-instance,并且我已经完成了两个节点的 kubernetes 集群的设置。我正在学习 kubernetes multicontainer-pod,为了进行实验,我需要运行两个容器,即 pod 文件。

让我给你看文件

apiVersion: v1
kind: Pod
metadata:
  name: multicontainer
spec:
  containers:
  - name: 1st
    image: nginx
    args: ["sleep", "3600"]

  - name: 2nd
    image: nginx

通过执行命令

kubectl apply -f multicontainer-pod.yml

我们得到了豆荚,这是两个豆荚。现在我通过执行命令进入豆荚

kubectl exec -it multicontainer -c 1st -- /bin/bash

在容器中,我正在执行更新库的命令

apt-get update

并坚持这个错误

Err:1 http://deb.debian.org/debian buster InRelease
  Temporary failure resolving 'deb.debian.org'
Err:2 http://security.debian.org/debian-security buster/updates InRelease
  Temporary failure resolving 'security.debian.org'
Err:3 http://deb.debian.org/debian buster-updates InRelease
  Temporary failure resolving 'deb.debian.org'
Reading package lists... Done
W: Failed to fetch http://deb.debian.org/debian/dists/buster/InRelease  Temporary failure resolving 'deb.debian.org'
W: Failed to fetch http://security.debian.org/debian-security/dists/buster/updates/InRelease  Temporary failure resolving 'security.debian.org'
W: Failed to fetch http://deb.debian.org/debian/dists/buster-updates/InRelease  Temporary failure resolving 'deb.debian.org'
W: Some index files failed to download. They have been ignored, or old ones used instead.

我什至不能写一个文件,因为它没有安装那个包。

在这个容器之外,我可以 ping google 以及安装软件包,但是在 nginx 容器中,我遇到了这个错误。请帮帮我...谢谢

4

0 回答 0