2017-08-24 35 views
0

我試圖在CentOS 7.3服務器上安裝Kubernetes集羣。經過一些進展,我陷入了安裝CNI插件的困境。要安裝插件,我需要傳遞一個從「kubectl version」命令輸出中提取的參數。然而命令獲取所需信息時獲取錯誤,服務器版本:kubectl版本返回錯誤

[[email protected] ~]# 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 

其實,我開始使用默認的文檔(https://kubernetes.io/docs/setup/independent/create-cluster-kubeadm/)與版本1.7.3 kubeadm(與泊塢窗17),但就死在一個檢查:

[[email protected] ~]# 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 

(永遠在這裏等待)

然後我多克爾版本減少到1.12.6和kubernetes版本1.6.0 修改kubeadm配置後。還停止將cidr參數傳遞給kubeadm init。

我會很高興,如果你可以給任何建議,幫助清除這個問題,或給下面的命令的結果:

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

在此先感謝。

+0

你需要專注於爲什麼kubeadm掛起。一旦它解決了,kubectl就可以工作,並且您可以繼續使用CNI插件... 請參閱您正在關注的文檔中的「疑難解答」部分,或者看到諸如https://github.com/kubernetes/kubeadm/issues/103 –

回答