fix(adminrpc): expose HTTP port 9091 in k8s deployment and service
Some checks are pending
CI / Rust Lint & Check (push) Waiting to run
CI / Rust Tests (push) Waiting to run
CI / Frontend Lint & Type Check (push) Waiting to run
CI / Frontend Build (push) Blocked by required conditions

The adminrpc binary runs HTTP endpoints on port grpc_port+1 (9091),
but k8s deployment only exposed port 9090 (gRPC). The /api/admin/*
HTTP routes were unreachable from the admin dashboard frontend.

- Add http container port 9091 to Deployment
- Add http named port to k8s Service
- Point liveness/readiness probes to HTTP port 9091
- Add http_port: 9091 to Helm values.yaml
This commit is contained in:
ZhenYi 2026-04-22 23:56:38 +08:00
parent f125fb0c02
commit 38da729860
3 changed files with 65 additions and 57 deletions

View File

@ -11,7 +11,7 @@
import {ADMIN_RPC_URL} from "./env";
// Default to k8s internal service address; override via ADMIN_RPC_URL env var
const BASE_URL = ADMIN_RPC_URL || "http://adminrpc.admin.svc.cluster.local:9091";
const BASE_URL = ADMIN_RPC_URL || "http://adminrpc.gitdataai.svc.cluster.local:9091";
async function rpc<T>(path: string, options?: RequestInit): Promise<T> {
const url = `${BASE_URL}${path}`;

View File

@ -35,6 +35,9 @@ spec:
- name: grpc
containerPort: {{ .Values.adminrpc.service.port }}
protocol: TCP
- name: http
containerPort: {{ .Values.adminrpc.service.http_port }}
protocol: TCP
args:
- --bind
- "0.0.0.0:{{ .Values.adminrpc.service.port }}"
@ -43,12 +46,12 @@ spec:
name: {{ include "gitdata.fullname" . }}-config
livenessProbe:
tcpSocket:
port: {{ .Values.adminrpc.service.port }}
port: {{ .Values.adminrpc.service.http_port }}
initialDelaySeconds: 5
periodSeconds: 10
readinessProbe:
tcpSocket:
port: {{ .Values.adminrpc.service.port }}
port: {{ .Values.adminrpc.service.http_port }}
initialDelaySeconds: 5
periodSeconds: 5
{{- if .Values.adminrpc.resources }}
@ -83,6 +86,10 @@ spec:
targetPort: grpc
protocol: TCP
name: grpc
- port: {{ .Values.adminrpc.service.http_port }}
targetPort: http
protocol: TCP
name: http
selector:
app.kubernetes.io/name: {{ include "gitdata.fullname" . }}-adminrpc
app.kubernetes.io/instance: {{ .Release.Name }}

View File

@ -401,6 +401,7 @@ adminrpc:
service:
port: 9090
http_port: 9091
readinessProbe:
tcpSocket: