2017-08-09 67 views
1

與Kubeadm一起安裝Kubernetes時遇到了一些問題。我在公司網絡背後工作。我在會話環境中聲明瞭代理設置。如何在Kubeadm代理之後安裝Kubernetes集羣?

$ export http_proxy=http://proxy-ip:port/ 
$ export https_proxy=http://proxy-ip:port/ 
$ export no_proxy=master-ip,node-ip,127.0.0.1 

安裝完所有必要的組件和依賴關係後,我開始初始化集羣。爲了使用當前的環境變量,我使用了sudo -E bash

$ sudo -E bash -c "kubeadm init --apiserver-advertise-address=192.168.1.102 --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.3 
[init] Using Authorization modes: [Node RBAC] 
[preflight] Running pre-flight checks 
[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 [loadbalancer kubernetes kubernetes.default kubernetes.default.svc kubernetes.default.svc.cluster.local] and IPs [10.96.0.1 192.168.1.102] 
[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 

後來我發現,沒有KUBE組件的上漲而kubelet保持請求kube-apiserversudo docker ps -a什麼也沒有返回。

它可能的根本原因是什麼?

在此先感謝。

回答

1

我強烈懷疑這是試圖拉下來gcr.io/google_containers/hyperkube:v1.7.3泊塢窗圖像或什麼的,這需要教學有關代理泊塢窗守護進程,in this way using systemd

這肯定會解釋爲什麼docker ps -a說明不了什麼,但我希望在dockerd日誌journalctl -u docker.service(或等值系統)抱怨不能把拉gcr.io

根據我從kubeadm參考指南閱讀,他們期待着您來修補在目標機器上的systemd配置到公開這些環境變量,而不是隻是將它們設置在啓動kubeadm的shell中(雖然這當然可能是一個功能請求)

+0

是的,它確實是'docker pull'的代理設置。我已經在systemd中設置了env,它工作正常。但是,謝謝你指出並清楚說明。 – ichbinblau