kubernetes Ubuntu部署

來源:互聯網
上載者:User

標籤:沒有   tor   lib   地址   下載   efault   ext   private   nod   

  

規劃節點

  

安裝 ubuntu 14.04 LTS

  

準備password-less SSH登入

建立 ssh-key 認證,切換到root 賬戶,使用命令 ssh-keygen -t rsa

  

Generating public/private rsa key pair.

Enter file in which to save the key (/root/.ssh/id_rsa):

Enter passphrase (empty for no passphrase):

Enter same passphrase again:

Your identification has been saved in /root/.ssh/id_rsa.

Your public key has been saved in /root/.ssh/id_rsa.pub.

  

將 id_rsa.pub 分發到全部節點 root 使用者根目錄下的 authorized_keys 裡面

cat /root/.ssh/id_rsa.pub >> /root/.ssh/authorized_keys

  

或者 使用 ssh-copy-id 命令, 例如 ssh-copy-id -i /root/.ssh/id_rsa.pub NODE_IP

  

安裝、配置k8s

下載 kubernetes 1.4 正式版, 地址 https://github.com/kubernetes/kubernetes/releases/download/v1.4.0/kubernetes.tar.gz

  

解壓縮 kubernetes 到 /opt/kubernetes

  

因為 k8s v1.4.0 發行版沒有 saltbase 軟體包, 另行到 github 下載 saltbase 內容,將其 拷貝至 /opt/kubernetes /cluster 目錄下, 並且 將 saltbase/salt/generate-cert/make-ca-cert.sh 設定為 可執行。

  

調整 ubuntu/config-default.conf 配置,

export nodes=${nodes:-"[email protected]"} 修改為節點列表,節點列表 [email protected] [email protected] [email protected] [email protected] 以空格隔開

  

roles=${roles:-"ai"} 按照節點順序修改相應的角色,a表示master,i表示node,ai 表示既是master又是node,,也是以空格隔開

  

export NUM_NODES=${NUM_NODES:-1} 修改為節點列表的個數

  

在cluster目錄下,運行命令 KUBERNETES_PROVIDER=ubuntu ./kube-up.sh 啟動 k8s叢集 ;

KUBERNETES_PROVIDER=ubuntu ./kube-down.sh 停止k8s叢集

  

  

備忘:

運行命令DEBUG=true KUBERNETES_PROVIDER=ubuntu ./kube-up.sh 開始 偵錯模式,啟動叢集

  

  

參考

http://containertutorials.com/get_started_kubernetes/index.html#installation

kubernetes Ubuntu部署

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.