惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

C
Cybersecurity and Infrastructure Security Agency CISA
腾讯CDC
Recent Announcements
Recent Announcements
罗磊的独立博客
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
小众软件
小众软件
美团技术团队
阮一峰的网络日志
阮一峰的网络日志
博客园 - 聂微东
博客园_首页
NISL@THU
NISL@THU
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
博客园 - 叶小钗
月光博客
月光博客
C
Cyber Attacks, Cyber Crime and Cyber Security
Jina AI
Jina AI
Security Latest
Security Latest
博客园 - 【当耐特】
T
Tenable Blog
The Cloudflare Blog
C
CXSECURITY Database RSS Feed - CXSecurity.com
雷峰网
雷峰网
V
Vulnerabilities – Threatpost
Project Zero
Project Zero
S
SegmentFault 最新的问题
Hugging Face - Blog
Hugging Face - Blog
S
Schneier on Security
L
LINUX DO - 热门话题
博客园 - Franky
爱范儿
爱范儿
L
LINUX DO - 最新话题
P
Privacy & Cybersecurity Law Blog
AWS News Blog
AWS News Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
WordPress大学
WordPress大学
PCI Perspectives
PCI Perspectives
Attack and Defense Labs
Attack and Defense Labs
人人都是产品经理
人人都是产品经理
Hacker News: Ask HN
Hacker News: Ask HN
S
Security @ Cisco Blogs
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
GbyAI
GbyAI
C
Cisco Blogs
宝玉的分享
宝玉的分享
Y
Y Combinator Blog
The GitHub Blog
The GitHub Blog
G
Google Developers Blog
量子位
Last Week in AI
Last Week in AI
博客园 - 司徒正美

泠泫凝的异次元空间

通过串口安装Linux | 泠泫凝的异次元空间 curl自编译 | 泠泫凝的异次元空间 Minecraft 认证服务器代理 | 泠泫凝的异次元空间 飞塔分流配置实战 | 泠泫凝的异次元空间 Windows 安全启动证书检查 | 泠泫凝的异次元空间 Lxn-OneDriveCLI | 泠泫凝的异次元空间 华三交换机配置 ERPS 环网 | 泠泫凝的异次元空间 PVE 配置 VLAN 感知 | 泠泫凝的异次元空间 MT7922 无线网卡安装 | 泠泫凝的异次元空间 无显示输出 Linux 主机配置桌面显示 | 泠泫凝的异次元空间 Wireguard 部署 SOP 手册(自用) | 泠泫凝的异次元空间 Zabbix 7.4 通过钉钉发送告警提醒 | 泠泫凝的异次元空间 Debian with xfce 通过 VNC 共享屏幕 华三S6860 IRF堆叠 | 泠泫凝的异次元空间 iPad 应用侧载 | 泠泫凝的异次元空间 Smart DNS 分区解析 | 泠泫凝的异次元空间 建立 NFS 服务器并挂载到客户端 | 泠泫凝的异次元空间 将 Android 以 MTP 方式连接至 Debian PVE 虚拟机迁移至 vCenter | 泠泫凝的异次元空间 vCenter 虚拟机迁移至 PVE | 泠泫凝的异次元空间 PVE迁移时提示密钥验证失败 | 泠泫凝的异次元空间 修改Windows设备设置区域 | 泠泫凝的异次元空间 恢复 SecureCRT 7.x 保存的密码 | 泠泫凝的异次元空间 PVE 超融合下电与上电流程 | 泠泫凝的异次元空间 记一次Zabbix异常处理 | 泠泫凝的异次元空间 苹果设备保存SHSH2 | 泠泫凝的异次元空间 PVE超融合部署 | 泠泫凝的异次元空间 树莓派启用zram | 泠泫凝的异次元空间 在 Hyper-V 上安装 EVE-NG | 泠泫凝的异次元空间 Zabbix 部署与 Windows 硬件信息收集 | 泠泫凝的异次元空间 在WSL2中安装CUDA支持 | 泠泫凝的异次元空间 MinIO 集群部署 | 泠泫凝的异次元空间 vmware 虚拟化平台备份工具 Veeam 12 安装及配置 ubuntu 24.04 安装 nVidia 驱动后网卡消失 XMRig 自编译 | 泠泫凝的异次元空间 云桌面通过组策略统一体验配置 | 泠泫凝的异次元空间 Fortigate SSLVPN 无法连接内网 VNC 服务器 CentOS 7 使用镜像作为本地源并将自身作为YUM源服务器 | 泠泫凝的异次元空间 CentOS 7 离线更新 OpenSSH 服务 使用PGP对消息进行签名 | 泠泫凝的异次元空间 禁止MinIO展示桶内文件列表 | 泠泫凝的异次元空间 华为 Fusion Access 云桌面部署 | 泠泫凝的异次元空间 vmware Horizon 模板机部署 | 泠泫凝的异次元空间 vmware Horizon 云桌面与云应用部署 | 泠泫凝的异次元空间 Citrix XenApp 云应用交付 | 泠泫凝的异次元空间 Citrix XenDesktop 云桌面部署 | 泠泫凝的异次元空间 PVE LVM 扩容 | 泠泫凝的异次元空间 Linux 网络聚合(bond方式) | 泠泫凝的异次元空间 Citrix XenServer 7.2 部署教程 | 泠泫凝的异次元空间 在 Windows Server 2019 上安装 AMD 显卡驱动 openEuler 安装并使用 EPEL 源 | 泠泫凝的异次元空间 从已有Linux系统创建带桌面环境的Docker镜像 | 泠泫凝的异次元空间 下载联想原厂镜像及解密 | 泠泫凝的异次元空间 在基于 arm 架构的服务器上安装 PVE | 泠泫凝的异次元空间 自制 EVE-NG 镜像 | 泠泫凝的异次元空间 不使用 Snap 在 ubuntu 上安装 Chromium 浏览器 Fortigate 6.2 固件从 PPPoE 获得 IPv6 地址 Fortigate 手记 | 泠泫凝的异次元空间 Fortigate 通过命令行自定义 NTP 服务器 | 泠泫凝的异次元空间 arm 架构 CentOS 7 安装 MySQL 5.7 版本 ubuntu 20 安装计算卡驱动和 CUDA Toolkit 锐捷诺客云添加设备后一直显示“等待同步” | 泠泫凝的异次元空间 Windows 10 自动登录 | 泠泫凝的异次元空间 OpenWRT IPv6 防火墙设置 | 泠泫凝的异次元空间 k8s 部署踩坑合集 | 泠泫凝的异次元空间 改变 Ubuntu TTY 终端字体 | 泠泫凝的异次元空间 Parted 无损扩容磁盘分区 | 泠泫凝的异次元空间 NTP服务器测试 | 泠泫凝的异次元空间 【相亲相爱】2024祝大家!新年快乐!!! ESXi中重新挂载数据盘 | 泠泫凝的异次元空间 使用 MediaMTX + RTSP 搭建低延迟直播服务器 Firewalld 手记 | 泠泫凝的异次元空间 Ubuntu 上不使用 snapd 安装 Firefox 在 armbian 上安装 xfce 和 VNC 做远程桌面 在 ubuntu 20 上使用 TigerVNC 做远程桌面 在 openEuler 上部署安装 openGauss | 泠泫凝的异次元空间 Wireguard 组网笔记 | 泠泫凝的异次元空间 让特定IP(段)走VPN连接 | 泠泫凝的异次元空间 在Wireguard中排除部分IP(段) | 泠泫凝的异次元空间 CentOS 7 上升级 OpenSSL | 泠泫凝的异次元空间 将黑群晖部署到ESXi(笔记) | 泠泫凝的异次元空间 apk 代码反编译笔记 | 泠泫凝的异次元空间 Windows 搭建 iSCSI 服务器全攻略 | 泠泫凝的异次元空间 CentOS 7 编译安装 Python 3 开源语音识别工具 Whisper | 泠泫凝的异次元空间 Ubuntu 下 Python 编译安装及关联问题解决 | 泠泫凝的异次元空间 Ansible Tower 安装 | 泠泫凝的异次元空间 提高 PowerPoint 导出到图片时的分辨率 | 泠泫凝的异次元空间 利用亚马逊云服务器和VPC 构建安全可靠的虚拟网络 | 泠泫凝的异次元空间 Windows Server 多网卡链路聚合 | 泠泫凝的异次元空间 MT3000路由+移远EC20模块体验 | 泠泫凝的异次元空间 Python安装依赖时出现ctype问题 | 泠泫凝的异次元空间 GL-MT3000日用设置 | 泠泫凝的异次元空间 解除 vCenter 的最低内存限制 | 泠泫凝的异次元空间 跳过Windows 11的强制联网和账户登录 | 泠泫凝的异次元空间 Cloudflare Trace API 信息详解 | 泠泫凝的异次元空间 在CentOS中搭建由nginx反代和Apache2作为后端的Wordpress | 泠泫凝的异次元空间 通过nginx进行文件共享 | 泠泫凝的异次元空间 禁用 sudo 时密码认证 | 泠泫凝的异次元空间 在docker中一键搭建IPSec/IKEv2 VPN | 泠泫凝的异次元空间
使用KubeKey离线部署Kubernetes | 泠泫凝的异次元空间
Lxn's Area · 2025-02-28 · via 泠泫凝的异次元空间

在x86和arm架构上使用KubeKey从制作离线包开始部署Kubernetes。

本文基于离线安装 KubeSphere编写,请以官方文档为准

请不要完整的照抄我的配置文件,首先肯定不是最新的,其次也不一定符合我以外的人的实际使用情况。
建议完整阅读本文后举一反三进行配置。

环境介绍

我这里准备了4台主机,3台用于集群部署,1台用于制作离线包。需要注意的是,制作离线包的机器与集群环境不需要有直接联系,做好的离线包能够以任何方式传入集群环境即可。

序号IP地址操作系统用途备注
1192.168.110.92openEuler 24.03 SP1 LTS制作离线包
2192.168.50.71ubuntu 20.04 LTSMaster节点Node1
3192.168.50.72ubuntu 20.04 LTSWorker节点Node2
4192.168.50.73ubuntu 20.04 LTSWorker节点Node3

制作离线包

制作离线包这一步需要一台能够联网的主机,用于下载和制作离线包。

1
2
3
4
5
6
7
8
9
[root@localhost ~]# uname -a
Linux localhost.localdomain 6.6.0-72.0.0.76.oe2403sp1.x86_64 #1 SMP Fri Dec 27 12:13:01 CST 2024 x86_64 x86_64 x86_64 GNU/Linux
[root@localhost ~]# cat /etc/os-release
NAME="openEuler"
VERSION="24.03 (LTS-SP1)"
ID="openEuler"
VERSION_ID="24.03"
PRETTY_NAME="openEuler 24.03 (LTS-SP1)"
ANSI_COLOR="0;31"

获取镜像列表和依赖包

打开获取 KubeSphere 镜像列表,选择需要的扩展组件(不是必须要选的)后填写邮箱,稍后打开邮箱会收到三份文件,kubesphere-images.txtkk-manifest.yamlkk-manifest-mirror.yaml,我们这里只需要最后一份文件。

打开Releases v3.1.6,找到自己目标操作系统的依赖包ISO文件并下载:

1
wget https://github.com/kubesphere/kubekey/releases/download/v3.1.6/ubuntu-20.04-debs-amd64.iso -O ubuntu-20.04-debs-amd64.iso

如果需要CentOS 7的依赖包,可以到Releases v3.1.0-rc.0-20240523-1下载,该Release是最后一个保留有CentOS 7依赖包的Release。

下载并制作离线包

  1. 下载kk然后解压:
    1
    2
    wget https://github.com/kubesphere/kubekey/releases/download/v3.1.7/kubekey-v3.1.7-linux-amd64.tar.gz -O kubekey-v3.1.7-linux-amd64.tar.gz
    tar -zxvf kubekey-v3.1.7-linux-amd64.tar.gz
    切换国内源:
    1
    export KKZONE=cn
  2. 制作manifest文件,带--with-registry以便将镜像仓库的安装文件一并打包进去:
    1
    ./kk create manifest --with-kubernetes v1.22.12 --with-registry
    该命令将创建一个 manifest-sample.yaml 文件。
  3. 依据自己的情况修改manifest-sample.yaml文件:
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    apiVersion: kubekey.kubesphere.io/v1alpha2
    kind: Manifest
    metadata:
    name: sample
    spec:
    arches:
    - amd64
    operatingSystems:

    - arch: amd64
    type: linux
    id: ubuntu
    version: "20.04"
    osImage: Ubuntu 20.04.3 LTS
    repository:
    iso:
    localPath: ./ubuntu-20.04-debs-amd64.iso
    url:
    kubernetesDistributions:
    - type: kubernetes
    version: v1.22.12
    components:
    helm:
    version: v3.14.3
    cni:
    version: v1.2.0
    etcd:
    version: v3.5.13
    containerRuntimes:
    - type: docker
    version: 24.0.9
    - type: containerd
    version: 1.7.13
    calicoctl:
    version: v3.27.4
    crictl:
    version: v1.29.0
    docker-registry:
    version: "2"



    docker-compose:
    version: v2.26.1
    images:
    - registry.cn-beijing.aliyuncs.com/kubesphereio/pause:3.5
    - registry.cn-beijing.aliyuncs.com/kubesphereio/kube-apiserver:v1.22.12
    - registry.cn-beijing.aliyuncs.com/kubesphereio/kube-controller-manager:v1.22.12
    - registry.cn-beijing.aliyuncs.com/kubesphereio/kube-scheduler:v1.22.12
    - registry.cn-beijing.aliyuncs.com/kubesphereio/kube-proxy:v1.22.12
    - registry.cn-beijing.aliyuncs.com/kubesphereio/coredns:1.8.0
    - registry.cn-beijing.aliyuncs.com/kubesphereio/k8s-dns-node-cache:1.22.20
    - registry.cn-beijing.aliyuncs.com/kubesphereio/kube-controllers:v3.27.4
    - registry.cn-beijing.aliyuncs.com/kubesphereio/cni:v3.27.4
    - registry.cn-beijing.aliyuncs.com/kubesphereio/node:v3.27.4
    - registry.cn-beijing.aliyuncs.com/kubesphereio/pod2daemon-flexvol:v3.27.4
    - registry.cn-beijing.aliyuncs.com/kubesphereio/typha:v3.27.4
    - registry.cn-beijing.aliyuncs.com/kubesphereio/flannel:v0.21.3
    - registry.cn-beijing.aliyuncs.com/kubesphereio/flannel-cni-plugin:v1.1.2
    - registry.cn-beijing.aliyuncs.com/kubesphereio/cilium:v1.15.3
    - registry.cn-beijing.aliyuncs.com/kubesphereio/operator-generic:v1.15.3
    - registry.cn-beijing.aliyuncs.com/kubesphereio/hybridnet:v0.8.6
    - registry.cn-beijing.aliyuncs.com/kubesphereio/kube-ovn:v1.10.10
    - registry.cn-beijing.aliyuncs.com/kubesphereio/multus-cni:v3.8
    - registry.cn-beijing.aliyuncs.com/kubesphereio/provisioner-localpv:3.3.0
    - registry.cn-beijing.aliyuncs.com/kubesphereio/linux-utils:3.3.0
    - registry.cn-beijing.aliyuncs.com/kubesphereio/haproxy:2.9.6-alpine
    - registry.cn-beijing.aliyuncs.com/kubesphereio/kube-vip:v0.7.2
    - registry.cn-beijing.aliyuncs.com/kubesphereio/kata-deploy:stable
    - registry.cn-beijing.aliyuncs.com/kubesphereio/node-feature-discovery:v0.10.0

    - swr.cn-southwest-2.myhuaweicloud.com/ks/kubesphere/ks-apiserver:v4.1.2
    - swr.cn-southwest-2.myhuaweicloud.com/ks/kubesphere/ks-console:v4.1.2
    - swr.cn-southwest-2.myhuaweicloud.com/ks/kubesphere/ks-controller-manager:v4.1.2
    - swr.cn-southwest-2.myhuaweicloud.com/ks/kubesphere/kubectl:v1.27.16
    - swr.cn-southwest-2.myhuaweicloud.com/ks/kubesphere/redis:7.2.4-alpine
    - swr.cn-southwest-2.myhuaweicloud.com/ks/kubesphere/haproxy:2.9.6-alpine
    - swr.cn-southwest-2.myhuaweicloud.com/ks/kubesphere/ks-extensions-museum:v1.1.2

    - swr.cn-southwest-2.myhuaweicloud.com/ks/kubesphere/nginx-ingress-controller:v1.4.0
    - swr.cn-southwest-2.myhuaweicloud.com/ks/kubesphere/gateway-apiserver:v1.0.2
    - swr.cn-southwest-2.myhuaweicloud.com/ks/kubesphere/gateway-controller-manager:v1.0.2
    - swr.cn-southwest-2.myhuaweicloud.com/ks/kubesphere/kubectl:v1.27.16

    - swr.cn-southwest-2.myhuaweicloud.com/ks/kubesphere/network-extension-apiserver:v1.1.0
    - swr.cn-southwest-2.myhuaweicloud.com/ks/kubesphere/network-extension-controller:v1.1.0

    - swr.cn-southwest-2.myhuaweicloud.com/ks/kubesphere/storageclass-accessor:v0.2.5
    - swr.cn-southwest-2.myhuaweicloud.com/ks/kubesphere/snapshot-controller:v4.2.1
    - swr.cn-southwest-2.myhuaweicloud.com/ks/kubesphere/snapshotclass-controller:v0.0.1
    - swr.cn-southwest-2.myhuaweicloud.com/ks/kubesphere/pvc-autoresizer:v0.3.1

    registry:
    auths: {}
  4. 构建离线包:
    1
    ./kk artifact export -m manifest-sample.yaml -o kubesphere.tar.gz
    等待出现Pipeline[ArtifactExportPipeline] execute successfully构建完成。
  5. 安装Helm:
    1
    curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash
    下载 KubeSphere Core Helm Chart:
    1
    2
    VERSION=1.1.3     
    helm fetch https://charts.kubesphere.io/main/ks-core-${VERSION}.tgz

至此,应该已经有了如下文件:

1
2
3
4
5
6
7
8
9
[root@localhost ~]# ls -lah
total 3.4G
dr-xr-x---. 4 root root 4.0K Feb 28 19:55 .
dr-xr-xr-x. 19 root root 4.0K Feb 28 18:39 ..
-rwxr-xr-x. 1 root root 79M Oct 30 17:42 kk
-rw-r--r--. 1 root root 81K Feb 28 19:55 ks-core-1.1.3.tgz
drwxr-xr-x. 3 root root 4.0K Feb 28 19:52 kubekey
-rw-r--r--. 1 root root 3.3G Feb 28 19:52 kubesphere.tar.gz
-rw-r--r--. 1 root root 3.8K Feb 28 19:39 manifest-sample.yaml

部署K8S集群

准备主机

1
2
3
4
5
6
7
8
9
10
11
root@node1:~# uname -a
Linux node1 5.4.0-144-generic #161-Ubuntu SMP Fri Feb 3 14:49:04 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
root@node1:~# cat /etc/os-release
NAME="Ubuntu"
VERSION="20.04.6 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04.6 LTS"
VERSION_ID="20.04"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal
  1. 将刚才制作的离线包(主要是下面的三个文件)传输到离线环境的Master节点上:
    1
    2
    3
    4
    5
    6
    7
    root@k8s-node:~# ls -la
    total 3436896
    drwx------ 6 root root 4096 Feb 28 12:10 .
    drwxr-xr-x 18 root root 4096 Feb 28 11:02 ..
    -rwxr-xr-x 1 root root 82005163 Feb 28 12:08 kk
    -rw-r--r-- 1 root root 82422 Feb 28 12:10 ks-core-1.1.3.tgz
    -rw-r--r-- 1 root root 3437246299 Feb 28 12:49 kubesphere.tar.gz
  2. 安装依赖:
    ./ubuntu-20.04-debs-amd64.iso依赖包中找到如下安装包传输到每台节点上,然后安装:
    1
    2
    ubuntu-20.04-debs-amd64.iso/archive.ubuntu.com/ubuntu/pool/main/c/conntrack-tools/conntrack_1.4.5-2_amd64.deb
    ubuntu-20.04-debs-amd64.iso/archive.ubuntu.com/ubuntu/pool/main/s/socat/socat_1.7.3.3-2_amd64.deb

部署kubernetes

  1. 创建离线集群配置文件:
    1
    2
    export KKZONE=cn
    ./kk create config --with-kubernetes v1.22.12
  2. 修改集群配置文件:
    一共需要修改两处,一处是spec.roleGroups下面添加一项registry用于指定本地离线镜像仓库部署位置;另外一项是spec.registryprivateRegistrykubesphereio,按下面示例修改即可。
    本文示例配置文件及部署方法没有使用harbor,使用了docker registry,优点是部署方便简单。
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    apiVersion: kubekey.kubesphere.io/v1alpha2
    kind: Cluster
    metadata:
    name: sample
    spec:
    hosts:
    - {name: node1, address: 192.168.50.71, internalAddress: 192.168.50.71, user: lxnchan, password: "i-hate-this-very-long-password-but-i-finally-do"}
    - {name: node2, address: 192.168.50.72, internalAddress: 192.168.50.72, user: lxnchan, password: "i-hate-this-very-long-password-but-i-finally-do"}
    - {name: node3, address: 192.168.50.73, internalAddress: 192.168.50.73, user: lxnchan, password: "i-hate-this-very-long-password-but-i-finally-do"}
    roleGroups:
    etcd:
    - node1
    control-plane:
    - node1
    worker:
    - node1
    - node2
    - node3

    registry:
    - node1
    controlPlaneEndpoint:



    domain: lb.kubesphere.local
    address: ""
    port: 6443
    kubernetes:
    version: v1.22.12
    clusterName: cluster.local
    autoRenewCerts: true
    containerManager: docker
    etcd:
    type: kubekey
    network:
    plugin: calico
    kubePodsCIDR: 10.233.64.0/18
    kubeServiceCIDR: 10.233.0.0/18

    multusCNI:
    enabled: false
    registry:

    privateRegistry: "dockerhub.kubekey.local"
    namespaceOverride: "kubesphereio"
    registryMirrors: []
    insecureRegistries: []
    addons: []
  3. 部署本地离线镜像仓库:
    1
    ./kk init registry -f config-sample.yaml -a kubesphere.tar.gz
    等待出现Local image registry created successfully. Address: dockerhub.kubekey.local即为部署成功。
  4. 为节点应用镜像仓库CA证书:
    /etc/ssl/registry/ssl/ca.crt传输到每个节点(包括Master节点)的信任证书位置:
    1
    2
    3
    cp /etc/ssl/registry/ssl/ca.crt /usr/local/share/ca-certificates/
    scp /etc/ssl/registry/ssl/ca.crt root@192.168.50.72:/usr/local/share/ca-certificates/
    scp /etc/ssl/registry/ssl/ca.crt root@192.168.50.73:/usr/local/share/ca-certificates/
    然后到每个节点上更新CA证书:
    1
    2
    3
    4
    5
    6
    root@node2:~# update-ca-certificates 
    Updating certificates in /etc/ssl/certs...
    rehash: warning: skipping ca-certificates.crt,it does not contain exactly one certificate or CRL
    1 added, 0 removed; done.
    Running hooks in /etc/ca-certificates/update.d...
    done.
  5. 部署Kubernetes集群:
    1
    ./kk create cluster -f config-sample.yaml -a kubesphere.tar.gz --with-local-storage
    最后返回如下内容即为成功:
    1
    2
    3
    4
    5
    6
    7
    13:30:27 UTC Pipeline[CreateClusterPipeline] execute successfully
    Installation is complete.

    Please check the result using the command:

    kubectl get pod -A

    查看节点状态:
    1
    2
    3
    4
    5
    root@k8s-node:~# kubectl get node -A
    NAME STATUS ROLES AGE VERSION
    node1 Ready control-plane,master,worker 111s v1.22.12
    node2 Ready worker 93s v1.22.12
    node3 Ready worker 92s v1.22.12

部署Kubesphere

执行如下命令安装:

1
2
3
4
5
6
helm upgrade --install -n kubesphere-system --create-namespace ks-core ks-core-1.1.3.tgz \
--set global.imageRegistry=dockerhub.kubekey.local/ks \
--set extension.imageRegistry=dockerhub.kubekey.local/ks \
--set ksExtensionRepository.image.tag=v1.1.2 \
--debug \
--wait

最后返回如下信息并能够打开登录页面即为安装成功:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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.50.71: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.
root@node1:~# exit
logout
Connection to 192.168.50.71 closed.
[root@localhost ~]# curl http://192.168.50.71:30880
Redirecting to <a href="/login">/login</a>.

CentOS 7 部署的差异点

依赖

CentOS 7 中应提前安装如下依赖,可到源中下载:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
[root@node1 CentOS7-Initial]# ls -la
total 9160
drwxr-xr-x 2 root root 4096 Feb 28 11:35 .
dr-xr-x---. 9 root root 4096 Feb 28 11:39 ..
-rw-r--r-- 1 root root 191000 Feb 28 11:31 conntrack-tools-1.4.4-7.el7.x86_64.rpm
-rw-r--r-- 1 root root 125448 Feb 28 11:31 ebtables-2.0.10-16.el7.x86_64.rpm
-rw-r--r-- 1 root root 39568 Feb 28 11:31 ipset-7.1-1.el7.x86_64.rpm
-rw-r--r-- 1 root root 65944 Feb 28 11:31 libmspack-0.5-0.8.alpha.el7.x86_64.rpm
-rw-r--r-- 1 root root 50076 Feb 28 11:31 libtool-ltdl-2.4.2-22.el7_3.x86_64.rpm
-rw-r--r-- 1 root root 247560 Feb 28 11:31 libxslt-1.1.28-6.el7.x86_64.rpm
-rw-r--r-- 1 root root 506040 Feb 28 11:31 openssl-1.0.2k-26.el7_9.x86_64.rpm
-rw-r--r-- 1 root root 32468 Feb 28 11:31 perl-Error-0.17020-2.el7.noarch.rpm
-rw-r--r-- 1 root root 57432 Feb 28 11:31 perl-Git-1.8.3.1-25.el7_9.noarch.rpm
-rw-r--r-- 1 root root 31916 Feb 28 11:31 perl-TermReadKey-2.30-20.el7.x86_64.rpm
-rw-r--r-- 1 root root 296632 Feb 28 11:31 socat-1.7.3.2-2.el7.x86_64.rpm
-rw-r--r-- 1 root root 1106008 Feb 28 11:31 vim-enhanced-7.4.629-8.el7_9.x86_64.rpm
-rw-r--r-- 1 root root 560272 Feb 28 11:31 wget-1.14-18.el7_6.1.x86_64.rpm
-rw-r--r-- 1 root root 181628 Feb 28 11:31 xmlsec1-1.2.20-8.el7_9.x86_64.rpm
-rw-r--r-- 1 root root 77988 Feb 28 11:31 xmlsec1-openssl-1.2.20-8.el7_9.x86_64.rpm

安装命令:

1
rpm -ivh *.rpm --nodeps --force

安装CA证书

/etc/ssl/registry/ssl/ca.crt证书复制到每个节点的/etc/pki/ca-trust/source/anchors文件夹内,然后执行/bin/update-ca-trust即可。

可以在安装好CA证书的节点上用下面的命令测试是否安装成功:

1
curl https://dockerhub.kubekey.local

安装好的话什么都不会返回,否则会提示证书验证失败。

 上一篇

linux