日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

kubesphere 3.0离线安装

發布時間:2025/1/21 编程问答 34 豆豆
生活随笔 收集整理的這篇文章主要介紹了 kubesphere 3.0离线安装 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

離線安裝

離線安裝幾乎與在線安裝相同,不同之處是您必須創建一個本地倉庫來托管 Docker 鏡像。本教程演示了如何在離線環境中將 KubeSphere 安裝到 Kubernetes 上。

開始下方步驟之前,請先參閱準備工作。

步驟 1:準備一個私有鏡像倉庫

您可以使用 Harbor 或者其他任意私有鏡像倉庫。本教程以 Docker 倉庫作為示例,并使用自簽名證書(如果您有自己的私有鏡像倉庫,可以跳過這一步)。

使用自簽名證書

  • 執行以下命令生成您自己的證書:

    mkdir -p certs openssl req \ -newkey rsa:4096 -nodes -sha256 -keyout certs/domain.key \ -x509 -days 36500 -out certs/domain.crt
  • 當您生成自己的證書時,請確保在字段 Common Name 中指定一個域名。例如,本示例中該字段被指定為 dockerhub.kubekey.local。

  • 啟動 Docker 倉庫

    執行以下命令啟動 Docker 倉庫:

    docker run -d \--restart=always \--name registry \-v "$(pwd)"/certs:/certs \-v /mnt/registry:/var/lib/registry \-e REGISTRY_HTTP_ADDR=0.0.0.0:443 \-e REGISTRY_HTTP_TLS_CERTIFICATE=/certs/domain.crt \-e REGISTRY_HTTP_TLS_KEY=/certs/domain.key \-p 443:443 \registry:2

    備注

    Docker 使用 /var/lib/docker 作為默認路徑來存儲所有 Docker 相關文件(包括鏡像)。建議您添加附加存儲卷,分別給 /var/lib/docker 和 /mnt/registry 掛載至少 100G。請參見 fdisk 的參考命令。

    配置倉庫

  • 在 /etc/hosts 中添加一個條目,將主機名(即倉庫域名;在本示例中是 dockerhub.kubekey.local)映射到您機器的私有 IP 地址,如下所示。

    # docker registry 192.168.0.2 dockerhub.kubekey.local
  • 執行以下命令,復制證書到指定目錄,并使 Docker 信任該證書。

    mkdir -p /etc/docker/certs.d/dockerhub.kubekey.local cp certs/domain.crt /etc/docker/certs.d/dockerhub.kubekey.local/ca.crt

    備注

    證書的路徑與域名相關聯。當您復制路徑時,如果與上面設置的路徑不同,請使用實際域名。

  • 要驗證私有倉庫是否有效,您可以先復制一個鏡像到您的本地機器,然后使用 docker push 和 docker pull 來測試。

  • 步驟 2:準備安裝鏡像

    當您在離線環境中安裝 KubeSphere 時,需要事先準備一個包含所有必需鏡像的鏡像包。

  • 使用以下命令從能夠訪問互聯網的機器上下載鏡像清單文件 images-list.txt:

    curl -L -O https://github.com/kubesphere/ks-installer/releases/download/v3.0.0/images-list.txt

    備注

    該文件根據不同的模塊列出了 ##+modulename 下的鏡像。您可以按照相同的規則把自己的鏡像添加到這個文件中。要查看完整文件,請參見附錄。

  • 下載 offline-installation-tool.sh。

    curl -L -O https://github.com/kubesphere/ks-installer/releases/download/v3.0.0/offline-installation-tool.sh
  • 使 .sh 文件可執行。

    chmod +x offline-installation-tool.sh
  • 您可以執行命令 ./offline-installation-tool.sh -h 來查看如何使用腳本:

    root@master:/home/ubuntu# ./offline-installation-tool.sh -h Usage:./offline-installation-tool.sh [-l IMAGES-LIST] [-d IMAGES-DIR] [-r PRIVATE-REGISTRY] [-v KUBERNETES-VERSION ]Description:-b : save kubernetes' binaries.-d IMAGES-DIR : the dir of files (tar.gz) which generated by `docker save`. default: ./kubesphere-images-l IMAGES-LIST : text file with list of images.-r PRIVATE-REGISTRY : target private registry:port.-s : save model will be applied. Pull the images in the IMAGES-LIST and save images as a tar.gz file.-v KUBERNETES-VERSION : download kubernetes' binaries. default: v1.17.9-h : usage message
  • 在 offline-installation-tool.sh 中拉取鏡像。

    ./offline-installation-tool.sh -s -l images-list.txt -d ./kubesphere-images

    備注

    您可以根據需要選擇拉取的鏡像。例如,如果已經有一個 Kubernetes 集群了,您可以在 images-list.text 中刪除 ##k8s-images 和在它下面的相關鏡像。

  • 步驟 3:推送鏡像至私有倉庫

    將打包的鏡像文件傳輸至您的本地機器,并運行以下命令把它推送至倉庫。

    ./offline-installation-tool.sh -l images-list.txt -d ./kubesphere-images -r dockerhub.kubekey.local

    備注

    命令中的域名是 dockerhub.kubekey.local。請確保使用您自己倉庫的地址

    步驟 4:下載部署文件

    與在現有 Kubernetes 集群上在線安裝 KubeSphere 相似,您也需要事先下載 cluster-configuration.yaml 和 kubesphere-installer.yaml。

  • 執行以下命令下載這兩個文件,并將它們傳輸至您充當任務機的機器,用于安裝。

    curl -L -O https://github.com/kubesphere/ks-installer/releases/download/v3.0.0/cluster-configuration.yaml curl -L -O https://github.com/kubesphere/ks-installer/releases/download/v3.0.0/kubesphere-installer.yaml
  • 編輯 cluster-configuration.yaml 添加您的私有鏡像倉庫。例如,本教程中的倉庫地址是 dockerhub.kubekey.local,將它用作 .spec.local_registry 的值,如下所示:

    spec:persistence:storageClass: ""authentication:jwtSecret: ""local_registry: dockerhub.kubekey.local # Add this line manually; make sure you use your own registry address.

    備注

    您可以在該 YAML 文件中啟用可插拔組件,體驗 KubeSphere 的更多功能。有關詳情,請參考啟用可插拔組件。

  • 編輯完成后保存 cluster-configuration.yaml。使用以下命令將 ks-installer 替換為您自己倉庫的地址

    sed -i "s#^\s*image: kubesphere.*/ks-installer:.*# image: dockerhub.kubekey.local/kubesphere/ks-installer:v3.0.0#" kubesphere-installer.yaml

    警告

    命令中的倉庫地址是 dockerhub.kubekey.local。請確保使用您自己倉庫的地址。

  • 步驟 5:開始安裝

    確定完成上面所有步驟后,您可以執行以下命令。

    kubectl apply -f kubesphere-installer.yaml kubectl apply -f cluster-configuration.yaml

    步驟 6:驗證安裝

    安裝完成后,您會看到以下內容:

    ##################################################### ### Welcome to KubeSphere! ### #####################################################Console: http://192.168.0.2:30880 Account: admin Password: P@88w0rdNOTES:1. After logging into the console, please check themonitoring status of service components inthe "Cluster Management". If any service is notready, please wait patiently until all componentsare ready.2. Please modify the default password after login.##################################################### https://kubesphere.io 20xx-xx-xx xx:xx:xx #####################################################

    現在,您可以通過 http://{IP}:30880 使用默認帳戶和密碼 admin/P@88w0rd 訪問 KubeSphere 的 Web 控制臺。

    備注

    要訪問控制臺,請確保在您的安全組中打開端口 30880。

    附錄

    KubeSphere v3.0.0 鏡像清單

    ##k8s-images kubesphere/kube-apiserver:v1.17.9 kubesphere/kube-scheduler:v1.17.9 kubesphere/kube-proxy:v1.17.9 kubesphere/kube-controller-manager:v1.17.9 kubesphere/kube-apiserver:v1.18.6 kubesphere/kube-scheduler:v1.18.6 kubesphere/kube-proxy:v1.18.6 kubesphere/kube-controller-manager:v1.18.6 kubesphere/kube-apiserver:v1.16.13 kubesphere/kube-scheduler:v1.16.13 kubesphere/kube-proxy:v1.16.13 kubesphere/kube-controller-manager:v1.16.13 kubesphere/kube-apiserver:v1.15.12 kubesphere/kube-scheduler:v1.15.12 kubesphere/kube-proxy:v1.15.12 kubesphere/kube-controller-manager:v1.15.12 kubesphere/pause:3.1 kubesphere/pause:3.2 kubesphere/etcd:v3.3.12 calico/kube-controllers:v3.15.1 calico/node:v3.15.1 calico/cni:v3.15.1 calico/pod2daemon-flexvol:v3.15.1 coredns/coredns:1.6.9 kubesphere/k8s-dns-node-cache:1.15.12 kubesphere/node-disk-manager:0.5.0 kubesphere/node-disk-operator:0.5.0 kubesphere/provisioner-localpv:1.10.0 kubesphere/linux-utils:1.10.0 kubesphere/nfs-client-provisioner:v3.1.0-k8s1.11##ks-core-images kubesphere/ks-apiserver:v3.0.0 kubesphere/ks-console:v3.0.0 kubesphere/ks-controller-manager:v3.0.0 kubesphere/ks-installer:v3.0.0 kubesphere/etcd:v3.2.18 kubesphere/kubectl:v1.0.0 kubesphere/ks-upgrade:v3.0.0 kubesphere/ks-devops:flyway-v3.0.0 redis:5.0.5-alpine alpine:3.10.4 haproxy:2.0.4 mysql:8.0.11 nginx:1.14-alpine minio/minio:RELEASE.2019-08-07T01-59-21Z minio/mc:RELEASE.2019-08-07T23-14-43Z mirrorgooglecontainers/defaultbackend-amd64:1.4 kubesphere/nginx-ingress-controller:0.24.1 osixia/openldap:1.3.0 csiplugin/snapshot-controller:v2.0.1 kubesphere/kubefed:v0.3.0 kubesphere/tower:v0.1.0 kubesphere/prometheus-config-reloader:v0.38.3 kubesphere/prometheus-operator:v0.38.3 prom/alertmanager:v0.21.0 prom/prometheus:v2.20.1 kubesphere/node-exporter:ks-v0.18.1 jimmidyson/configmap-reload:v0.3.0 kubesphere/notification-manager-operator:v0.1.0 kubesphere/notification-manager:v0.1.0 kubesphere/metrics-server:v0.3.7 kubesphere/kube-rbac-proxy:v0.4.1 kubesphere/kube-state-metrics:v1.9.6##ks-logging-images kubesphere/elasticsearch-oss:6.7.0-1 kubesphere/elasticsearch-curator:v5.7.6 kubesphere/fluentbit-operator:v0.2.0 kubesphere/fluentbit-operator:migrator kubesphere/fluent-bit:v1.4.6 elastic/filebeat:6.7.0 kubesphere/kube-auditing-operator:v0.1.0 kubesphere/kube-auditing-webhook:v0.1.0 kubesphere/kube-events-exporter:v0.1.0 kubesphere/kube-events-operator:v0.1.0 kubesphere/kube-events-ruler:v0.1.0 kubesphere/log-sidecar-injector:1.1 docker:19.03##istio-images istio/citadel:1.4.8 istio/galley:1.4.8 istio/kubectl:1.4.8 istio/mixer:1.4.8 istio/pilot:1.4.8 istio/proxyv2:1.4.8 istio/sidecar_injector:1.4.8 jaegertracing/jaeger-agent:1.17 jaegertracing/jaeger-collector:1.17 jaegertracing/jaeger-operator:1.17.1 jaegertracing/jaeger-query:1.17 jaegertracing/jaeger-es-index-cleaner:1.17.1##ks-devops-images jenkins/jenkins:2.176.2 jenkins/jnlp-slave:3.27-1 kubesphere/jenkins-uc:v3.0.0 kubesphere/s2ioperator:v2.1.1 kubesphere/s2irun:v2.1.1 kubesphere/builder-base:v2.1.0 kubesphere/builder-nodejs:v2.1.0 kubesphere/builder-maven:v2.1.0 kubesphere/builder-go:v2.1.0 kubesphere/s2i-binary:v2.1.0 kubesphere/tomcat85-java11-centos7:v2.1.0 kubesphere/tomcat85-java11-runtime:v2.1.0 kubesphere/tomcat85-java8-centos7:v2.1.0 kubesphere/tomcat85-java8-runtime:v2.1.0 kubesphere/java-11-centos7:v2.1.0 kubesphere/java-8-centos7:v2.1.0 kubesphere/java-8-runtime:v2.1.0 kubesphere/java-11-runtime:v2.1.0 kubesphere/nodejs-8-centos7:v2.1.0 kubesphere/nodejs-6-centos7:v2.1.0 kubesphere/nodejs-4-centos7:v2.1.0 kubesphere/python-36-centos7:v2.1.0 kubesphere/python-35-centos7:v2.1.0 kubesphere/python-34-centos7:v2.1.0 kubesphere/python-27-centos7:v2.1.0 kubesphere/notification:flyway_v2.1.2 kubesphere/notification:v2.1.2 kubesphere/alert-adapter:v3.0.0 kubesphere/alerting-dbinit:v3.0.0 kubesphere/alerting:v2.1.2##openpitrix-images openpitrix/generate-kubeconfig:v0.5.0 openpitrix/openpitrix:flyway-v0.5.0 openpitrix/openpitrix:v0.5.0 openpitrix/release-app:v0.5.0##example-images kubesphere/examples-bookinfo-productpage-v1:1.13.0 kubesphere/examples-bookinfo-reviews-v1:1.13.0 kubesphere/examples-bookinfo-reviews-v2:1.13.0 kubesphere/examples-bookinfo-reviews-v3:1.13.0 kubesphere/examples-bookinfo-details-v1:1.13.0 kubesphere/examples-bookinfo-ratings-v1:1.13.0 busybox:1.31.1 joosthofman/wget:1.0 kubesphere/netshoot:v1.0 nginxdemos/hello:plain-text wordpress:4.8-apache mirrorgooglecontainers/hpa-example:latest java:openjdk-8-jre-alpine fluent/fluentd:v1.4.2-2.0 perl:latest##csi-images csiplugin/csi-neonsan:v1.2.0 csiplugin/csi-neonsan-ubuntu:v1.2.0 csiplugin/csi-neonsan-centos:v1.2.0 csiplugin/csi-provisioner:v1.5.0 csiplugin/csi-attacher:v2.1.1 csiplugin/csi-resizer:v0.4.0 csiplugin/csi-snapshotter:v2.0.1 csiplugin/csi-node-driver-registrar:v1.2.0 csiplugin/csi-qingcloud:v1.2.0

    官網鏈接

    https://kubesphere.com.cn/docs/installing-on-kubernetes/on-prem-kubernetes/install-ks-on-linux-airgapped/

    總結

    以上是生活随笔為你收集整理的kubesphere 3.0离线安装的全部內容,希望文章能夠幫你解決所遇到的問題。

    如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。