Add Kubernetes deployment configurations

- Add deployment.yaml with imagePullSecrets and env configuration
- Add service.yaml with NodePort configuration
- Configure Spring Boot environment variables from ConfigMap and Secrets
- Ensures proper image pull authentication from private registry

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-07-20 21:23:59 +08:00
parent d5d9b7aa99
commit 43580dd1fd
2 changed files with 89 additions and 0 deletions
+73
View File
@@ -0,0 +1,73 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: lpt-be
namespace: lpt-dev
labels:
app: lpt-be
spec:
replicas: 1
selector:
matchLabels:
app: lpt-be
strategy:
type: RollingUpdate
rollingUpdate:
maxSurge: 25%
maxUnavailable: 25%
template:
metadata:
labels:
app: lpt-be
spec:
imagePullSecrets:
- name: regcred
containers:
- name: lpt-be
image: 192.168.123.199:5000/lpt-be:dev
imagePullPolicy: IfNotPresent
ports:
- containerPort: 8888
env:
- name: SPRING_PROFILES_ACTIVE
value: dev
- name: SPRING_DATASOURCE_URL
valueFrom:
configMapKeyRef:
name: lpt-config
key: SPRING_DATASOURCE_URL
- name: SPRING_DATASOURCE_USERNAME
value: root
- name: SPRING_DATASOURCE_PASSWORD
valueFrom:
secretKeyRef:
name: lpt-secrets
key: mysql-root-password
- name: LPT_AI-SERVICE_URL
valueFrom:
configMapKeyRef:
name: lpt-config
key: LPT_AI-SERVICE_URL
resources:
requests:
cpu: 250m
memory: 512Mi
limits:
cpu: "1"
memory: 1Gi
livenessProbe:
httpGet:
path: /actuator/health
port: 8888
initialDelaySeconds: 60
periodSeconds: 30
timeoutSeconds: 10
failureThreshold: 3
readinessProbe:
httpGet:
path: /actuator/health
port: 8888
initialDelaySeconds: 30
periodSeconds: 10
timeoutSeconds: 5
failureThreshold: 3