<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>orvice  blog</title>
    <link>https://blog.orx.me/</link>
    <description>Recent content on orvice  blog</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-us</language>
    <lastBuildDate>Mon, 14 Apr 2025 01:04:50 +0800</lastBuildDate><atom:link href="https://blog.orx.me/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>构建自定义的 k8s Coredns/LocalDNS 镜像</title>
      <link>https://blog.orx.me/posts/2025/04/coredns/</link>
      <pubDate>Mon, 14 Apr 2025 01:04:50 +0800</pubDate>
      
      <guid>https://blog.orx.me/posts/2025/04/coredns/</guid>
      <description>k8s 集群中，DNS 作为一个服务发现(Service)的重要依赖， 出于稳定性等因素，通常还会在每个 Node 上部署 LocalDNS 来增强 DNS 的可用性。
通常在集群中，kube-dns/local-dns 都会用 CoreDNS + 插件来实现。
最近有个需求是在 CoreDNS 的镜像中，加入自定义的插件，搜了一圈没有比较完整的教程，写个 blog 记录下。
CoreDNS 首先要修改 plugin.cfg 加入自定义的插件:
sign:sign view:view k8s_event:github.com/coredns/k8s_event kubeapi:github.com/coredns/kubeapi # 添加这一行 注意： 插件的执行顺序跟 plugin.cfg 中的插件顺序有关，而不是 ConfigMap 里的 Coredns 配置。问了一圈 AI 都会幻觉。
然后是 Dockerfile:
FROM golang:1.24 as builder WORKDIR /app RUN git clone https://github.com/coredns/coredns WORKDIR /app/coredns COPY plugin.cfg . RUN make gen RUN make FROM alpine COPY --from=builder /app/coredns/coredns /coredns ENTRYPOINT [&amp;#34;/coredns&amp;#34;] LocalDNS 而如果是 LocanDNS 要添加插件进去的话，则需要修改官方的构建文件了。</description>
    </item>
    
    <item>
      <title>iDrive 的 S3 兼容存储方案</title>
      <link>https://blog.orx.me/posts/2022/11/08-idrive-s3/</link>
      <pubDate>Tue, 08 Nov 2022 12:59:19 +0000</pubDate>
      
      <guid>https://blog.orx.me/posts/2022/11/08-idrive-s3/</guid>
      <description>之前减少过Wasabi作为 S3 兼容的对象存储服务，由于最近遇到了一些 Wasabi 使用上的问题，也开始在部分常见使用另一家价格相对不错的对象存储 iDrive.
官网: https://www.idrive.com/e2/
价格 Pay annually starting at $40.00/year $4.00 First year, 1 TB
iDrive 提供简单粗暴的各种价格方案，且首年还有超大折扣。流量上跟 Wasabi 一样免费，且跟 Wasabi 一样有个流量限制上的坑，Wasabi 是流量不超过存储，而 iDrive 是流量不超过 存储的3倍。如存储了 1TB，那么流量最多只能是 3TB。距离的流量说明可以参考官方文档: https://www.idrive.com/e2/faq-account-management#egress-policy
How does the free egress policy in IDrive® e2 work? The free egress policy in IDrive® e2 is designed to ensure that users can store, download, and access data at a reasonable rate without burdening our service. Here are the guidelines used to determine a good fit use case for e2&amp;rsquo;s egress policy.</description>
    </item>
    
    <item>
      <title>Debian ca-certificates包更新导致访问Apple Push Server证书错误问题</title>
      <link>https://blog.orx.me/posts/2021/02/14-debian-ssl-cert/</link>
      <pubDate>Sun, 14 Feb 2021 21:24:21 +0000</pubDate>
      
      <guid>https://blog.orx.me/posts/2021/02/14-debian-ssl-cert/</guid>
      <description>最近在公司部分服务往 k8s 迁移的工作中，有个服务第一次镜像打包并在 k8s 中部署后，发现在访问 Apple Push Server(https://api.push.apple.com)会报证书验证错误: not a valid x509 certificate
心想，大厂 Apple 不至于证书配置错误吧，赶紧浏览器访问下，确实一切正常.
联想到这个服务原来还是跑在一台比较古老的 EC2 上，以及最近 golang 服务因为 k8s dns 问题，基础镜像均使用了 Debian，于是怀疑是不是最近 Debian 证书更新导致了某些 CA ROOT 被移除，Google 了下，果然发现，2020.06 的证书更新中，移除了某些 CA ROOT: ca-certificates: Removal of GeoTrust Global CA requires investigation.
从图中的 Apple Api Push 域名的证书链中，能发现 Apple IST CA2 - G1 证书由 GeoTrust Global CA 交叉签名出来的 CA，而 GeoTrust Global CA 属于 Symantec，Symantec 在 2018 年由于不规范签发证书，被 Google 以及 Mozilla 等在 2018 年就决定被不信任。</description>
    </item>
    
    <item>
      <title>使用wasabi作为s3兼容服务</title>
      <link>https://blog.orx.me/posts/2020/10/06-wasabi-s3/</link>
      <pubDate>Tue, 06 Oct 2020 19:15:17 +0000</pubDate>
      
      <guid>https://blog.orx.me/posts/2020/10/06-wasabi-s3/</guid>
      <description>S3 作为 AWS 的第一个云服务，且作为部分 aws 服务的基石，能与众多 aws 服务有着良好的整合。
除此之外，并且在众多的开源项目中也有着许多良好的支持如:
Gitlab artifacts/upload 的存储 Mastodon 的媒体文件存储 Discourse 的用户上传内容的存储 个人用 s3 比较多的地方，就是各种备份啦，如 gitlab 的备份，数据库备份等.
然而 aws 的 s3 并不便宜，由于按量计费，基本就是用多少付多少。以 us-east 为例，前 50TB 存储成本为: $0.023 per GB. 在加上$0.023 per GB出站流量费用，如果数据量比较大，对于个人，可能是用不起的&amp;hellip;
好在 s3 基本作为事实标准的对象存储 api，大部分云厂商都有良好的支持。同时，一些不像 Azure/GCP 那么大的云服务厂商，也均有提供物美价廉的 s3 兼容服务。而这其中，最便宜的可能莫过于 Wasabi 了。
完整价格参见: https://aws.amazon.com/s3/pricing/
Wasabi 价格 wasabi 也是按量收费，其中只计算存储费用，但是至少存储 1TB,不满 1TB 也会按照 1TB 收取 5.99usd 的费用。出入站流量均不另外计费，API 请求也不另外收费。可以认为，wasabi 基本就是按照存储大小计费。而 5.99usd/1TB 的价格，相比于 s3，可谓很便宜了~
具体价格说明见: https://wasabi.com/cloud-storage-pricing/
在 aws cli 中使用 Wasabi wasabi 兼容 s3 api，因此我们可以在 aws cli 中直接使用。</description>
    </item>
    
    <item>
      <title>使用Terraform管理k8s集群</title>
      <link>https://blog.orx.me/posts/2020/10/02-terraform-k8s/</link>
      <pubDate>Fri, 02 Oct 2020 17:17:17 +0000</pubDate>
      
      <guid>https://blog.orx.me/posts/2020/10/02-terraform-k8s/</guid>
      <description>Terraform Terraform 是 HashiCorp 公司旗下的 Provision Infrastructure 产品, 是 AWS APN Technology Partner 与 AWS DevOps Competency Partner。Terraform 是一个 IT 基础架构自动化编排工具，它的口号是“Write, Plan, and Create Infrastructure as Code”, 是一个“基础设施即代码”工具。
Terraform VS Yaml 相比于直接使用 Yaml 文件管理 k8s 集群，虽然 yaml 文件也能版本控制，但是可能会存在如下问题:
资源删除/重命名 后，该如何自行执行更新?
以删除资源为例，可能需要通过执行 kubectl delete -f xxx.yaml 来执行删除，而使用 terraform 管理的话，就很简单: terraform apply.
初始化 配置 Terraform backend 为了方便多人协作以及 CI，这里推荐使用 S3 作为 terraform backend,其他 backend 可以查看官方文档.
以下配置包含了使用 aws s3 作为 state 的存储以及使用 dynamodb 作为 lock.</description>
    </item>
    
    <item>
      <title>Hello World</title>
      <link>https://blog.orx.me/posts/2020/10/02-hello-world/</link>
      <pubDate>Fri, 02 Oct 2020 02:04:19 +0000</pubDate>
      
      <guid>https://blog.orx.me/posts/2020/10/02-hello-world/</guid>
      <description>由于 Ghost 一些沙雕问题，最终，我还是决定尝试下静态博客，选择了 Hexo.
托管于 Github/Gitlab，并使用 Gitlab CI 自动打包 Push 到 S3.
本来想试试看把之前 Ghost/WordPress 的数据搬过来，但是搜了下，似乎都失败的，于是暂时放弃把旧的 Blog 搬过来，暂时考虑会人工慢慢迁移。
https://anthonyison.com/migrating-from-ghost-to-hexo/ </description>
    </item>
    
    <item>
      <title>k3s 安装使用</title>
      <link>https://blog.orx.me/posts/2020/10/02-k3s-install/</link>
      <pubDate>Fri, 02 Oct 2020 01:04:19 +0000</pubDate>
      
      <guid>https://blog.orx.me/posts/2020/10/02-k3s-install/</guid>
      <description>作为容器编排的事实标准,Kubernetes 不管是生产环境还是测试环境都很适合，然而个人用的话，资源占用是一个很大的问题，2c4g *3 的机器配置刚好够跑个 Master 节点。
准备 HA 安装方式，我们需要准备一个外部数据库，这里我们以一个 Mysql 数据库为例。
作为 master/work node 的机器若干。
PS: 倘若阁下亦使用 Debian 10 以及准备使用 Docker 作为运行时，请执行以下命令并选择 /usr/sbin/iptables-legacy 确保能正常使用 Docker.
sudo update-alternatives --config iptables 安装 Server 在至少 2 台的机器上执行安装 k3s server 的命令:
curl -sfL https://get.k3s.io | sh -s - server \ --datastore-endpoint=&amp;#34;mysql://username:password@tcp(hostname:3306)/database-name&amp;#34; --docker PS: k3s 默认直接使用 containerd,这里的命令中我使用了 docker 作为运行时，如果不需要可以去掉 &amp;ndash;docker .
查看其中一台 Server 上查看是否安装成功:
k3s kubectl get nodes 如果顺利的话，能看到若干的 server node 状态为 Ready:
➜ ~ k3s kubectl get nodes NAME STATUS ROLES AGE VERSION server-0 Ready master 1m v1.</description>
    </item>
    
    <item>
      <title>Debian9 上transmission web的安装</title>
      <link>https://blog.orx.me/posts/2019/05/25-debian-transmission/</link>
      <pubDate>Sun, 26 May 2019 02:12:38 +0000</pubDate>
      
      <guid>https://blog.orx.me/posts/2019/05/25-debian-transmission/</guid>
      <description>transmission 是一个 bt 客户端，之前重装了一台机器就一直没有重新安装上,今天记录下安装过程。
安装 apt install transmission-daemon --install-suggests 配置 修改之前需要先停止服务
service transmission-daemon stop sudo vim /etc/transmission-daemon/settings.json 修改:
rpc-password 密码 rpc-whitelist-enabled 修改为 false 允许远程登录 重新启动服务
service transmission-daemon start 主题美化 默认主题并不好看，这里推荐安装下这个主题.</description>
    </item>
    
  </channel>
</rss>
