linux - kubectl 版本返回错误

标签 linux kubernetes centos7 kubectl

我正在尝试在 CentOS 7.3 服务器上安装 Kubernetes 集群。在取得一些进展后,我被困在安装 CNI 插件上。要安装插件,我需要传递一个从“kubectl version”命令输出中提取的参数。但是命令在获取所需信息时出错,服务器版本:

[root@bigdev1 ~]# kubectl version
Client Version: version.Info{Major:"1", Minor:"6", GitVersion:"v1.6.0", GitCommit:"fff5156092b56e6bd60fff75aad4dc9de6b6ef37", GitTreeState:"clean", BuildDate:"2017-03-28T16:36:33Z", GoVersion:"go1.7.5", Compiler:"gc", Platform:"linux/amd64"}
Error from server (NotFound): the server could not find the requested resource

实际上,我开始使用 kubeadm 1.7.3(和 Docker 17)版本的默认文档(https://kubernetes.io/docs/setup/independent/create-cluster-kubeadm/),但在检查时卡住了:

[root@bigdev1 ~]# kubeadm init --pod-network-cidr=10.244.0.0/16
[kubeadm] WARNING: kubeadm is in beta, please do not use it for production clusters.
[init] Using Kubernetes version: v1.7.4
[init] Using Authorization modes: [Node RBAC]
[preflight] Running pre-flight checks
[preflight] WARNING: docker version is greater than the most recently validated version. Docker version: 17.03.1-ce. Max validated version: 1.12
[preflight] Starting the kubelet service
[kubeadm] WARNING: starting in 1.8, tokens expire after 24 hours by default (if you require a non-expiring token use --token-ttl 0)
[certificates] Generated CA certificate and key.
[certificates] Generated API server certificate and key.
[certificates] API Server serving cert is signed for DNS names [bigdev1 kubernetes kubernetes.default kubernetes.default.svc kubernetes.default.svc.cluster.local] and IPs [10.96.0.1 10.0.109.20]
[certificates] Generated API server kubelet client certificate and key.
[certificates] Generated service account token signing key and public key.
[certificates] Generated front-proxy CA certificate and key.
[certificates] Generated front-proxy client certificate and key.
[certificates] Valid certificates and keys now exist in "/etc/kubernetes/pki"
[kubeconfig] Wrote KubeConfig file to disk: "/etc/kubernetes/admin.conf"
[kubeconfig] Wrote KubeConfig file to disk: "/etc/kubernetes/kubelet.conf"
[kubeconfig] Wrote KubeConfig file to disk: "/etc/kubernetes/controller-manager.conf"
[kubeconfig] Wrote KubeConfig file to disk: "/etc/kubernetes/scheduler.conf"
[apiclient] Created API client, waiting for the control plane to become ready

(永远等在这里)

然后我将 Docker 版本降低到 1.12.6,将 kubernetes 版本降低到 1.6.0 修改 kubeadm 配置后。也停止将 cidr 参数传递给 kubeadm init。

如果您能提出任何解决此问题的建议或给出以下命令的结果,我将很高兴:

kubectl 版本 | base64 | tr -d '\n'

提前致谢。

最佳答案

不确定您关注的是哪个文档。我建议使用 kubeadm 来配置集群。

https://kubernetes.io/docs/setup/independent/install-kubeadm/

关于linux - kubectl 版本返回错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45860343/

相关文章:

php - 在 php.ini 中禁用 opcache.enable 在 CentOS 上不起作用

linux - 如何防止服务脚本输出堵塞 "messages"

kubernetes - 模板 Chart.yaml 文件

linux - 如何避免在 rhel7 中命令输出的开头显示大点?

java - 如何用java编写文件搜索程序?

linux - 是否可以从 -L 标志命名 'screen' 日志文件?

linux - 如果我有一个进程,并且我克隆了它,PID 是否相同?

linux - SublimeREPL scala 错误...同样的错误,但现有的解决方案无法解决问题

docker - presto-将 worker 从docker迁移到kubernetes

kubernetes - 如何基于Istio(Kubernetes)中的路径路由多个gRPC服务