From 9e06ed616241375f54863ba7c84243c535d7c5c3 Mon Sep 17 00:00:00 2001 From: wangbo Date: Thu, 30 Jul 2026 19:00:01 +0800 Subject: [PATCH] =?UTF-8?q?fix(k3s):=20=E8=AE=A9=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=BA=93=E6=8E=A2=E9=92=88=E8=AE=BF=E9=97=AE=E8=8A=82=E7=82=B9?= =?UTF-8?q?=E6=9C=AC=E5=9C=B0=20API?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 避免 kubernetes Service 在跨地域 API endpoint 间负载,导致 CNPG liveness/readiness 探针受 WireGuard 拥塞影响。\n\n通过 Downward API 将 KUBERNETES_SERVICE_HOST 设为 Pod 所在节点名,并使用本地 K3s 6443 端口。节点名解析、TLS 主机名校验和 kubectl 服务端 dry-run 均已通过。 --- deploy/kubernetes/production/database.yaml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/deploy/kubernetes/production/database.yaml b/deploy/kubernetes/production/database.yaml index a35a36a..4b17793 100644 --- a/deploy/kubernetes/production/database.yaml +++ b/deploy/kubernetes/production/database.yaml @@ -66,6 +66,13 @@ spec: instances: 2 imageName: ghcr.io/cloudnative-pg/postgresql:18.4-standard-trixie@sha256:4587df73024408f5b2be9b4dd6ba2ccee8c9e5dc0c9a87c274c292291cc8a68c imagePullPolicy: IfNotPresent + env: + - name: KUBERNETES_SERVICE_HOST + valueFrom: + fieldRef: + fieldPath: spec.nodeName + - name: KUBERNETES_SERVICE_PORT + value: "6443" primaryUpdateStrategy: unsupervised primaryUpdateMethod: switchover failoverDelay: 0