95 lines
2.4 KiB
YAML
95 lines
2.4 KiB
YAML
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: cpte-wms-system
|
|
namespace: cpte-wms
|
|
labels:
|
|
app: cpte-wms-system
|
|
spec:
|
|
replicas: 2
|
|
selector:
|
|
matchLabels:
|
|
app: cpte-wms-system
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: cpte-wms-system
|
|
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-system
|
|
image: cpte-wms-system:3.8.3
|
|
imagePullPolicy: IfNotPresent
|
|
ports:
|
|
- containerPort: 8000
|
|
envFrom:
|
|
- configMapRef:
|
|
name: cpte-wms-config
|
|
- secretRef:
|
|
name: cpte-wms-secrets
|
|
env:
|
|
- name: SERVER_PORT
|
|
value: "8000"
|
|
- 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"
|
|
resources:
|
|
requests:
|
|
memory: "512Mi"
|
|
cpu: "250m"
|
|
limits:
|
|
memory: "1Gi"
|
|
cpu: "1000m"
|
|
volumeMounts:
|
|
- name: upload-path
|
|
mountPath: /data/upload
|
|
- name: webapp-path
|
|
mountPath: /data/webapp
|
|
- name: logs-path
|
|
mountPath: /data/logs
|
|
livenessProbe:
|
|
httpGet:
|
|
path: /cpte-wms/actuator/health
|
|
port: 8000
|
|
initialDelaySeconds: 120
|
|
periodSeconds: 30
|
|
timeoutSeconds: 10
|
|
failureThreshold: 3
|
|
readinessProbe:
|
|
httpGet:
|
|
path: /cpte-wms/actuator/health
|
|
port: 8000
|
|
initialDelaySeconds: 60
|
|
periodSeconds: 10
|
|
timeoutSeconds: 5
|
|
failureThreshold: 3
|
|
volumes:
|
|
- name: upload-path
|
|
emptyDir: {}
|
|
- name: webapp-path
|
|
emptyDir: {}
|
|
- name: logs-path
|
|
emptyDir: {}
|
|
---
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: cpte-wms-system
|
|
namespace: cpte-wms
|
|
labels:
|
|
app: cpte-wms-system
|
|
spec:
|
|
type: ClusterIP
|
|
ports:
|
|
- port: 8000
|
|
targetPort: 8000
|
|
protocol: TCP
|
|
name: http
|
|
selector:
|
|
app: cpte-wms-system
|