1.準備部署環境
master 192.168.40.162
node 192.168.40.220node
2.下載部署包(從192.168.40.33複製部署包)
scp /opt/kylincloud2_2.0_ft2000_v0.0.1.13_20200511.tar.gz root@192.168.40.162:/opt/mysql
3.免密認證
經過192.168.40.192對192.168.40.162及192.168.40.220作免密認證,即master節點對自身及全部node節點作免密認證
(1)ssh-keygen -t rsa
(2)cat id_rsa.pub>>authorized_keys
(3)chmod 710 authorized_keys
(4)scp -r authorized_keys root@192.168.40.220:~/.sshsql
4.時間同步
(1)ntpdate 192.168.40.253(此命令分別執行在master及node)
將192.168.40.162和192.168.40.220統一與192.168.40.253時間保持一致,即master及全部節點保持統一一致時間
(2)hwclock -w(此命令分別執行在master及node)
將軟件時間寫入硬件時間,硬件時間是BIOS的時間docker
5.根據需求修改default.yaml文件bootstrap
示例一:(所有配置內容)
install_path: /opt/cms/kylincloud2 #安裝目錄api
modules:
etcd: etcd-3.3.13
docker: docker-17.03
kube: kube-1.14.2
keepalived: keepalived-1.3.5
cni: cni-arm64
cfssl: cfssl-1.3.2dom
clustername: kubernetes-phk
clusteruser: kubernetes-adminssh
registry:
domain: kylincloud2.hub
admin_password: Harbor12345
db:
host: mysql
port: 3306
user: root
passwd: root123
clair_password: passwordide
ntpserver: 192.168.40.253ui
nfs_server: 192.168.40.253
src_path: /mnt/nfs/testphk
storage: 192.168.40.253:/mnt/nfs/testphk /nas nfs defaults 0 1
mount_path: /nas
etcdname: kube-etcd
bootstrap_token: c30302226d4b810e08731702d3890f51
ui_url: ui.kylincloud2.hub
encryption_token: d/FP5wCz8lV9s+bU1tnvsuj9C4hZWZRcMVud18E0LMc=
dnsserver: 192.168.40.32
dnsport: 9999
vip: 192.168.40.33 #單控模式爲 master的ip,多控模式下爲虛擬ip,跟集羣同網段且不被佔用
virtual_router_id: 88 #keepalived 集羣通訊的心跳值,確保不跟網段中其餘keepalived集羣的心跳值一致便可
service:
cidr: 10.10.0.0/16
DNS_ip: 10.10.1.10
cluster_domain: cluster.local
pod_net:
cidr: 10.244.0.0/16
master:
nodes:
示例二:(本次部署所需配置)
install_path: /opt/cms/kylincloud2 #安裝目錄
modules:
etcd: etcd-3.3.13
docker: docker-17.03
kube: kube-1.14.2
keepalived: keepalived-1.3.5
cni: cni-arm64
cfssl: cfssl-1.3.2
clustername: kubernetes
clusteruser: kubernetes-admin
registry:
domain: kylincloud2.hub
admin_password: Harbor12345
db:
host: mysql
port: 3306
user: root
passwd: root123
clair_password: password
ntpserver: 192.168.40.253
nfs_server: 192.168.40.253
src_path: /mnt/nfs/testphk
storage: 192.168.40.253:/mnt/nfs/testphk /nas nfs defaults 0 1
mount_path: /nas
etcdname: kube-etcd
bootstrap_token: c30302226d4b810e08731702d3890f51
ui_url: ui.kylincloud2.hub
encryption_token: d/FP5wCz8lV9s+bU1tnvsuj9C4hZWZRcMVud18E0LMc=
dnsserver: 192.168.40.162
dnsport: 9999
vip: 192.168.40.162 #單控模式爲 master的ip,多控模式下爲虛擬ip,跟集羣同網段且不被佔用
virtual_router_id: 41 #keepalived 集羣通訊的心跳值,確保不跟網段中其餘keepalived集羣的心跳值一致便可
service:
cidr: 10.10.0.0/16
DNS_ip: 10.10.1.10
cluster_domain: cluster.local
pod_net:
cidr: 10.244.0.0/16
master:
6.開始部署
./install --master
7.驗證部署是否成功 kubectl get po -A -o wide