From 5497dfc2908eff0f9d58d7320d58cc840b93c8cd Mon Sep 17 00:00:00 2001 From: cat-shark <1716967236@qq.com> Date: Mon, 20 Jul 2026 21:24:09 +0800 Subject: [PATCH] Add Kubernetes deployment configurations - Add deployment.yaml with imagePullSecrets and env configuration - Add service.yaml with ClusterIP configuration - Configure LLM API key from Secret and other env from ConfigMap - Ensures proper image pull authentication from private registry Co-Authored-By: Claude Opus 4.8 --- k8s/deployment.yaml | 62 +++++++++++++++++++++++++++++++++++++++++++++ k8s/service.yaml | 15 +++++++++++ 2 files changed, 77 insertions(+) create mode 100644 k8s/deployment.yaml create mode 100644 k8s/service.yaml diff --git a/k8s/deployment.yaml b/k8s/deployment.yaml new file mode 100644 index 0000000..b5ffeff --- /dev/null +++ b/k8s/deployment.yaml @@ -0,0 +1,62 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: lpt-ai + namespace: lpt-dev + labels: + app: lpt-ai +spec: + replicas: 1 + selector: + matchLabels: + app: lpt-ai + strategy: + type: RollingUpdate + rollingUpdate: + maxSurge: 25% + maxUnavailable: 25% + template: + metadata: + labels: + app: lpt-ai + spec: + imagePullSecrets: + - name: regcred + containers: + - name: lpt-ai + image: 192.168.123.199:5000/lpt-ai:dev + imagePullPolicy: IfNotPresent + ports: + - containerPort: 5199 + env: + - name: LLM_API_KEY + valueFrom: + secretKeyRef: + name: lpt-secrets + key: llm-api-key + envFrom: + - configMapRef: + name: lpt-config + resources: + requests: + cpu: 100m + memory: 128Mi + limits: + cpu: 500m + memory: 256Mi + livenessProbe: + httpGet: + path: /health + port: 5199 + initialDelaySeconds: 10 + periodSeconds: 15 + timeoutSeconds: 5 + failureThreshold: 3 + readinessProbe: + httpGet: + path: /health + port: 5199 + initialDelaySeconds: 5 + periodSeconds: 5 + timeoutSeconds: 3 + failureThreshold: 3 diff --git a/k8s/service.yaml b/k8s/service.yaml new file mode 100644 index 0000000..fbd01c6 --- /dev/null +++ b/k8s/service.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Service +metadata: + name: lpt-ai + namespace: lpt-dev + labels: + app: lpt-ai +spec: + type: ClusterIP + selector: + app: lpt-ai + ports: + - port: 5199 + targetPort: 5199 + protocol: TCP