1 下载kubesphere3.0.0离线安装包
curl -Ok https://kubesphere-installer.pek3b.qingstor.com/offline/v3.0.0/kubesphere-all-v3.0.0-offline-linux-amd64.tar.gz
解压kubesphere-all-v3.0.0-offline-linux-amd64.tar.gz后进入执行kk命令
tar -zxvf kubesphere-all-v3.0.0-offline-linux-amd64.tar.gz
cd kubesphere-all-v3.0.0-offline-linux-amd64
./kk create config --with-kubesphere v3.0.0 --with-kubernetes v1.18.6
修改config-sample.yaml配置文件
执行内部镜像仓库源
./kk init os -f config-sample.yaml -s ./dependencies/ --add-images-repo
提示信息如下:
INFO[17:41:00 CST] Init operating system
INFO[17:41:00 CST] Start initializing kubesphere-master03 [192.168.3.103] node=192.168.3.103
INFO[17:41:00 CST] Start initializing kubesphere-master01 [192.168.3.101] node=192.168.3.101
INFO[17:41:00 CST] Start initializing kubesphere-master02 [192.168.3.102] node=192.168.3.102
Push /root/kubesphere-all-v3.0.0-offline-linux-amd64/dependencies/centos-7-amd64-rpms.tar.gz to 192.168.3.101:/tmp Done
Push /root/kubesphere-all-v3.0.0-offline-linux-amd64/dependencies/centos-7-amd64-rpms.tar.gz to 192.168.3.103:/tmp Done
Push /root/kubesphere-all-v3.0.0-offline-linux-amd64/dependencies/centos-7-amd64-rpms.tar.gz to 192.168.3.102:/tmp Done
INFO[17:41:35 CST] Complete initialization kubesphere-master01 [192.168.3.101] node=192.168.3.101
INFO[17:41:50 CST] Complete initialization kubesphere-master03 [192.168.3.103] node=192.168.3.103
INFO[17:41:50 CST] Complete initialization kubesphere-master02 [192.168.3.102] node=192.168.3.102
Local images repository created successfully. Address: dockerhub.kubekey.local
INFO[17:42:04 CST] Init operating system successful.
docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
31b9c6d1b7da registry:2 "/entrypoint.sh /etc…" About a minute ago Up About a minute 0.0.0.0:443->443/tcp, 5000/tcp kubekey-registry
推送镜像到私有仓库:
cd kubesphere-images-v3.0.0/
./push-images.sh dockerhub.kubekey.local
开始部署
./kk create cluster -f config-sample.yaml
kubectl logs -n kubesphere-system $(kubectl get pod -n kubesphere-system -l app=ks-install -o jsonpath=‘{.items[0].metadata.name}’) -f
全部步骤:
1 ip add
2 poweroff
3 ip add
4 ip add
5 cd /etc/sysconfig/network-scripts/
6 ls -ls
7 mv ifcfg-ens3 ifcfg-eth0
8 vi ifcfg-eth0
9 vi /etc/default/grub
10 grub2-mkconfig -o /boot/grub2/grub.cfg
11 reboot
12 ip add
13 poweroff
14 hostnamectl set-hostname kubesphere-master01
15 exit
16 vi /etc/sysconfig/network-scripts/ifcfg-eth0
17 systemctl restart network
18 vi /etc/hosts
19 ping kubesphere-master01
20 ping kubesphere-master02
21 ping kubesphere-master03
22 systemctl status firewalld
23 systemctl stop firewalld
24 systemctl disable firewalld
25 setenforce 0
26 vi /etc/selinux/config
27 yum install -y socat conntrack ebtables ipset
28 systemctl status chronyd
29 vi /etc/chrony.conf
30 systemctl restart chronyc
31 systemctl restart chronyd
32 chronyc sources
33 cat /etc/hosts
34 poweroff
35 date
36 chronyc sources
37 date
38 vi /etc/chrony.conf
39 systemctl restart chronyd
40 chronyc sources
41 poweroff
42 ls
43 ls -lsh
44 cd kubesphere-all-v3.0.0-offline-linux-amd64
45 ls
46 du .
47 du -h .
48 cd ..
49 ls
50 du -h kubesphere-all-v3.0.0-offline-linux-amd64
51 du -h .
52 ls
53 ls -ls
54 du -h kubesphere-all-v3.0.0-offline-linux-amd64/*
55 du -sh kubesphere-all-v3.0.0-offline-linux-amd64
56 pwd
57 ls
58 cd kubesphere-all-v3.0.0-offline-linux-amd64
59 ls
60 ./kk create config --with-kubesphere v3.0.0 --with-kubernetes v1.18.6
61 ls
62 vi config-sample.yaml
63 ls
64 ./kk init os -f config-sample.yaml -s ./dependencies/ --add-images-repo
65 docker ps
66 ls
67 cd kubesphere-images-v3.0.0/
68 ls
69 ./push-images.sh dockerhub.kubekey.local
70 ls
71 cd ..
72 ls
73 ./kk create cluster -f config-sample.yaml
74 poweroff
75 cat /etc/hosts
76 chronyc sources
77 ls
78 rm -rf kubesphere-all-v3.0.0-offline-linux-amd64.tar.gz
79 ls
80 curl -Ok https://kubesphere-installer.pek3b.qingstor.com/offline/v3.0.0/kubesphere-all-v3.0.0-offline-linux-amd64.tar.gz
81 ls
82 rm -rf kubesphere-all-v3.0.0-offline-linux-amd64.tar.gz
83 ls
84 tar -vfzx kubesphere-all-v3.0.0-offline-linux-amd64.tar.gz
85 tar -zxvf kubesphere-all-v3.0.0-offline-linux-amd64.tar.gz
86 docker pull busybox
87 docker tag busybox:latest dockerhub.kubekey.local/busybox:latest
88 docker push dockerhub.kubekey.local/busybox:latest
89 docker images | grep docker
90 docker images | grep busy
91 df -h
92 docker images | grep busy
93 docker rmi busybox
94 docker rmi busybox:1.31.1
95 docker rmi dockerhub.kubekey.local/busybox
96 docker images | grep busy
97 docker images | grep box
98 docker images | grep busy
99 ls
100 cd kubesphere-all-v3.0.0-offline-linux-amd64
101 ls
102 ./kk create cluster -f config-sample.yaml
103 kubectl logs -n kubesphere-system $(kubectl get pod -n kubesphere-system -l app=ks-install -o jsonpath='{.items[0].metadata.name}') -f
104 ls
105 vi config-sample.yaml
106 free -g
107 echo "1" > /proc/sys/vm/drop_caches
108 free -g
109 kubectl get pod --all-namespaces
110 history
111 free -g
112 history