Cpte-Boot/k8s/services/inbound-service.yaml

89 lines
2.2 KiB
YAML
Raw Normal View History

2026-03-16 23:52:17 +08:00
apiVersion: apps/v1
kind: Deployment
metadata:
name: cpte-wms-inbound
namespace: cpte-wms
labels:
app: cpte-wms-inbound
spec:
replicas: 2
selector:
matchLabels:
app: cpte-wms-inbound
template:
metadata:
labels:
app: cpte-wms-inbound
spec:
initContainers:
- name: wait-for-mysql
image: busybox:1.36
command: ['sh', '-c', 'until nc -z mysql-service 3306; do echo waiting for mysql; sleep 2; done;']
- name: wait-for-redis
image: busybox:1.36
command: ['sh', '-c', 'until nc -z redis-service 6379; do echo waiting for redis; sleep 2; done;']
containers:
- name: cpte-wms-inbound
image: cpte-wms-inbound:3.8.3
imagePullPolicy: IfNotPresent
ports:
- containerPort: 8002
envFrom:
- configMapRef:
name: cpte-wms-config
- secretRef:
name: cpte-wms-secrets
env:
- name: SERVER_PORT
value: "8002"
- name: DB_URL
value: "jdbc:mysql://$(DB_HOST):$(DB_PORT)/$(DB_NAME)?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai"
- name: JAVA_OPTS
value: "$(JAVA_OPTS_SERVICES)"
resources:
requests:
memory: "256Mi"
cpu: "100m"
limits:
memory: "512Mi"
cpu: "500m"
volumeMounts:
- name: logs-path
mountPath: /data/logs
livenessProbe:
httpGet:
path: /actuator/health
port: 8002
initialDelaySeconds: 90
periodSeconds: 30
timeoutSeconds: 10
failureThreshold: 3
readinessProbe:
httpGet:
path: /actuator/health
port: 8002
initialDelaySeconds: 45
periodSeconds: 10
timeoutSeconds: 5
failureThreshold: 3
volumes:
- name: logs-path
emptyDir: {}
---
apiVersion: v1
kind: Service
metadata:
name: cpte-wms-inbound
namespace: cpte-wms
labels:
app: cpte-wms-inbound
spec:
type: ClusterIP
ports:
- port: 8002
targetPort: 8002
protocol: TCP
name: http
selector:
app: cpte-wms-inbound