File tree Expand file tree Collapse file tree 1 file changed +35
-7
lines changed Expand file tree Collapse file tree 1 file changed +35
-7
lines changed Original file line number Diff line number Diff line change @@ -917,9 +917,37 @@ scp -r /etc/yum.repos.d/kubernetes.repo root@k8s-node-1:/etc/yum.repos.d/
917
917
scp -r /etc/yum.repos.d/kubernetes.repo root@k8s-node-2:/etc/yum.repos.d/
918
918
919
919
920
+
921
+ 所有机子
922
+ iptables -P FORWARD ACCEPT
923
+
920
924
所有机子
921
925
yum install -y kubelet-1.13.2 kubeadm-1.13.2 kubectl-1.13.2 --disableexcludes=kubernetes
922
926
927
+
928
+ 所有机子
929
+ vim /etc/cni/net.d/10-flannel.conflist,内容
930
+ {
931
+ "name": "cbr0",
932
+ "plugins": [
933
+ {
934
+ "type": "flannel",
935
+ "delegate": {
936
+ "hairpinMode": true,
937
+ "isDefaultGateway": true
938
+ }
939
+ },
940
+ {
941
+ "type": "portmap",
942
+ "capabilities": {
943
+ "portMappings": true
944
+ }
945
+ }
946
+ ]
947
+ }
948
+
949
+
950
+
923
951
所有机子
924
952
vim /etc/systemd/system/kubelet.service.d/10-kubeadm.conf
925
953
最后一行添加:Environment="KUBELET_CGROUP_ARGS=--cgroup-driver=cgroupfs"
@@ -987,8 +1015,14 @@ sudo chown $(id -u):$(id -g) $HOME/.kube/config
987
1015
查询我们的 token
988
1016
kubeadm token list
989
1017
990
-
991
1018
kubectl cluster-info
1019
+
1020
+
1021
+ master 安装 Flannel
1022
+ cd /opt && wget https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml
1023
+
1024
+ kubectl apply -f /opt/kube-flannel.yml
1025
+
992
1026
```
993
1027
994
1028
- 到 node 节点进行加入:
@@ -1008,12 +1042,6 @@ etcd-0 Healthy {"health": "true"}
1008
1042
1009
1043
1010
1044
1011
- master 安装 Flannel
1012
- cd /opt && wget https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml
1013
-
1014
- kubectl apply -f /opt/kube-flannel.yml
1015
-
1016
-
1017
1045
验证:
1018
1046
kubectl get pods --all-namespaces
1019
1047
kubectl get nodes
You can’t perform that action at this time.
0 commit comments