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

推荐订阅源

IT之家
IT之家
Engineering at Meta
Engineering at Meta
腾讯CDC
宝玉的分享
宝玉的分享
H
Help Net Security
I
InfoQ
博客园 - Franky
The GitHub Blog
The GitHub Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Microsoft Security Blog
Microsoft Security Blog
M
MIT News - Artificial intelligence
博客园_首页
美团技术团队
Recent Announcements
Recent Announcements
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
雷峰网
雷峰网
The Cloudflare Blog
博客园 - 司徒正美
Vercel News
Vercel News
MyScale Blog
MyScale Blog
人人都是产品经理
人人都是产品经理
爱范儿
爱范儿
月光博客
月光博客

Oskyla 烹茶室

修复 Joplin on KDE 菜单栏显示问题 Copy Fail:Linux 内核 2017 年至今的高危漏洞(附临时缓解方案) | CVE-2026-31431 Hermes Agent — 在 K3s / K8s 中运行指南 在 K3s 节点上安装并使用 nerdctl Mouser:轻量开源的罗技鼠标驱动替代方案 Claude Opus 4.7:优缺点与评测信息汇总 openFuyao NPU-Operator故障排查 openFuyao 2603 共测测试报告 openFuyao InferNex AI推理集成部署 310P(300I Pro) 环境问题记录及解决 ceph mon Operation not permitted 问题解决 Ascend 310P + openFuyao + NPU-Operator 故障排查 KDE Plasma6 禁用全局菜单,恢复正常应用菜单 终极指南:在 Linux 裸机服务器上快速部署 Moltbot (原 Clawbot) 并集成飞书 Windows 配置 Claude Code 解决 settings.json 不生效 Windows 配置 Claude Code 全流程 2025-12-31 | 年终总结 AI 生图精品提示词|第二期:城市星球 AI 生图精品提示词|第一期 Kubernetes kubectl --raw 使用指南 彻底解决阿里云和 tailscale 冲突 2025-10-21 | 沉淀思维 macOS 单独为鼠标或触控板开启自然滚动 2025-10-16 | 负载高低 2025-10-15 | 睡眠周期 2025-10-14 | 转换情绪与独立观点 go 拉取 gitcode.com 私有 mod Git 将某个文件恢复到其他分支的状态 SSH 通过跳板机连接 lxc 使用 chronyc 构建 ntp 服务 2025-10-13 | 独立思考于未来能源
云原生初体验 | 使用 3C 活动服务器体验 KubeSphere
Tianlun Song · 2021-12-07 · via Oskyla 烹茶室

本文 首发于 🌱 煎茶转载 请注明 来源

记录对云原生的初体验,顺带测评 3C云活动价服务器.

一直对云原生超级感兴趣,自己的博客、图床、资

源站以及一些个人开发项目都打算用起来,但一直迫于成本太高。毕竟我现在所有的服务都是部署在两台 1c2g 的服务器上的,基本的 k8s 及类似生产环节可用的单节点部署方案都要 2c4g 才可。

加上部署也比较复杂,整个系统用在上规模的开发和生产一定很棒,但是入门起来真的门槛有点高。知道最近偶然看到国产的开源项目 KubeSphere,使用局域网内服务器部署了一下,真的立刻就体会到云原生的好处,于是就立刻用起来吧。

首先我需要找一台 2c4g 的服务器来使用,首先我使用的是 Digitalocean 新加坡节点,但是不知今天是怎么了,延迟高达 300ms+,命令行操作一卡一卡的,而且频繁丢包。

后来在 hostloc 扒了一圈,锁定了 3c 云,因为他们活动价的 香港2c4g活动机 才不到20元/月。就用它来体验一下吧。

https://cdn-imagehost.frytea.com/images/2021/12/07/2021-12-07-11.37.46b43488228ef6f5a9.png

其实购买前一直想找一下测评,但是找了一圈发现没有,想了一下价格也不贵,买一个来试试吧。

先用 bench.sh 跑一下试试:

# wget -qO- bench.sh | bash

----------------------------------------------------------------------
 CPU Model             : Intel Xeon E312xx (Sandy Bridge, IBRS update)
 CPU Cores             : 2
 CPU Frequency         : 2199.998 MHz
 CPU Cache             : 4096 KB
 Total Disk            : 16.0 GB (1.8 GB Used)
 Total Mem             : 3951 MB (76 MB Used)
 Total Swap            : 4093 MB (0 MB Used)
 System uptime         : 0 days, 0 hour 36 min
 Load average          : 0.11, 0.07, 0.03
 OS                    : Ubuntu 18.04.4 LTS
 Arch                  : x86_64 (64 Bit)
 Kernel                : 4.4.0-87-generic
 TCP CC                : cubic
 Virtualization        : KVM
 Organization          : AS139640 HK NEW CLOUD TECHNOLOGY LIMITED
 Location              : Hong Kong / HK
 Region                : Central and Western
----------------------------------------------------------------------
 I/O Speed(1st run)    : 190 MB/s
 I/O Speed(2nd run)    : 185 MB/s
 I/O Speed(3rd run)    : 191 MB/s
 Average I/O speed     : 188.7 MB/s
----------------------------------------------------------------------

I/O看起来还不错,比我的腾讯云轻量高一点,不知道这么低的价格是怎么做到的。初期我也用不了这么好的资源,先凑合了。

KubeSphere 配置

按照 KubeSphere 官网提供的「在 Linux 上以 All-in-One 模式安装 KubeSphere」流程配置即可,下面简单整理一下:

首先获取配置工具 KubeKey

# curl -sfL https://get-kk.kubesphere.io | VERSION=v1.2.0 sh -

Downloading kubekey v1.2.0 from https://github.com/kubesphere/kubekey/releases/download/v1.2.0/kubekey-v1.2.0-linux-amd64.tar.gz ...

Kubekey v1.2.0 Download Complete!

# chmod +x kk
# ./kk create cluster --with-kubernetes v1.21.5 --with-kubesphere v3.2.0
+----------+------+------+---------+----------+-------+-------+-----------+--------+------------+-------------+------------------+--------------+
| name     | sudo | curl | openssl | ebtables | socat | ipset | conntrack | docker | nfs client | ceph client | glusterfs client | time         |
+----------+------+------+---------+----------+-------+-------+-----------+--------+------------+-------------+------------------+--------------+
| 3c-hk-ks | y    | y    | y       |          |       |       |           |        |            |             |                  | HKT 22:23:03 |
+----------+------+------+---------+----------+-------+-------+-----------+--------+------------+-------------+------------------+--------------+
3c-hk-ks: conntrack is required.

下面就是缺什么装什么了:

# apt-get install ebtables socat ipset conntrack nfs-common glusterfs-client -y
# curl -fsSL https://get.docker.com | bash -s docker

# ceph-client 貌似可要可不要,可以装一下
# wget -q -O- 'https://download.ceph.com/keys/release.asc' | sudo apt-key add -
# echo deb http://download.ceph.com/debian-octopus/ $(lsb_release -sc) main | sudo tee /etc/apt/sources.list.d/ceph.list
# sudo apt-get update && sudo apt-get install ceph-deploy
# ceph-deploy install ceph-client
# 记得在 /etc/hosts 将 ceph-client 解析到客户端,或是直接本地 127.0.0.1

建议安装的包都装了就是这样:

# ./kk create cluster --with-kubernetes v1.21.5 --with-kubesphere v3.2.0
+----------+------+------+---------+----------+-------+-------+-----------+----------+------------+-------------+------------------+--------------+
| name     | sudo | curl | openssl | ebtables | socat | ipset | conntrack | docker   | nfs client | ceph client | glusterfs client | time         |
+----------+------+------+---------+----------+-------+-------+-----------+----------+------------+-------------+------------------+--------------+
| 3c-hk-ks | y    | y    | y       | y        | y     | y     | y         | 20.10.11 | y          | y           | y                | HKT 22:52:12 |
+----------+------+------+---------+----------+-------+-------+-----------+----------+------------+-------------+------------------+--------------+

This is a simple check of your environment.
Before installation, you should ensure that your machines meet all requirements specified at
https://github.com/kubesphere/kubekey#requirements-and-recommendations

Continue this installation? [yes/no]:

继续,等待成功即可,看到这些基本就成功了,进入网址看看:

#####################################################                                                                                                                                             [794/1947]
###              Welcome to KubeSphere!           ###
#####################################################

Console: http://********:30880
Account: admin
Password: P@88w0rd

NOTES:
  1. After you log into the console, please check the
     monitoring status of service components in
     "Cluster Management". If any service is not
     ready, please wait patiently until all components
     are up and running.
  2. Please change the default password after login.

#####################################################
https://kubesphere.io             2021-12-07 23:28:16
#####################################################
INFO[23:28:20 HKT] Installation is complete.

Please check the result using the command:

       kubectl logs -n kubesphere-system $(kubectl get pod -n kubesphere-system -l app=ks-install -o jsonpath='{.items[0].metadata.name}') -f

登陆就可以看到界面了,之后等待后台将各种参数配置:

https://cdn-imagehost.frytea.com/images/2021/12/07/2021-12-07-11.34.22e744d12704d00089.png

后续按照官网文档,可以配置出各种玩法,若要在 KubeSphere 中启用其他组件,请参见启用可插拔组件

插曲

  • 香港服务器的网络配置

记录一个小经验,很久没有使用香港服务器,上来都不知道 DNS 和 apt 软件源该配谁了,上面脚本一直跑不过,后来才发现是 DNS 解析的锅,默认镜像配的 DNS 服务器在香港表现不佳,apt 软件源还配了一个 163 的,基本用不了。

最后把 DNS 配成谷歌的 8.8.8.8,再将软件源配成 ubuntu 官方在香港的节点( http://hk.archive.ubuntu.com/ubuntu/ )即可,装软件流畅多了,这才是香港服务器该有的样子。

  • 云原生实验室

还是偶然进入 云原生实验室 博客,今儿了解到一群 KubeSphere 的维护者,为何都很愿意称自己为云原生的追随者,视其为一种信仰,近乎狂热,虽然有点不懂,但也许这其中真的有很吸引人的地方吧。

我现在能做的,只有先把这些东西用起来,慢慢适应,再尝试靠近。

Q&A

  • sudo: unable to resolve host 3c-hk-ks

如果出现 sudo: unable to resolve host 3c-hk-ks 错误,只需将主机名解析道 127.0.0.1 放到 /etc/hosts 文件中即可,比如这样。

# cat /etc/hosts
127.0.0.1       localhost
127.0.0.1       3c-hk-ks

参考文献