当前位置: 首页 > news >正文

离线部署kubesphere(已有k8s和私有harbor的基础上)

前言说明:本文是在已有k8s集群和私有仓库harbor上进行离线安装kubesphere;官网的离线教程写都很详细,但是在部署部份把搭建集群和搭建仓库也写一起了,跟着做踩了点坑,这里就记录下来希望可以帮助到需要的xdm。

1.根据官网制作离线镜像包

按照官网的教程做离线包- 官网教程链接

做标红的部份

在这里插入图片描述

完成了离线包的制作并且上传到master节点后我们继续下面的内容!!!

2.推送镜像到私有仓库

直接生成一个默认的,然后我们只需要改动 registry 部份的内容

./kk create config --with-kubernetes v1.26.12
  1. 编辑 config-sample.yaml,只需要改仓库部分 registry:
apiVersion: kubekey.kubesphere.io/v1alpha2
kind: Cluster
metadata:
  name: sample
spec:
  hosts:
  - {name: node1, address: 172.16.0.2, internalAddress: 172.16.0.2, user: ubuntu, password: "Qcloud@123"}
  - {name: node2, address: 172.16.0.3, internalAddress: 172.16.0.3, user: ubuntu, password: "Qcloud@123"}
  roleGroups:
    etcd:
    - node1
    control-plane: 
    - node1
    worker:
    - node1
    - node2
  controlPlaneEndpoint:
    ## Internal loadbalancer for apiservers 
    # internalLoadbalancer: haproxy

    domain: lb.kubesphere.local
    address: ""
    port: 6443
  kubernetes:
    version: v1.28.2
    clusterName: cluster.local
    autoRenewCerts: true
    containerManager: containerd
  etcd:
    type: kubekey
  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, 可将该参数设置为 harbor,不设置该参数且需使用 kk 创建容器镜像仓库,将默认使用 docker registry。
    # type: harbor
    # 如使用 kk 部署的 harbor 或其他需要登录的仓库,需设置对应仓库的 auths,如使用 kk 创建默认的 docker registry 仓库,则无需配置 auths 参数。
    auths:
      "lzz.harbor.com":
        # 部署 harbor 时需指定 harbor 帐号密码
         username: admin
         password: Harbor12345
         skipTLSVerify: true
    # 设置集群部署时使用的私有仓库地址。如果您已有可用的镜像仓库,请替换为您的实际镜像仓库地址。
    # 如果离线包中为原始 dockerhub 镜像(即 manifest 文件中的镜像地址为 docker.io/***),可以将该参数设置为 dockerhub.kubekey.local/ks, 表示将镜像全部推送至名为 ks 的 harbor 项目中。
    privateRegistry: "lzz.harbor.com"
    # 如果构建离线包时 Kubernetes 镜像使用的是阿里云仓库镜像,需配置该参数。如果使用 dockerhub 镜像,则无需配置此参数。
    namespaceOverride: "kubesphereio"
    registryMirrors: []
    insecureRegistries: []
  addons: []



//推送仓库
./kk artifact image push -f config-sample.yaml -a kubesphere.tar.gz

推送成功:

3.安装kubesphere

安装helm

//解压
tar -zxvf helm-v3.14.0-linux-amd64.tar.gz
//移动到bin目录
sudo mv linux-amd64/helm /usr/local/bin/helm
//授权
sudo chmod +x /usr/local/bin/helm

要在上传ks-core-1.1.3.tgz的目录中执行

helm upgrade --install -n kubesphere-system --create-namespace ks-core ks-core-1.1.3.tgz \
     --set global.imageRegistry=lzz.harbor.com/ks \ #替换为自己的镜像仓库
     --set extension.imageRegistry=lzz.harbor.com/ks \ #替换为自己的镜像仓库
     --set ksExtensionRepository.image.tag=v1.1.4 \
     --debug \
     --wait

输入如下就是成功

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: P@88w0rd

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.


访问可视化页面
在这里插入图片描述
#搞定收工!

http://www.dtcms.com/a/111474.html

相关文章:

  • 鸿蒙 harmonyOS 网络请求
  • AWS云安全基线:构建企业级安全防护体系的完整指南
  • Ubuntu 安装 JMeter:为你的服务器配置做好准备
  • C++ - 宏基础(简单常量替换宏、函数样式的宏、多行宏、预定义宏、字符串化宏、连接宏、可变参数日志宏)
  • 深入理解C++引用:从基础到现代编程实践
  • 【设计模式】代理模式
  • 如何计算财富自由所需要的价格?
  • mapbox进阶,使用本地dem数据,加载hillshade山体阴影图层
  • 什么是缓存穿透、缓存雪崩、缓存击穿?
  • 使用VS2022远程调试Linux项目问题
  • Linux / Windows 下 Mamba / Vim / Vmamba 安装教程及安装包索引
  • 程序化广告行业(54/89):人群标签、用户标签与Look Alike原理详解
  • 鸿蒙NEXT开发随机工具类(ArkTs)
  • 【大模型基础_毛玉仁】6.5 实践与应用--RAG、Agent、LangChain
  • FPGA--HDLBits网站练习
  • 思维链、思维树、思维图与思维森林在医疗AI编程中的应用蓝图
  • ARXML文件解析-1
  • 14.流程自动化工具:n8n和家庭自动化工具:node-red
  • 解决LeetCode“使括号有效的最少添加”问题
  • Android Hilt 教程
  • 马斯克 AI 超算
  • 蓝桥云客---九宫幻方
  • ngx_ssl_init
  • 【2-7】脉码调制
  • Apache httpclient okhttp(2)
  • 【winodws】夜神模拟器虚拟机启动失败,请进行修复。关闭hyper-v
  • CSS Id 和 Class 选择器学习笔记
  • 【嵌入式-stm32电位器控制LED亮灭以及编码器控制LED亮灭】
  • 标准库文档
  • 基于时间卷积网络TCN实现电力负荷多变量时序预测(PyTorch版)