23年容器云部署(vmware虚拟机)
主机名 | IP地址 | |
---|---|---|
master | 192.168.100.119 | |
node | 192.168.100.120 |
1、将安装包 chinaskills_cloud_paas_v2.1.iso 下载至 master 节点/root 目录,并解压到/opt 目 录
[root@master ~]# ls anaconda-ks.cfg chinaskills_cloud_paas_v2.1.iso [root@master ~]# mount -o loop chinaskills_cloud_paas_v2.1.iso /mnt/ mount: /dev/loop0 写保护,将以只读方式挂载 [root@master ~]# cp -rfv /mnt/* /opt/ "/mnt/dependencies" -> "/opt/dependencies" "/mnt/dependencies/packages-lists.txt" -> "/opt/dependencies/packages-lists.txt" "/mnt/dependencies/packages.tar.gz" -> "/opt/dependencies/packages.tar.gz" "/mnt/kubeeasy.tar.gz" -> "/opt/kubeeasy.tar.gz" "/mnt/kubeeasy-v2.0" -> "/opt/kubeeasy-v2.0" [root@master ~]# umount /mnt/
2、在 master 节点安装 kubeeasy 工具
[root@master ~]# mv /opt/kubeeasy-v2.0 /usr/bin/kubeeasy
3、安装依赖包
(虚拟机和云实例不一样,虚拟机需要手动去安装它的这些依赖包!!!)
[root@master ~]# cd /opt/dependencies/ [root@master dependencies]# ls packages-lists.txt packages.tar.gz [root@master dependencies]# tar -zxvf packages.tar.gz [root@master dependencies]# ls packages packages-lists.txt packages.tar.gz [root@master dependencies]# cd packages [root@master packages]# yum -y install * [root@master packages]# cd .. [root@master dependencies]# ls packages packages-lists.txt packages.tar.gz #将packages.tar.gz这个包,拷贝到node节点的/opt/dependencies目录下 [root@master dependencies]# scp packages.tar.gz root@192.168.100.120:/opt/ root@192.168.100.120's password: packages.tar.gz 100% 273MB 141.7MB/s 00:01 [root@node ~]# cd /opt/ [root@node opt]# ls packages.tar.gz [root@node opt]# tar -zxvf packages.tar.gz [root@node opt]# ls packages packages.tar.gz [root@node opt]# cd packages [root@node packages]# yum -y install * [root@master dependencies]# kubeeasy install depend --host 192.168.100.119,192.168.100.120 --user root --password 000000 --offline-file /opt/dependencies/packages.tar.gz #安装过程中可另外打开一个 master节点的窗口,使用“tail -f /var/log/kubeinstall.log”命令查看安装详细步骤。无任何报错就ok了!(像虚拟机手动安装好了依赖,他会提示不更新已安装的软件包,这个不用管!)
4、安装 Kubernetes 集群
[root@master ~]# kubeeasy install kubernetes --master 192.168.100.119 --worker 192.168.100.120 --user root --password 000000 --version 1.25.2 --offline-file /opt/kubeeasy.tar.gz ...... [2024-01-05 15:16:13] INFO: [cluster] kubernetes cluster status + kubectl get pods -A NAMESPACE NAME READY STATUS RESTARTS AGE harbor harbor-chartmuseum-7f94cbb46-b2wvc 1/1 Running 0 85s harbor harbor-core-7ddf4db595-69hwl 1/1 Running 0 85s harbor harbor-database-0 1/1 Running 0 85s harbor harbor-jobservice-7d9fb76957-qmcks 1/1 Running 3 (60s ago) 85s harbor harbor-nginx-7599458b66-9vp5h 1/1 Running 0 85s harbor harbor-notary-server-7694f56657-d4fdt 1/1 Running 0 85s harbor harbor-notary-signer-5858d446f4-b2kbv 1/1 Running 0 85s harbor harbor-portal-67d8547c5f-wt4wv 1/1 Running 0 85s harbor harbor-redis-0 1/1 Running 0 85s harbor harbor-registry-846f8b67fd-bw29v 2/2 Running 0 85s harbor harbor-trivy-0 1/1 Running 0 85s istio-system grafana-56bdf8bf85-jq2bz 1/1 Running 0 2m2s istio-system istio-egressgateway-fffc799cf-45qrj 1/1 Running 0 2m18s istio-system istio-ingressgateway-7d68764b55-qqrlf 1/1 Running 0 2m18s istio-system istiod-5456fd558d-z8w7s 1/1 Running 0 2m20s istio-system jaeger-c4fdf6674-kmbss 1/1 Running 0 2m1s istio-system kiali-8f955f859-7rdpd 1/1 Running 0 2m1s istio-system prometheus-85949fddb-b6clf 2/2 Running 0 2m kube-system coredns-565d847f94-nsfsz 1/1 Running 0 4m43s kube-system coredns-565d847f94-sxg5z 1/1 Running 0 4m43s kube-system dashboard-metrics-scraper-64bcc67c9c-n7pp7 1/1 Running 0 4m25s kube-system dashboard-portainer-695648f848-s6m7h 1/1 Running 0 85s kube-system etcd-k8s-master-node1 1/1 Running 0 4m58s kube-system kube-apiserver-k8s-master-node1 1/1 Running 0 4m57s kube-system kube-controller-manager-k8s-master-node1 1/1 Running 0 4m58s kube-system kube-flannel-ds-85zb4 1/1 Running 0 4m26s kube-system kube-flannel-ds-xltsl 1/1 Running 0 4m43s kube-system kube-proxy-x9xgf 1/1 Running 0 4m26s kube-system kube-proxy-z767d 1/1 Running 0 4m43s kube-system kube-scheduler-k8s-master-node1 1/1 Running 0 4m58s kube-system kubernetes-dashboard-74b66d7f9c-tk57k 1/1 Running 0 4m25s kube-system metrics-server-84c4f4fb8d-hdxpx 1/1 Running 0 4m21s kube-system nfs-client-provisioner-dd659f599-xzbgt 1/1 Running 0 3m49s kubevirt virt-api-5dd9ccbc96-gvwsx 1/1 Running 0 3m11s kubevirt virt-api-5dd9ccbc96-lz8d9 1/1 Running 0 3m11s kubevirt virt-controller-7659874849-fkwfn 1/1 Running 0 2m46s kubevirt virt-controller-7659874849-nzvmg 1/1 Running 0 2m46s kubevirt virt-handler-q8rjp 1/1 Running 0 2m46s kubevirt virt-handler-wpglx 1/1 Running 0 2m46s kubevirt virt-operator-5db8d9f8f9-d8hcd 1/1 Running 0 3m44s kubevirt virt-operator-5db8d9f8f9-vh2pz 1/1 Running 0 3m44s See detailed log >> /var/log/kubeinstall.log [root@master ~]# kubectl get nodes NAME STATUS ROLES AGE VERSION k8s-master-node1 Ready control-plane 6m34s v1.25.2 k8s-worker-node1 Ready <none> 5m59s v1.25.2 [root@master ~]# kubectl get pods -A NAMESPACE NAME READY STATUS RESTARTS AGE harbor harbor-chartmuseum-7f94cbb46-b2wvc 1/1 Running 0 3m14s harbor harbor-core-7ddf4db595-69hwl 1/1 Running 0 3m14s harbor harbor-database-0 1/1 Running 0 3m14s harbor harbor-jobservice-7d9fb76957-qmcks 1/1 Running 3 (2m49s ago) 3m14s harbor harbor-nginx-7599458b66-9vp5h 1/1 Running 0 3m14s harbor harbor-notary-server-7694f56657-d4fdt 1/1 Running 0 3m14s harbor harbor-notary-signer-5858d446f4-b2kbv 1/1 Running 0 3m14s harbor harbor-portal-67d8547c5f-wt4wv 1/1 Running 0 3m14s harbor harbor-redis-0 1/1 Running 0 3m14s harbor harbor-registry-846f8b67fd-bw29v 2/2 Running 0 3m14s harbor harbor-trivy-0 1/1 Running 0 3m14s istio-system grafana-56bdf8bf85-jq2bz 1/1 Running 0 3m51s istio-system istio-egressgateway-fffc799cf-45qrj 1/1 Running 0 4m7s istio-system istio-ingressgateway-7d68764b55-qqrlf 1/1 Running 0 4m7s istio-system istiod-5456fd558d-z8w7s 1/1 Running 0 4m9s istio-system jaeger-c4fdf6674-kmbss 1/1 Running 0 3m50s istio-system kiali-8f955f859-7rdpd 1/1 Running 0 3m50s istio-system prometheus-85949fddb-b6clf 2/2 Running 0 3m49s kube-system coredns-565d847f94-nsfsz 1/1 Running 0 6m32s kube-system coredns-565d847f94-sxg5z 1/1 Running 0 6m32s kube-system dashboard-metrics-scraper-64bcc67c9c-n7pp7 1/1 Running 0 6m14s kube-system dashboard-portainer-695648f848-s6m7h 1/1 Running 0 3m14s kube-system etcd-k8s-master-node1 1/1 Running 0 6m47s kube-system kube-apiserver-k8s-master-node1 1/1 Running 0 6m46s kube-system kube-controller-manager-k8s-master-node1 1/1 Running 0 6m47s kube-system kube-flannel-ds-85zb4 1/1 Running 0 6m15s kube-system kube-flannel-ds-xltsl 1/1 Running 0 6m32s kube-system kube-proxy-x9xgf 1/1 Running 0 6m15s kube-system kube-proxy-z767d 1/1 Running 0 6m32s kube-system kube-scheduler-k8s-master-node1 1/1 Running 0 6m47s kube-system kubernetes-dashboard-74b66d7f9c-tk57k 1/1 Running 0 6m14s kube-system metrics-server-84c4f4fb8d-hdxpx 1/1 Running 0 6m10s kube-system nfs-client-provisioner-dd659f599-xzbgt 1/1 Running 0 5m38s kubevirt virt-api-5dd9ccbc96-gvwsx 1/1 Running 0 5m kubevirt virt-api-5dd9ccbc96-lz8d9 1/1 Running 0 5m kubevirt virt-controller-7659874849-fkwfn 1/1 Running 0 4m35s kubevirt virt-controller-7659874849-nzvmg 1/1 Running 0 4m35s kubevirt virt-handler-q8rjp 1/1 Running 0 4m35s kubevirt virt-handler-wpglx 1/1 Running 0 4m35s kubevirt virt-operator-5db8d9f8f9-d8hcd 1/1 Running 0 5m33s kubevirt virt-operator-5db8d9f8f9-vh2pz 1/1 Running 0 5m33s
5、访问 Dashboard
http://<任意节点 IP>:30777
(访问dashboard页面,提示重启,将所有节点都重启一遍!)
(设置密码并登录)
6、访问 Harbor
http://IP 登录 Harbor(用户名:admin密码:Harbor12345)