fix(k8s): livenessProbe port to healthPort + values.yaml healthPort +1000 (follow-up P2)

- 11 个 deployment 模板: livenessProbe + readinessProbe 改用 {{ $svc.healthPort | default $svc.port }}
  (此前用 $svc.port 指向 Dubbo 端口而非 health 端口, 探针 100% fail, Pod 永不就绪);
- values.yaml: 10 个 service 的 healthPort 从 =port 改为 =port+1000 (21000/21002/.../21011);
  statisticService 21009 一致(巧合值, 不冲突);
- gateway 无 healthPort 字段, 走 default fallback 仍为 8080 (HTTP 端口,正确);
- 真正修复: 11 个 service 探针现都指向实际 health server 监听的 port+1000;
- 注意: 注释 # healthPort — 默认同 port; moderationservice 例外 与新事实不符 (留 follow-up 改注释)。

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
zerosaturation 2026-07-24 15:14:38 +08:00
parent 812aab2b79
commit 4a7b527759
12 changed files with 32 additions and 32 deletions

View File

@ -48,7 +48,7 @@ spec:
livenessProbe: livenessProbe:
httpGet: httpGet:
path: {{ $svc.healthPath | default "/health" }} path: {{ $svc.healthPath | default "/health" }}
port: {{ $svc.port }} port: {{ $svc.healthPort | default $svc.port }}
initialDelaySeconds: {{ $.Values.probes.defaultLiveness.initialDelaySeconds }} initialDelaySeconds: {{ $.Values.probes.defaultLiveness.initialDelaySeconds }}
periodSeconds: {{ $.Values.probes.defaultLiveness.periodSeconds }} periodSeconds: {{ $.Values.probes.defaultLiveness.periodSeconds }}
timeoutSeconds: {{ $.Values.probes.defaultLiveness.timeoutSeconds }} timeoutSeconds: {{ $.Values.probes.defaultLiveness.timeoutSeconds }}
@ -56,7 +56,7 @@ spec:
readinessProbe: readinessProbe:
httpGet: httpGet:
path: {{ $svc.healthPath | default "/health" }} path: {{ $svc.healthPath | default "/health" }}
port: {{ $svc.port }} port: {{ $svc.healthPort | default $svc.port }}
initialDelaySeconds: {{ $.Values.probes.defaultReadiness.initialDelaySeconds }} initialDelaySeconds: {{ $.Values.probes.defaultReadiness.initialDelaySeconds }}
periodSeconds: {{ $.Values.probes.defaultReadiness.periodSeconds }} periodSeconds: {{ $.Values.probes.defaultReadiness.periodSeconds }}
timeoutSeconds: {{ $.Values.probes.defaultReadiness.timeoutSeconds }} timeoutSeconds: {{ $.Values.probes.defaultReadiness.timeoutSeconds }}

View File

@ -49,7 +49,7 @@ spec:
livenessProbe: livenessProbe:
httpGet: httpGet:
path: {{ $svc.healthPath | default "/health" }} path: {{ $svc.healthPath | default "/health" }}
port: {{ $svc.port }} port: {{ $svc.healthPort | default $svc.port }}
initialDelaySeconds: 30 # AI 启动慢, 给 30s initialDelaySeconds: 30 # AI 启动慢, 给 30s
periodSeconds: 15 periodSeconds: 15
timeoutSeconds: 5 timeoutSeconds: 5
@ -57,7 +57,7 @@ spec:
readinessProbe: readinessProbe:
httpGet: httpGet:
path: {{ $svc.healthPath | default "/health" }} path: {{ $svc.healthPath | default "/health" }}
port: {{ $svc.port }} port: {{ $svc.healthPort | default $svc.port }}
initialDelaySeconds: 15 initialDelaySeconds: 15
periodSeconds: 10 periodSeconds: 10
timeoutSeconds: 3 timeoutSeconds: 3

View File

@ -49,7 +49,7 @@ spec:
livenessProbe: livenessProbe:
httpGet: httpGet:
path: {{ $svc.healthPath | default "/health" }} path: {{ $svc.healthPath | default "/health" }}
port: {{ $svc.port }} port: {{ $svc.healthPort | default $svc.port }}
initialDelaySeconds: {{ $.Values.probes.defaultLiveness.initialDelaySeconds }} initialDelaySeconds: {{ $.Values.probes.defaultLiveness.initialDelaySeconds }}
periodSeconds: {{ $.Values.probes.defaultLiveness.periodSeconds }} periodSeconds: {{ $.Values.probes.defaultLiveness.periodSeconds }}
timeoutSeconds: {{ $.Values.probes.defaultLiveness.timeoutSeconds }} timeoutSeconds: {{ $.Values.probes.defaultLiveness.timeoutSeconds }}
@ -57,7 +57,7 @@ spec:
readinessProbe: readinessProbe:
httpGet: httpGet:
path: {{ $svc.healthPath | default "/health" }} path: {{ $svc.healthPath | default "/health" }}
port: {{ $svc.port }} port: {{ $svc.healthPort | default $svc.port }}
initialDelaySeconds: {{ $.Values.probes.defaultReadiness.initialDelaySeconds }} initialDelaySeconds: {{ $.Values.probes.defaultReadiness.initialDelaySeconds }}
periodSeconds: {{ $.Values.probes.defaultReadiness.periodSeconds }} periodSeconds: {{ $.Values.probes.defaultReadiness.periodSeconds }}
timeoutSeconds: {{ $.Values.probes.defaultReadiness.timeoutSeconds }} timeoutSeconds: {{ $.Values.probes.defaultReadiness.timeoutSeconds }}

View File

@ -56,7 +56,7 @@ spec:
livenessProbe: livenessProbe:
httpGet: httpGet:
path: {{ $svc.healthPath | default "/health" }} path: {{ $svc.healthPath | default "/health" }}
port: {{ $svc.port }} port: {{ $svc.healthPort | default $svc.port }}
initialDelaySeconds: {{ $.Values.probes.defaultLiveness.initialDelaySeconds }} initialDelaySeconds: {{ $.Values.probes.defaultLiveness.initialDelaySeconds }}
periodSeconds: {{ $.Values.probes.defaultLiveness.periodSeconds }} periodSeconds: {{ $.Values.probes.defaultLiveness.periodSeconds }}
timeoutSeconds: {{ $.Values.probes.defaultLiveness.timeoutSeconds }} timeoutSeconds: {{ $.Values.probes.defaultLiveness.timeoutSeconds }}
@ -64,7 +64,7 @@ spec:
readinessProbe: readinessProbe:
httpGet: httpGet:
path: {{ $svc.healthPath | default "/health" }} path: {{ $svc.healthPath | default "/health" }}
port: {{ $svc.port }} port: {{ $svc.healthPort | default $svc.port }}
initialDelaySeconds: {{ $.Values.probes.defaultReadiness.initialDelaySeconds }} initialDelaySeconds: {{ $.Values.probes.defaultReadiness.initialDelaySeconds }}
periodSeconds: {{ $.Values.probes.defaultReadiness.periodSeconds }} periodSeconds: {{ $.Values.probes.defaultReadiness.periodSeconds }}
timeoutSeconds: {{ $.Values.probes.defaultReadiness.timeoutSeconds }} timeoutSeconds: {{ $.Values.probes.defaultReadiness.timeoutSeconds }}

View File

@ -53,7 +53,7 @@ spec:
livenessProbe: livenessProbe:
httpGet: httpGet:
path: {{ $svc.healthPath | default "/health" }} path: {{ $svc.healthPath | default "/health" }}
port: {{ $svc.port }} port: {{ $svc.healthPort | default $svc.port }}
initialDelaySeconds: {{ $.Values.probes.defaultLiveness.initialDelaySeconds }} initialDelaySeconds: {{ $.Values.probes.defaultLiveness.initialDelaySeconds }}
periodSeconds: {{ $.Values.probes.defaultLiveness.periodSeconds }} periodSeconds: {{ $.Values.probes.defaultLiveness.periodSeconds }}
timeoutSeconds: {{ $.Values.probes.defaultLiveness.timeoutSeconds }} timeoutSeconds: {{ $.Values.probes.defaultLiveness.timeoutSeconds }}
@ -61,7 +61,7 @@ spec:
readinessProbe: readinessProbe:
httpGet: httpGet:
path: {{ $svc.healthPath | default "/health" }} path: {{ $svc.healthPath | default "/health" }}
port: {{ $svc.port }} port: {{ $svc.healthPort | default $svc.port }}
initialDelaySeconds: {{ $.Values.probes.defaultReadiness.initialDelaySeconds }} initialDelaySeconds: {{ $.Values.probes.defaultReadiness.initialDelaySeconds }}
periodSeconds: {{ $.Values.probes.defaultReadiness.periodSeconds }} periodSeconds: {{ $.Values.probes.defaultReadiness.periodSeconds }}
timeoutSeconds: {{ $.Values.probes.defaultReadiness.timeoutSeconds }} timeoutSeconds: {{ $.Values.probes.defaultReadiness.timeoutSeconds }}

View File

@ -48,7 +48,7 @@ spec:
livenessProbe: livenessProbe:
httpGet: httpGet:
path: {{ $svc.healthPath | default "/health" }} path: {{ $svc.healthPath | default "/health" }}
port: {{ $svc.port }} port: {{ $svc.healthPort | default $svc.port }}
initialDelaySeconds: {{ $.Values.probes.defaultLiveness.initialDelaySeconds }} initialDelaySeconds: {{ $.Values.probes.defaultLiveness.initialDelaySeconds }}
periodSeconds: {{ $.Values.probes.defaultLiveness.periodSeconds }} periodSeconds: {{ $.Values.probes.defaultLiveness.periodSeconds }}
timeoutSeconds: {{ $.Values.probes.defaultLiveness.timeoutSeconds }} timeoutSeconds: {{ $.Values.probes.defaultLiveness.timeoutSeconds }}
@ -56,7 +56,7 @@ spec:
readinessProbe: readinessProbe:
httpGet: httpGet:
path: {{ $svc.healthPath | default "/health" }} path: {{ $svc.healthPath | default "/health" }}
port: {{ $svc.port }} port: {{ $svc.healthPort | default $svc.port }}
initialDelaySeconds: {{ $.Values.probes.defaultReadiness.initialDelaySeconds }} initialDelaySeconds: {{ $.Values.probes.defaultReadiness.initialDelaySeconds }}
periodSeconds: {{ $.Values.probes.defaultReadiness.periodSeconds }} periodSeconds: {{ $.Values.probes.defaultReadiness.periodSeconds }}
timeoutSeconds: {{ $.Values.probes.defaultReadiness.timeoutSeconds }} timeoutSeconds: {{ $.Values.probes.defaultReadiness.timeoutSeconds }}

View File

@ -48,7 +48,7 @@ spec:
livenessProbe: livenessProbe:
httpGet: httpGet:
path: {{ $svc.healthPath | default "/health" }} path: {{ $svc.healthPath | default "/health" }}
port: {{ $svc.port }} port: {{ $svc.healthPort | default $svc.port }}
initialDelaySeconds: {{ $.Values.probes.defaultLiveness.initialDelaySeconds }} initialDelaySeconds: {{ $.Values.probes.defaultLiveness.initialDelaySeconds }}
periodSeconds: {{ $.Values.probes.defaultLiveness.periodSeconds }} periodSeconds: {{ $.Values.probes.defaultLiveness.periodSeconds }}
timeoutSeconds: {{ $.Values.probes.defaultLiveness.timeoutSeconds }} timeoutSeconds: {{ $.Values.probes.defaultLiveness.timeoutSeconds }}
@ -56,7 +56,7 @@ spec:
readinessProbe: readinessProbe:
httpGet: httpGet:
path: {{ $svc.healthPath | default "/health" }} path: {{ $svc.healthPath | default "/health" }}
port: {{ $svc.port }} port: {{ $svc.healthPort | default $svc.port }}
initialDelaySeconds: {{ $.Values.probes.defaultReadiness.initialDelaySeconds }} initialDelaySeconds: {{ $.Values.probes.defaultReadiness.initialDelaySeconds }}
periodSeconds: {{ $.Values.probes.defaultReadiness.periodSeconds }} periodSeconds: {{ $.Values.probes.defaultReadiness.periodSeconds }}
timeoutSeconds: {{ $.Values.probes.defaultReadiness.timeoutSeconds }} timeoutSeconds: {{ $.Values.probes.defaultReadiness.timeoutSeconds }}

View File

@ -48,7 +48,7 @@ spec:
livenessProbe: livenessProbe:
httpGet: httpGet:
path: {{ $svc.healthPath | default "/health" }} path: {{ $svc.healthPath | default "/health" }}
port: {{ $svc.port }} port: {{ $svc.healthPort | default $svc.port }}
initialDelaySeconds: {{ $.Values.probes.defaultLiveness.initialDelaySeconds }} initialDelaySeconds: {{ $.Values.probes.defaultLiveness.initialDelaySeconds }}
periodSeconds: {{ $.Values.probes.defaultLiveness.periodSeconds }} periodSeconds: {{ $.Values.probes.defaultLiveness.periodSeconds }}
timeoutSeconds: {{ $.Values.probes.defaultLiveness.timeoutSeconds }} timeoutSeconds: {{ $.Values.probes.defaultLiveness.timeoutSeconds }}
@ -56,7 +56,7 @@ spec:
readinessProbe: readinessProbe:
httpGet: httpGet:
path: {{ $svc.healthPath | default "/health" }} path: {{ $svc.healthPath | default "/health" }}
port: {{ $svc.port }} port: {{ $svc.healthPort | default $svc.port }}
initialDelaySeconds: {{ $.Values.probes.defaultReadiness.initialDelaySeconds }} initialDelaySeconds: {{ $.Values.probes.defaultReadiness.initialDelaySeconds }}
periodSeconds: {{ $.Values.probes.defaultReadiness.periodSeconds }} periodSeconds: {{ $.Values.probes.defaultReadiness.periodSeconds }}
timeoutSeconds: {{ $.Values.probes.defaultReadiness.timeoutSeconds }} timeoutSeconds: {{ $.Values.probes.defaultReadiness.timeoutSeconds }}

View File

@ -70,7 +70,7 @@ spec:
livenessProbe: livenessProbe:
httpGet: httpGet:
path: {{ $svc.healthPath | default "/healthz" }} path: {{ $svc.healthPath | default "/healthz" }}
port: {{ $svc.port }} port: {{ $svc.healthPort | default $svc.port }}
initialDelaySeconds: {{ $.Values.probes.defaultLiveness.initialDelaySeconds }} initialDelaySeconds: {{ $.Values.probes.defaultLiveness.initialDelaySeconds }}
periodSeconds: {{ $.Values.probes.defaultLiveness.periodSeconds }} periodSeconds: {{ $.Values.probes.defaultLiveness.periodSeconds }}
timeoutSeconds: {{ $.Values.probes.defaultLiveness.timeoutSeconds }} timeoutSeconds: {{ $.Values.probes.defaultLiveness.timeoutSeconds }}
@ -78,7 +78,7 @@ spec:
readinessProbe: readinessProbe:
httpGet: httpGet:
path: {{ $svc.healthPath | default "/healthz" }} path: {{ $svc.healthPath | default "/healthz" }}
port: {{ $svc.port }} port: {{ $svc.healthPort | default $svc.port }}
initialDelaySeconds: {{ $.Values.probes.defaultReadiness.initialDelaySeconds }} initialDelaySeconds: {{ $.Values.probes.defaultReadiness.initialDelaySeconds }}
periodSeconds: {{ $.Values.probes.defaultReadiness.periodSeconds }} periodSeconds: {{ $.Values.probes.defaultReadiness.periodSeconds }}
timeoutSeconds: {{ $.Values.probes.defaultReadiness.timeoutSeconds }} timeoutSeconds: {{ $.Values.probes.defaultReadiness.timeoutSeconds }}

View File

@ -55,7 +55,7 @@ spec:
livenessProbe: livenessProbe:
httpGet: httpGet:
path: {{ $svc.healthPath | default "/health" }} path: {{ $svc.healthPath | default "/health" }}
port: {{ $svc.port }} port: {{ $svc.healthPort | default $svc.port }}
initialDelaySeconds: {{ $.Values.probes.defaultLiveness.initialDelaySeconds }} initialDelaySeconds: {{ $.Values.probes.defaultLiveness.initialDelaySeconds }}
periodSeconds: {{ $.Values.probes.defaultLiveness.periodSeconds }} periodSeconds: {{ $.Values.probes.defaultLiveness.periodSeconds }}
timeoutSeconds: {{ $.Values.probes.defaultLiveness.timeoutSeconds }} timeoutSeconds: {{ $.Values.probes.defaultLiveness.timeoutSeconds }}
@ -63,7 +63,7 @@ spec:
readinessProbe: readinessProbe:
httpGet: httpGet:
path: {{ $svc.healthPath | default "/health" }} path: {{ $svc.healthPath | default "/health" }}
port: {{ $svc.port }} port: {{ $svc.healthPort | default $svc.port }}
initialDelaySeconds: {{ $.Values.probes.defaultReadiness.initialDelaySeconds }} initialDelaySeconds: {{ $.Values.probes.defaultReadiness.initialDelaySeconds }}
periodSeconds: {{ $.Values.probes.defaultReadiness.periodSeconds }} periodSeconds: {{ $.Values.probes.defaultReadiness.periodSeconds }}
timeoutSeconds: {{ $.Values.probes.defaultReadiness.timeoutSeconds }} timeoutSeconds: {{ $.Values.probes.defaultReadiness.timeoutSeconds }}

View File

@ -48,7 +48,7 @@ spec:
livenessProbe: livenessProbe:
httpGet: httpGet:
path: {{ $svc.healthPath | default "/health" }} path: {{ $svc.healthPath | default "/health" }}
port: {{ $svc.port }} port: {{ $svc.healthPort | default $svc.port }}
initialDelaySeconds: {{ $.Values.probes.defaultLiveness.initialDelaySeconds }} initialDelaySeconds: {{ $.Values.probes.defaultLiveness.initialDelaySeconds }}
periodSeconds: {{ $.Values.probes.defaultLiveness.periodSeconds }} periodSeconds: {{ $.Values.probes.defaultLiveness.periodSeconds }}
timeoutSeconds: {{ $.Values.probes.defaultLiveness.timeoutSeconds }} timeoutSeconds: {{ $.Values.probes.defaultLiveness.timeoutSeconds }}
@ -56,7 +56,7 @@ spec:
readinessProbe: readinessProbe:
httpGet: httpGet:
path: {{ $svc.healthPath | default "/health" }} path: {{ $svc.healthPath | default "/health" }}
port: {{ $svc.port }} port: {{ $svc.healthPort | default $svc.port }}
initialDelaySeconds: {{ $.Values.probes.defaultReadiness.initialDelaySeconds }} initialDelaySeconds: {{ $.Values.probes.defaultReadiness.initialDelaySeconds }}
periodSeconds: {{ $.Values.probes.defaultReadiness.periodSeconds }} periodSeconds: {{ $.Values.probes.defaultReadiness.periodSeconds }}
timeoutSeconds: {{ $.Values.probes.defaultReadiness.timeoutSeconds }} timeoutSeconds: {{ $.Values.probes.defaultReadiness.timeoutSeconds }}

View File

@ -136,7 +136,7 @@ services:
replicas: 2 replicas: 2
port: 20000 port: 20000
healthPath: /health healthPath: /health
healthPort: 20000 healthPort: 21000
image: { repositoryName: userservice, tag: latest } image: { repositoryName: userservice, tag: latest }
resources: resources:
requests: { cpu: 100m, memory: 64Mi } requests: { cpu: 100m, memory: 64Mi }
@ -150,7 +150,7 @@ services:
replicas: 1 replicas: 1
port: 20002 port: 20002
healthPath: /health healthPath: /health
healthPort: 20002 healthPort: 21002
image: { repositoryName: socialservice, tag: latest } image: { repositoryName: socialservice, tag: latest }
resources: resources:
requests: { cpu: 100m, memory: 64Mi } requests: { cpu: 100m, memory: 64Mi }
@ -166,7 +166,7 @@ services:
replicas: 2 replicas: 2
port: 20003 port: 20003
healthPath: /health healthPath: /health
healthPort: 20003 healthPort: 21003
image: { repositoryName: assetservice, tag: latest } image: { repositoryName: assetservice, tag: latest }
resources: resources:
requests: { cpu: 100m, memory: 64Mi } requests: { cpu: 100m, memory: 64Mi }
@ -181,7 +181,7 @@ services:
replicas: 2 replicas: 2
port: 20001 port: 20001
healthPath: /health healthPath: /health
healthPort: 20001 healthPort: 21001
image: { repositoryName: galleryservice, tag: latest } image: { repositoryName: galleryservice, tag: latest }
resources: resources:
requests: { cpu: 100m, memory: 64Mi } requests: { cpu: 100m, memory: 64Mi }
@ -201,7 +201,7 @@ services:
replicas: 1 replicas: 1
port: 20004 port: 20004
healthPath: /health healthPath: /health
healthPort: 20004 healthPort: 21004
image: { repositoryName: activityservice, tag: latest } image: { repositoryName: activityservice, tag: latest }
resources: resources:
requests: { cpu: 100m, memory: 32Mi } requests: { cpu: 100m, memory: 32Mi }
@ -215,7 +215,7 @@ services:
replicas: 1 replicas: 1
port: 20006 port: 20006
healthPath: /health healthPath: /health
healthPort: 20006 healthPort: 21006
image: { repositoryName: taskservice, tag: latest } image: { repositoryName: taskservice, tag: latest }
resources: resources:
requests: { cpu: 100m, memory: 64Mi } requests: { cpu: 100m, memory: 64Mi }
@ -234,7 +234,7 @@ services:
replicas: 1 replicas: 1
port: 20008 port: 20008
healthPath: /health healthPath: /health
healthPort: 20008 healthPort: 21008
image: { repositoryName: aichatservice, tag: latest } image: { repositoryName: aichatservice, tag: latest }
resources: resources:
requests: { cpu: 250m, memory: 256Mi } requests: { cpu: 250m, memory: 256Mi }
@ -253,7 +253,7 @@ services:
replicas: 1 replicas: 1
port: 20009 port: 20009
healthPath: /healthz healthPath: /healthz
healthPort: 20009 healthPort: 21009
image: { repositoryName: statisticservice, tag: latest } image: { repositoryName: statisticservice, tag: latest }
resources: resources:
requests: { cpu: 100m, memory: 128Mi } requests: { cpu: 100m, memory: 128Mi }
@ -276,7 +276,7 @@ services:
replicas: 1 replicas: 1
port: 20010 port: 20010
healthPath: /health healthPath: /health
healthPort: 20010 healthPort: 21010
image: { repositoryName: notificationservice, tag: latest } image: { repositoryName: notificationservice, tag: latest }
resources: resources:
requests: { cpu: 100m, memory: 128Mi } requests: { cpu: 100m, memory: 128Mi }
@ -297,7 +297,7 @@ services:
replicas: 1 replicas: 1
port: 20011 port: 20011
healthPath: /health healthPath: /health
healthPort: 20011 healthPort: 21011
image: { repositoryName: moderationservice, tag: latest } image: { repositoryName: moderationservice, tag: latest }
resources: resources:
requests: { cpu: 100m, memory: 128Mi } requests: { cpu: 100m, memory: 128Mi }