Demon.Lee 2023-03-22 11:51

“不去着力改变别人,是一种体面的生活。”

说的真好。家人也好,朋友也好,同事也罢,都适用。

我一直想着团队里能有一种氛围,读书,思考,运动,并将其变成日常的一部分。部分人已经做到了一些,但还是没能形成一种文化。

我不喜欢的是,一旦做这些事情,就被人说成。这怎么能是卷呢?连计算机基础都没掌握,各种亚健康状态。

挺难的,我能做点什么?

再多分享一些有意思的东西,多发一些思考和总结,而不是情绪,状态和事件。

强扭的瓜不甜,我们终究还是要去寻找同类。但这个同类,可能会随着年龄和阅历的增长而变得不同。朋友变陌生人,陌生人变朋友,如此往复。

Demon.Lee 2023-03-22 08:19

在使用云计算的时代,每一份性能提升,都是实实在在的成本消减;每一点工作效率的提升,都能为你争取到更多休闲时光;每一份错误的减少,都可以尽快熄灭深夜的灯光。何乐而不为呢?

说的真好,是该用 JDK 17 了。

Demon.Lee 2023-03-21 18:05

KubeSphere 网关的大致逻辑,可以参考官方博客,简单梳理如下:

1、helm operator 集成在 ks-controller-manager 服务中;
2、crds 中集成了 Nginx,Gateway 等自定义资源;
3、启动网关时,会新增 Gateway,Nginx 等 crd 资源,可以通过 kubectl get gateways -n xxxkubectl get nginxes -n xxx 进行查看;
4、除了新增 crd 资源,还会启动 ingress-crontoller 等,具体可以通过 kubectl get gateways/xxx -n kubesphere-controls-system -o yamlkubectl get nginxes xxx -n kubesphere-controls-system -o yaml 进行查看;
5、如果使用 NodePort 方式暴露服务,则端口是随机的,但可以通过修改 nginxes crd 资源来指定端口;
6、当然,云上的环境一般都是通过 LoadBalancer 来暴露服务,这需要依赖云厂商提供的负载均衡器。

参考:https://github.com/kubesphere/kubesphere/blob/release-3.3/config/watches.yaml

Demon.Lee 2023-03-21 17:39

kubernetes 自定义域名解析的两种方案:

1、官方推荐 HostAliases,哪个 pod 需要就配哪个,比较灵活,但无法做到全局。

2、使用 CoreDNS 的 hosts plugins,可以实现全局配置,如果不生效,可以参考这篇文章。附图是配置 coredns 和 nodelocaldns 两个 ConfigMap 的示例,自定义域名为 gateway.centercar.izkml.com

Demon.Lee 2023-03-17 10:45

replace string in file/fies via sed command:

single file: sed -i 's/old-str/new-str/g' xxx.yml
multi-files: sed -i 's/old-str/new-str/g' *.yml

但在 macOS 13.3 M1 Chip 上,上面的脚本运行报错

sed: 1: “xxx …”: command c expects \ followed by text

需要将其改造为:sed -i '' -e 's/old-str/new-str/g' xxx.yml

Demon.Lee 2023-03-17 09:02

一个人单枪匹马把一个团队搞出来的 EJB 给干掉,还是一个音乐学博士 🙃

Demon.Lee 2023-03-16 14:34

Git rename a local branch and sync to remote

1. Rename your local branch:
If you are on the branch you want to rename: git branch -m new-name
If you are on a different branch: git branch -m old-name new-name

2. Delete the old-name remote branch and push the new-name local branch:
git push origin :old-name new-name

3. Reset the upstream branch for the new-name local branch:
Switch to the branch and then: git push origin -u new-name

example: arch-kubernetes --> arch-k8s-dev

➜  ne-xxx git:(arch-kubernetes) > git branch -m arch-k8s-dev
➜  ne-xxx git:(arch-k8s-dev) >
➜  ne-xxx git:(arch-k8s-dev) > git push origin :arch-kubernetes arch-k8s-dev 
Total 0 (delta 0), reused 0 (delta 0), pack-reused 0
remote: 
remote: To create a merge request for arch-k8s-dev, visit:
remote:   https://gitlab.xxx.com/ne-xxxx/-/merge_requests/new?merge_request%5Bsource_branch%5D=arch-k8s-dev
remote: 
To gitlab.xxx.com:ne-xxx.git
 - [deleted]           arch-kubernetes
 * [new branch]        arch-k8s-dev -> arch-k8s-dev
➜  ne-xxx git:(arch-k8s-dev) >
➜  ne-xxx git:(arch-k8s-dev) > git push origin -u arch-k8s-dev               
branch 'arch-k8s-dev' set up to track 'origin/arch-k8s-dev'.
Everything up-to-date
➜  ne-xxx git:(arch-k8s-dev) > 
Demon.Lee 2023-03-12 09:57

芯片设计与制造的过程非常复杂,但我们可以简单地将其理解为三个部分:前端设计 (Design)、后端制造 (Manufacturing) 、封裝 (Package) 测试。

Demon.Lee 2023-03-08 09:58

kubernetes 声明式设计背后的思想是什么?

声明式的描述,其实就是自描述,你不需要做转换就能理解。比如,很多枚举值用 0, 1, 2 来表示,这就没有自描述的能力,但你用 red,green,blue 来描述,那就不一样了,你看一眼就明白啥意思。

声明式带来自动化,背后靠的是控制器模式的强大能力,就像你把空调温度调到 28 ℃ 一样,然后就没你什么事了,不论当前温度是多少,空调控制器都会帮你达到你想要的状态。

把复杂留给自己,把简单留给客户,这就是 Infrastructure as Code

Demon.Lee 2023-03-07 09:10

Flomo 的禅定模式,喜欢。