接下來在各節點安裝 Ubuntu Server (ubuntu-18.04.2-server-amd64.iso),可在 http://old-releases.ubuntu.com/releases/18.04.2/ 下載 iso 檔。
在實體機或生產環境的虛擬機上,可使用 PXE 搭配 ubuntu preseeding 進行自動安裝。
準備好 iso 檔和 preseeding 檔後,在測試的部署環境中,使用以下指令進行安裝。
ISO=ubuntu-18.04.2-server-amd64.iso
USERNAME=`whoami`
PASSWORD=iamironman
for NODE in master1 worker1 worker2
do
        VBoxManage storageattach ${NODE} \
                --storagectl "IDE Controller" --port 0 --device 0 \ 
                --type dvddrive --medium ${ISO}
        # unattended installation https://www.debian.org/releases/etch/ia64/apbs04.html.zh_CN
        VBoxManage unattended install \
                ${NODE} \
                --iso=${ISO} \
                --hostname=${NODE}.localhost \
                --user=${USERNAME} --password=${PASSWORD} \
                --locale=en_US --country=TW --time-zone=UTC \
                --script-template=ubuntu-preseed.cfg \
                --start-vm=headless
done
其中的 ubuntu-preceeding.cfg 可參考範例:https://raw.githubusercontent.com/tarlety/kubernetes-onpremises-bootstrap-example/master/ubuntu-preseed.cfg
等待虛擬機完成安裝:
接下來將簡單介紹什麼是 ceph。ceph 將作為本次本地部署 kubernetes 集群的持久化儲存。