oc集群超时等待条件

时间:2018-11-25 14:41:45

标签: kubernetes openshift openshift-origin

我试图在本地Virtualbox centos 7.4上设置openshift原点。这是一个多合一的环境,仅用于学习目的。我遵循了确切的文件:

https://docs.okd.io/latest/getting_started/administrators.html

方法1:在容器中运行

我安装了docker,并且在运行命令时由于超时而失败:

[root@master openshift]# oc cluster up
Getting a Docker client ...
Checking if image openshift/origin-control-plane:v3.11 is available ...
Checking type of volume mount ...
Determining server IP ...
Checking if OpenShift is already running ...
Checking for supported Docker version (=>1.22) ...
Checking if insecured registry is configured properly in Docker ...
Checking if required ports are available ...
Checking if OpenShift client is configured properly ...
Checking if image openshift/origin-control-plane:v3.11 is available ...
Starting OpenShift using openshift/origin-control-plane:v3.11 ...
I1125 22:16:31.799473   10736 flags.go:30] Running "create-kubelet-flags"
I1125 22:16:32.867498   10736 run_kubelet.go:49] Running "start-kubelet"
I1125 22:16:33.568909   10736 run_self_hosted.go:181] Waiting for the kube-apiserver to be ready ...
I1125 22:17:02.633369   10736 interface.go:26] Installing "kube-proxy" ...
I1125 22:17:02.633386   10736 interface.go:26] Installing "kube-dns" ...
I1125 22:17:02.633392   10736 interface.go:26] Installing "openshift-service-cert-signer-operator" ...
I1125 22:17:02.633397   10736 interface.go:26] Installing "openshift-apiserver" ...
I1125 22:17:02.633420   10736 apply_template.go:81] Installing "openshift-apiserver"
I1125 22:17:02.634511   10736 apply_template.go:81] Installing "kube-proxy"
I1125 22:17:02.635754   10736 apply_template.go:81] Installing "kube-dns"
I1125 22:17:02.635924   10736 apply_template.go:81] Installing "openshift-service-cert-signer-operator"
I1125 22:17:12.316042   10736 interface.go:41] Finished installing "kube-proxy" "kube-dns" "openshift-service-cert-signer-operator" "openshift-apiserver"
Error: timed out waiting for the condition


[root@master openshift]# oc version
oc v3.11.0+0cbc58b
kubernetes v1.11.0+d4cacc0
features: Basic-Auth GSSAPI Kerberos SPNEGO

2 个答案:

答案 0 :(得分:0)

我在使用minishift时遇到了此问题,但原因似乎是相同的。您可以尝试以下步骤,对您有所帮助。

对我有用的解决方法:

使用hyperv + oc 3.11 + minishift v1.34.1 + c2ff9cb。 问题仅在于互联网连接不佳。 一旦minishift start命令第一次失败,请使用SSH进入minishift vm。先运行oc cluster down,然后运行oc cluster up(从日志中复制)。重复此向下/向上步骤,直到群集启动。根据网络的不同,可能是10到20次或更多或更少。 集群启动后,运行minishift stop / start,然后就可以准备好了。 希望这会有所帮助

答案 1 :(得分:0)

在尝试修复所有可能的问题后,例如超时、EOF、错误、恐慌和其他随机问题(我在 oc 启动期间所有这些问题都发生了大约 300 次失败)后,我将虚拟机恢复为在安装以下内容之前的状态,并且我已经我猜以正确的方式完成了它,因为现在它可以正常工作(+我可以毫无压力地向上/向下做 oc cluster)

附注。也可以限制从 Openshift 拉取 100 个 Docker 镜像(尝试 docker run hello-world)。

`sudo apt update && sudo apt upgrade`

`sudo apt install curl`
`curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -`


`sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"`

`sudo apt update && sudo apt -y install docker-ce`

`sudo usermod -aG docker XXXX`

`groups XXXX`


`wget https://github.com/openshift/origin/releases/download/v3.11.0/openshift-origin-client-tools-v3.11.0-0cbc58b-linux-64bit.tar.gz`


`cat << EOF | sudo tee /etc/docker/daemon.json
 {
    "insecure-registries" : [ "172.30.0.0/16" ]
 }
 EOF`

`sudo systemctl daemon-reload`
`sudo systemctl restart docker`

`sudo systemctl is-enabled docker`
`sudo systemctl is-active docker`

问候, 阿图尔