gpt4 book ai didi

centos - Kubernetes配置步骤2 CentOS 7

转载 作者:行者123 更新时间:2023-12-04 19:44:09 28 4
gpt4 key购买 nike

来自 http://kubernetes.io/docs/getting-started-guides/kubeadm/

CentOS Linux 版本 7.2.1511(核心)

(1/4) 在主机上安装 kubelet 和 kubeadm
......
没关系

$sudo docker -v

Docker version 1.10.3, build cb079f6-unsupported
$sudo kubeadm version
$kubeadm version: version.Info{Major:"1", Minor:"5+", GitVersion:"v1.5.0-alpha.0.1534+cf7301f16c0363-dirty", GitCommit:"cf7301f16c036363c4fdcb5d4d0c867720214598", GitTreeState:"dirty", BuildDate:"2016-09-27T18:10:39Z", GoVersion:"go1.6.3", Compiler:"gc", Platform:"linux/amd64"}
$sudo systemctl enable docker && systemctl start docker
$sudo systemctl enable kubelet && systemctl start kubelet

又好了
$ sudo kubeadm init

<master/tokens> generated token: "15a340.9910f948879b5d99"
<master/pki> created keys and certificates in "/etc/kubernetes/pki"
<util/kubeconfig> created "/etc/kubernetes/kubelet.conf"
<util/kubeconfig> created "/etc/kubernetes/admin.conf"
<master/apiclient> created API client configuration
<master/apiclient> created API client, waiting for the control plane to become ready

并且在那个地方过程停止了。
可能,我无法理解某些东西,但 RedHat OpenShift 版本 3 使用 kubernetes+docker。我尝试了 OpenShift v3 docker 版本下载 - 没关系。

最佳答案

我通过在/etc/hosts 文件中将私有(private) IP 地址声明为 localhost 来解决这个问题。
示例:/etc/hosts

10.0.0.2  localhost

然后我遇到了 kubectl get nodes 抛出的问题:
The connection to the server localhost:8080 was refused - did you specify the right host or port?

我通过将生成的 conf 复制到本地 kube 配置来解决这个问题。
cp /etc/kubernetes/kubelet.conf ~/.kube/config

关于centos - Kubernetes配置步骤2 CentOS 7,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39951580/

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