安裝k8s-v1.10.0

一、下載etcd v3.3.9node

二、etcd > install_etcd.sh > ip配置linux

刪除已有member目錄:rm rf /var/lib/etcd/*nginx

suse 12 sp3:
ETCD_LISTEN_IP=ifconfig eth0 | grep 'inet ' | awk '{print $2}' | awk -F":" '{print $2}'git

centos 7:
ETCD_LISTEN_IP=ifconfig ens192 | grep 'inet ' | awk '{print $2}'github

./install_etcd.sh etcd01 etcd01=http://192.168.1.51:2380,etcd02=http://192.168.1.52:2380
./install_etcd.sh etcd02 etcd01=http://192.168.1.51:2380,etcd02=http://192.168.1.52:2380docker

驗證 >> bin/etcdctl member list
localhost:/home/cxiong/Desktop/k8s_v1.10.0_install/etcd # ./bin/etcdctl member list
ab736a9ecf6d37b3: name=etcd02 peerURLs=http://192.168.1.52:2380 clientURLs=http://192.168.1.52:2379 isLeader=false
bd317460717738be: name=etcd01 peerURLs=http://192.168.1.51:2380 clientURLs=http://192.168.1.51:2379 isLeader=truecentos

三、下載flannel v0.10.0負載均衡

suse 12 修改網卡接口 > IFACE="eth0"ide

./install_flannel.sh http://192.168.1.51:2379,http://192.168.1.52:2379代理

驗證 > ifconfig flannel.1

localhost:/home/cxiong/Desktop/k8s_v1.10.0_install/flannel # ifconfig flannel.1
flannel.1 Link encap:Ethernet HWaddr 12:D8:E2:E8:E1:59
inet addr:172.18.89.0 Bcast:0.0.0.0 Mask:255.255.255.255
inet6 addr: fe80::10d8:e2ff:fee8:e159/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1450 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:7 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)

驗證> etcdctl ls /cmpk8s/network/subnets
localhost:/home/cxiong/Desktop/k8s_v1.10.0_install/flannel # ../etcd/bin/etcdctl ls /cmpk8s/network/subnets
/cmpk8s/network/subnets/172.18.92.0-24
/cmpk8s/network/subnets/172.18.89.0-24

四、安裝docker 18.03

./install-docker.sh docker-18.03.0-ce.tgz

驗證 > ifconfig docker0
localhost:/home/cxiong/Desktop/k8s_v1.10.0_install/docker # ifconfig docker0
docker0 Link encap:Ethernet HWaddr 02:42:86:5D:35:FF
inet addr:172.18.92.1 Bcast:172.18.92.255 Mask:255.255.255.0
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)

五、安裝kubernetes 1.10

master節點:
./install_k8s_master.sh 192.168.1.51 http://192.168.1.51:2379,http://192.168.1.52:2379
million節點:
./install_k8s_node.sh 192.168.1.51

master節點驗證:
驗證> kubectl get cs
驗證> kubectl get nodes

六、本地倉庫registry

七、反向代理nginx
Nginx做爲集羣入口服務,從功能上說,通常都是充當反向代理和負載均衡的角色。在咱們這裏它更可能是用於反向代理,由於負載均衡的事情「移交」給了K8s去實現了。

八、pod操做建立 kubectl create -f xxx.yaml查詢 kubectl get pod yourPodNamekubectl describe pod yourPodName刪除kubectl delete pod yourPodName更新kubectl replace /path/to/yourNewYaml.yaml

相關文章
相關標籤/搜索