93 lines
2.4 KiB
YAML
93 lines
2.4 KiB
YAML
|
|
apiVersion: apps/v1
|
||
|
|
kind: Deployment
|
||
|
|
metadata:
|
||
|
|
name: cpte-wms-basic
|
||
|
|
namespace: cpte-wms
|
||
|
|
labels:
|
||
|
|
app: cpte-wms-basic
|
||
|
|
spec:
|
||
|
|
replicas: 2
|
||
|
|
selector:
|
||
|
|
matchLabels:
|
||
|
|
app: cpte-wms-basic
|
||
|
|
template:
|
||
|
|
metadata:
|
||
|
|
labels:
|
||
|
|
app: cpte-wms-basic
|
||
|
|
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-basic
|
||
|
|
image: cpte-wms-basic:3.8.3
|
||
|
|
imagePullPolicy: IfNotPresent
|
||
|
|
ports:
|
||
|
|
- containerPort: 8001
|
||
|
|
envFrom:
|
||
|
|
- configMapRef:
|
||
|
|
name: cpte-wms-config
|
||
|
|
- secretRef:
|
||
|
|
name: cpte-wms-secrets
|
||
|
|
env:
|
||
|
|
- name: SERVER_PORT
|
||
|
|
value: "8001"
|
||
|
|
- 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: upload-path
|
||
|
|
mountPath: /data/upload
|
||
|
|
- name: logs-path
|
||
|
|
mountPath: /data/logs
|
||
|
|
livenessProbe:
|
||
|
|
httpGet:
|
||
|
|
path: /cpte-wms-basic/actuator/health
|
||
|
|
port: 8001
|
||
|
|
initialDelaySeconds: 90
|
||
|
|
periodSeconds: 30
|
||
|
|
timeoutSeconds: 10
|
||
|
|
failureThreshold: 3
|
||
|
|
readinessProbe:
|
||
|
|
httpGet:
|
||
|
|
path: /cpte-wms-basic/actuator/health
|
||
|
|
port: 8001
|
||
|
|
initialDelaySeconds: 45
|
||
|
|
periodSeconds: 10
|
||
|
|
timeoutSeconds: 5
|
||
|
|
failureThreshold: 3
|
||
|
|
volumes:
|
||
|
|
- name: upload-path
|
||
|
|
emptyDir: {}
|
||
|
|
- name: logs-path
|
||
|
|
emptyDir: {}
|
||
|
|
---
|
||
|
|
apiVersion: v1
|
||
|
|
kind: Service
|
||
|
|
metadata:
|
||
|
|
name: cpte-wms-basic
|
||
|
|
namespace: cpte-wms
|
||
|
|
labels:
|
||
|
|
app: cpte-wms-basic
|
||
|
|
spec:
|
||
|
|
type: ClusterIP
|
||
|
|
ports:
|
||
|
|
- port: 8001
|
||
|
|
targetPort: 8001
|
||
|
|
protocol: TCP
|
||
|
|
name: http
|
||
|
|
selector:
|
||
|
|
app: cpte-wms-basic
|