
kubesphere-v4.1.2離線安裝網(wǎng)上已經(jīng)有很多安裝部署kubesphere的安裝部署教程了我這主要是提供一套安裝包離線安裝包鏈接我放到文章末尾了,安裝包比較大。自己做的離線安裝包親測有效。1. 操作系統(tǒng)操作系統(tǒng)ubuntu22.04 、centos7.8、centos7.92.下載部署資料需要的文件如下上傳到服務器 config-sample.yaml create_project_harbor.sh helm-v3.15.0-linux-amd64.tar.gz kk ks-core-1.1.3.tgz kubesphere-v412-v1306-artifact.tar.gz3.根據(jù)實際情況修改配置文件config-sample.yaml是安裝配置文件需要根據(jù)實際情況修改特別注意etcd節(jié)點與registry節(jié)點不能是同一個節(jié)點否則會報錯 apiVersion: kubekey.kubesphere.io/v1alpha2 kind: Cluster metadata: name: sample spec: hosts: - {name: registry, address: 192.168.15.122, internalAddress: 192.168.15.122, user: root, password: xxx} - {name: master, address: 192.168.15.127, internalAddress: 192.168.15.127, user: root, password: xxx} - {name: node2, address: 192.168.15.137, internalAddress: 192.168.15.137, user: root, password: xxx} roleGroups: etcd: - master control-plane: - master worker: - node2 registry: - registry controlPlaneEndpoint: ## Internal loadbalancer for apiservers # internalLoadbalancer: haproxy domain: lb.kubesphere.local address: port: 6443 kubernetes: version: v1.26.12 containerManager: containerd #containerManager: docker #選擇容器類型 network: plugin: calico kubePodsCIDR: 10.233.64.0/18 kubeServiceCIDR: 10.233.0.0/18 ## multus support. https://github.com/k8snetworkplumbingwg/multus-cni multusCNI: enabled: false registry: # 如需使用 kk 部署 harbor, 可將該參數(shù)設置為 harbor不設置該參數(shù)且需使用 kk 創(chuàng)建容器鏡像倉庫將默認使用 docker registry。 type: harbor # 如使用 kk 部署的 harbor 或其他需要登錄的倉庫需設置對應倉庫的 auths如使用 kk 創(chuàng)建默認的 docker registry 倉庫則無需配置 auths 參數(shù)。 auths: dockerhub.kubekey.local: username: admin password: Harbor12345 skipTLSVerify: true privateRegistry: dockerhub.kubekey.local namespaceOverride: kubesphereio registryMirrors: [] insecureRegistries: [] addons: []修改host要安裝的機器列表配置在這里修改groupgroup中分了etcd、control panel、worker、registry等根據(jù)實際情況修改配置registry要安裝harbor的話需要配置集群內(nèi)部域名指向harbor還有賬號密碼也需要配置4.創(chuàng)建鏡像倉庫需要registry節(jié)點上80端口未占用然后執(zhí)行如下命令./kk init registry -f config-sample.yaml -a kubesphere-v412-v1306-artifact.tar.gz如果顯示如下信息則表明鏡像倉庫創(chuàng)建成功。Pipeline[InitRegistryPipeline] execute successfully創(chuàng)建harbor項目編輯create_project_harbor.sh添加一個值kubesphereio然后執(zhí)行./create_project_harbor.sh5.安裝Kubernetes./kk create cluster -f config-sample.yaml -a kubesphere-v412-v1306-artifact.tar.gz --with-local-storage #安裝的時候可能服務器會缺一些依賴手動安裝一下就OK了1.指定 --with-local-storage 參數(shù)會默認部署 openebs localpv如需對接其他存儲可在 Kubernetes 集群部署完成后自行安裝。2.如果顯示如下信息則表明 Kubernetes 集群創(chuàng)建成功。Pipeline[CreateclusterPipeline] execute successfullyInstallation is complete.6.安裝helmtar -zxvf helm-v3.15.0-linux-amd64.tar.gz sudo mv linux-amd64/helm /usr/local/bin/helm7. 安裝KubeSphere安裝kubesphere需要在master節(jié)點操作。helm upgrade --install -n kubesphere-system --create-namespace ks-core ks-core-1.1.3.tgz \ --set global.imageRegistrydockerhub.kubekey.local/ks \ --set extension.imageRegistrydockerhub.kubekey.local/ks \ --set ksExtensionRepository.image.tagv1.1.2 \ --set ha.enabledtrue,redisHA.enabledtrue \ --debug \ --wait ksExtensionRepository.image.tag 為之前獲取到的 Extensions Museum 版本即 https://get-images.kubesphere.io/ 上展示的最新擴展組件倉庫版本。 如需高可用部署 KubeSphere可在命令中添加 --set ha.enabledtrue,redisHA.enabledtrue如果顯示如下信息則表明 KubeSphere 安裝成功NOTES: Thank you for choosing KubeSphere Helm Chart. Please be patient and wait for several seconds for the KubeSphere deployment to complete. 1. Wait for Deployment Completion Confirm that all KubeSphere components are running by executing the following command: kubectl get pods -n kubesphere-system 2. Access the KubeSphere Console Once the deployment is complete, you can access the KubeSphere console using the following URL: http://192.168.6.6:30880 3. Login to KubeSphere Console Use the following credentials to log in: Account: admin Password: P88w0rd NOTE: It is highly recommended to change the default password immediately after the first login. For additional information and details, please visit https://kubesphere.io.提示信息中包含了訪問地址和賬號、密碼如果安裝后不小心關掉了ssh連接可以使用如下命令查看kubectl logs -n kubesphere-system $(kubectl get pod -n kubesphere-system -l app in (ks-install, ks-installer) -o jsonpath{.items[0].metadata.name}) -f訪問驗證從成功信息中的 Console、Account 和 Password 參數(shù)分別獲取 KubeSphere Web 控制臺的 IP 地址、管理員用戶名和管理員密碼并使用網(wǎng)頁瀏覽器登錄 KubeSphere Web 控制臺。說明取決于您的硬件和網(wǎng)絡環(huán)境您可能需要配置流量轉發(fā)規(guī)則并在防火墻中放行 30880 端口。離線安裝包地址通過網(wǎng)盤分享的文件kubeshpere4.1.2鏈接https://pan.baidu.com/s/1VVyQJlxnZByz4mn5h8T7RA?pwdc4hk提取碼c4hk