gitdataai/deploy/templates/adminrpc-deployment.yaml
ZhenYi 38da729860
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
fix(adminrpc): expose HTTP port 9091 in k8s deployment and service
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
2026-04-22 23:56:38 +08:00

97 lines
3.1 KiB
YAML

{{- if .Values.adminrpc.enabled -}}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "gitdata.fullname" . }}-adminrpc
namespace: {{ include "gitdata.namespace" . }}
labels:
app.kubernetes.io/name: {{ include "gitdata.fullname" . }}-adminrpc
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/version: {{ .Chart.AppVersion }}
spec:
replicas: 1
selector:
matchLabels:
app.kubernetes.io/name: {{ include "gitdata.fullname" . }}-adminrpc
app.kubernetes.io/instance: {{ .Release.Name }}
template:
metadata:
labels:
app.kubernetes.io/name: {{ include "gitdata.fullname" . }}-adminrpc
app.kubernetes.io/instance: {{ .Release.Name }}
spec:
{{- if $.Values.image.pullSecrets }}
imagePullSecrets:
{{- range $.Values.image.pullSecrets }}
- name: {{ . }}
{{- end }}
{{- end }}
terminationGracePeriodSeconds: 10
containers:
- name: adminrpc
image: "{{ .Values.image.registry }}/{{ .Values.adminrpc.image.repository }}:{{ .Values.adminrpc.image.tag }}"
imagePullPolicy: {{ .Values.adminrpc.image.pullPolicy | default .Values.image.pullPolicy }}
ports:
- 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 }}"
envFrom:
- configMapRef:
name: {{ include "gitdata.fullname" . }}-config
livenessProbe:
tcpSocket:
port: {{ .Values.adminrpc.service.http_port }}
initialDelaySeconds: 5
periodSeconds: 10
readinessProbe:
tcpSocket:
port: {{ .Values.adminrpc.service.http_port }}
initialDelaySeconds: 5
periodSeconds: 5
{{- if .Values.adminrpc.resources }}
resources:
{{- toYaml .Values.adminrpc.resources | nindent 12 }}
{{- end }}
{{- with .Values.adminrpc.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.adminrpc.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.adminrpc.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
---
apiVersion: v1
kind: Service
metadata:
name: {{ include "gitdata.fullname" . }}-adminrpc
namespace: {{ include "gitdata.namespace" . }}
labels:
app.kubernetes.io/name: {{ include "gitdata.fullname" . }}-adminrpc
app.kubernetes.io/instance: {{ .Release.Name }}
spec:
type: ClusterIP
ports:
- port: {{ .Values.adminrpc.service.port }}
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 }}
{{- end }}