@@ -854,21 +854,21 @@ sudo chmod +x /usr/local/bin/docker-compose
854
854
855
855
```
856
856
主机时间同步
857
- systemctl start chronyd.service
858
- systemctl enable chronyd.service
857
+ systemctl start chronyd.service && systemctl enable chronyd.service
859
858
860
859
systemctl stop firewalld.service
861
860
systemctl disable firewalld.service
862
861
systemctl disable iptables.service
863
862
864
863
865
- setenforce 0
866
-
867
- sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config
864
+ setenforce 0 && sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config
868
865
869
866
swapoff -a && sysctl -w vm.swappiness=0
870
867
871
868
869
+
870
+
871
+
872
872
hostnamectl --static set-hostname k8s-master-1
873
873
hostnamectl --static set-hostname k8s-node-1
874
874
hostnamectl --static set-hostname k8s-node-2
@@ -942,6 +942,7 @@ sysctl --system
942
942
- 初始化 master 节点:
943
943
944
944
```
945
+ echo 1 > /proc/sys/net/ipv4/ip_forward
945
946
946
947
推荐:
947
948
kubeadm init \
@@ -970,7 +971,7 @@ Run "kubectl apply -f [podnetwork].yaml" with one of the options listed at:
970
971
You can now join any number of machines by running the following on each node
971
972
as root:
972
973
973
- kubeadm join 192.168.0.127:6443 --token 53mly1.yf9llsghle20p2uq --discovery-token-ca-cert-hash sha256:a9f26eef42c30d9f4b20c52058a2eaa696edc3f63ba20be477fe1494ec0146f7
974
+ kubeadm join 192.168.0.127:6443 --token 84kj2n.1kdj36xcsvyzx29i --discovery-token-ca-cert-hash sha256:bcd2edf9878e82db6f73f1253e8d6b6e7b91160db706f7ee59b9a9e32c6099e3
974
975
975
976
976
977
@@ -999,8 +1000,9 @@ kubectl cluster-info
999
1000
- 到 node 节点进行加入:
1000
1001
1001
1002
```
1003
+ echo 1 > /proc/sys/net/bridge/bridge-nf-call-iptables
1002
1004
1003
- kubeadm join 192.168.0.127:6443 --token 53mly1.yf9llsghle20p2uq --discovery-token-ca-cert-hash sha256:a9f26eef42c30d9f4b20c52058a2eaa696edc3f63ba20be477fe1494ec0146f7
1005
+ kubeadm join 192.168.0.127:6443 --token 84kj2n.1kdj36xcsvyzx29i --discovery-token-ca-cert-hash sha256:bcd2edf9878e82db6f73f1253e8d6b6e7b91160db706f7ee59b9a9e32c6099e3
1004
1006
1005
1007
1006
1008
在 master 节点上:kubectl get cs
0 commit comments