RKE ETCD 出现 request cluster id mismatch 问题修复记录

当集群中三个 Control Plane 节点的 ETCD 出现 request cluster ID mismatch 问题时,可以保留一个 ETCD 实例通过 --force-new-cluster 参数重建集群,然后再将其他两个节点的 ETCD 实例加入集群。

Read more

NeuVector 的 Zero Draft 与 Basic 模式

NeuVector 有 Zero-drift 和 Basic 两种模式,而 Zero-drift 模式是默认模式,根据一个 Nginx 来作为测试案例,观察两种模式下 Process Profile Rules 的效果。

Read more

通过 SSH 隧道实现访问内网机器

适用场景:本地无法直接 ssh 到内网机器,如果内网机器可以访问公网,就可以通过公网的机器打通 ssh 隧道进行访问

假设 IP 信息如下:

  1. 内网机器:172.16.0.1
  2. 公网机器:1.2.3.4
Read more

ETCD 出现高碎片率事件解析

集群频繁触发 etcdDatabaseHighFragmentationRatio 告警, PrometheusRule 内容如下:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
- alert: etcdDatabaseHighFragmentationRatio
annotations:
description: 'etcd cluster "{{ $labels.job }}": database size in use on instance
{{ $labels.instance }} is {{ $value | humanizePercentage }} of the actual
allocated disk space, please run defragmentation (e.g. etcdctl defrag) to
retrieve the unused fragmented disk space.'
runbook_url: https://etcd.io/docs/v3.5/op-guide/maintenance/#defragmentation
summary: etcd database size in use is less than 50% of the actual allocated
storage.
expr: (last_over_time(etcd_mvcc_db_total_size_in_use_in_bytes{job=~".*etcd.*"}[5m])
/ last_over_time(etcd_mvcc_db_total_size_in_bytes{job=~".*etcd.*"}[5m])) <
0.5 and etcd_mvcc_db_total_size_in_use_in_bytes{job=~".*etcd.*"} > 104857600
for: 10m
labels:
severity: warning
Read more

Cert Manager 使用随记

在 Kubernetes 中常用 Cert Manager 生成并管理自签名证书,常见的 CR 有👇

  1. Issuer: 用于定义如何生成证书
  2. ClusterIssuer: 用于定义如何生成集群级别的证书
  3. Certificate: 用来请求和管理证书的主要资源
  4. CertificateRequest: 是用于手动请求证书的资源
  5. Order: 当使用 ACME 协议时会生成,
  6. Challenge: 是 ACME 协议中的一部分,用于表示 ACME 服务对域名所有权的验证
Read more