gpt4 book ai didi

docker - 初始化Kubernetes集群

转载 作者:行者123 更新时间:2023-12-02 11:43:23 24 4
gpt4 key购买 nike

我正在尝试在ubuntu 18.04系统上安装Kubernetes集群..

作为使用以下命令初始化群集的一部分,得到以下错误

        [ERROR ImagePull]: failed to pull image k8s.gcr.io/kube-apiserver:v1.14.0: output: Error response from daemon: Get https://k8s.gcr.io/v2/: remote error: tls: access denied
, error: exit status 1
[ERROR ImagePull]: failed to pull image k8s.gcr.io/kube-controller-manager:v1.14.0: output: Error response from daemon: Get https://k8s.gcr.io/v2/: remote error: tls: access denied
, error: exit status 1
[ERROR ImagePull]: failed to pull image k8s.gcr.io/kube-scheduler:v1.14.0: output: Error response from daemon: Get https://k8s.gcr.io/v2/: remote error: tls: access denied
, error: exit status 1
[ERROR ImagePull]: failed to pull image k8s.gcr.io/kube-proxy:v1.14.0: output: Error response from daemon: Get https://k8s.gcr.io/v2/: remote error: tls: access denied
, error: exit status 1
[ERROR ImagePull]: failed to pull image k8s.gcr.io/pause:3.1: output: Error response from daemon: Get https://k8s.gcr.io/v2/: remote error: tls: access denied
, error: exit status 1
[ERROR ImagePull]: failed to pull image k8s.gcr.io/etcd:3.3.10: output: Error response from daemon: Get https://k8s.gcr.io/v2/: remote error: tls: access denied
, error: exit status 1
[ERROR ImagePull]: failed to pull image k8s.gcr.io/coredns:1.3.1: output: Error response from daemon: Get https://k8s.gcr.io/v2/: remote error: tls: access denied
, error: exit status 1

当我尝试运行 wget https://k8s.gcr.io/v2/时,出现以下错误:
Proxy request sent, awaiting response... 401 Unauthorized
Username/Password Authentication Failed.

您能告诉我是什么问题吗?

最佳答案

就我而言

[root@instance-1 ~]# wget https://k8s.gcr.io/v2/
--2019-08-26 12:58:24-- https://k8s.gcr.io/v2/
Resolving k8s.gcr.io (k8s.gcr.io)... 64.233.167.82, 2a00:1450:400c:c06::52
Connecting to k8s.gcr.io (k8s.gcr.io)|64.233.167.82|:443... connected.
HTTP request sent, awaiting response... 401 Unauthorized
Authorization failed.

那可能是代理问题。检查 [Kubeadm] Failing to pull images,并更具体[此答案]( https://github.com/kubernetes/kubeadm/issues/1201#issuecomment-494686022

因此,尝试 configure your docker to use proxy,希望您的问题能得到解决。

下面总结了这两种方法的命令集:

方法1:在/ etc / sysconfig / docker文件中配置代理变量

-在/ etc / sysconfig / docker文件中添加以下配置
# cat /etc/sysconfig/docker
HTTP_PROXY="http://USERNAME:PASSWORD@[your.proxy.server]:[port]"
HTTPS_PROXY="https://USERNAME:PASSWORD@[your.proxy.server]:[port]

-重新启动docker
# service docker restart

方法2:

1)创建一个插件
# mkdir /etc/systemd/system/docker.service.d

2)创建一个名称为 /etc/systemd/system/docker.service.d/http-proxy.conf的文件,并添加 HTTP_PROXY环境变量:
[Service]
Environment="HTTP_PROXY=http://user01:password@10.10.10.10:8080/"
Environment="HTTPS_PROXY=https://user01:password@10.10.10.10:8080/"
Environment="NO_PROXY= hostname.example.com,172.10.10.10"

3)重新加载systemd守护程序
# systemctl daemon-reload

4)重启docker
# systemctl restart dock er
5)验证配置是否已加载:
# systemctl show docker --property Environment
Environment=GOTRACEBACK=crash HTTP_PROXY=http://10.10.10.10:8080/ HTTPS_PROXY=http://10.10.10.10:8080/ NO_PROXY= hostname.example.com,172.10.10.10

关于docker - 初始化Kubernetes集群,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57654370/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com