133 lines
3.3 KiB
YAML
133 lines
3.3 KiB
YAML
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: wms-inventory-service
|
|
namespace: wms-system
|
|
labels:
|
|
app: wms-inventory
|
|
version: v1
|
|
spec:
|
|
replicas: 2
|
|
selector:
|
|
matchLabels:
|
|
app: wms-inventory
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: wms-inventory
|
|
version: v1
|
|
spec:
|
|
containers:
|
|
- name: wms-inventory
|
|
image: registry.cn-beijing.aliyuncs.com/cpte-wms/wms-inventory-service:latest
|
|
imagePullPolicy: Always
|
|
ports:
|
|
- containerPort: 8080
|
|
name: http
|
|
protocol: TCP
|
|
env:
|
|
- name: SPRING_PROFILES_ACTIVE
|
|
value: "k8s"
|
|
- name: MYSQL_HOST
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: wms-secret
|
|
key: MYSQL_HOST
|
|
- name: MYSQL_PORT
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: wms-secret
|
|
key: MYSQL_PORT
|
|
- name: MYSQL_USERNAME
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: wms-secret
|
|
key: MYSQL_USERNAME
|
|
- name: MYSQL_PASSWORD
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: wms-secret
|
|
key: MYSQL_PASSWORD
|
|
- name: REDIS_HOST
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: wms-secret
|
|
key: REDIS_HOST
|
|
- name: REDIS_PORT
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: wms-secret
|
|
key: REDIS_PORT
|
|
- name: REDIS_PASSWORD
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: wms-secret
|
|
key: REDIS_PASSWORD
|
|
- name: JAVA_OPTS
|
|
value: "-Xms512m -Xmx1g -XX:+UseG1GC -XX:MaxGCPauseMillis=200"
|
|
volumeMounts:
|
|
- name: config-volume
|
|
mountPath: /app/config
|
|
- name: data-volume
|
|
mountPath: /data
|
|
- name: logs-volume
|
|
mountPath: /data/logs
|
|
resources:
|
|
requests:
|
|
memory: "512Mi"
|
|
cpu: "250m"
|
|
limits:
|
|
memory: "1Gi"
|
|
cpu: "500m"
|
|
livenessProbe:
|
|
httpGet:
|
|
path: /actuator/health/liveness
|
|
port: 8080
|
|
scheme: HTTP
|
|
initialDelaySeconds: 60
|
|
periodSeconds: 10
|
|
timeoutSeconds: 3
|
|
failureThreshold: 3
|
|
readinessProbe:
|
|
httpGet:
|
|
path: /actuator/health/readiness
|
|
port: 8080
|
|
scheme: HTTP
|
|
initialDelaySeconds: 30
|
|
periodSeconds: 5
|
|
timeoutSeconds: 3
|
|
failureThreshold: 3
|
|
startupProbe:
|
|
httpGet:
|
|
path: /actuator/health
|
|
port: 8080
|
|
scheme: HTTP
|
|
initialDelaySeconds: 0
|
|
periodSeconds: 5
|
|
timeoutSeconds: 3
|
|
failureThreshold: 30
|
|
volumes:
|
|
- name: config-volume
|
|
configMap:
|
|
name: wms-common-config
|
|
- name: data-volume
|
|
emptyDir: {}
|
|
- name: logs-volume
|
|
emptyDir: {}
|
|
restartPolicy: Always
|
|
terminationGracePeriodSeconds: 30
|
|
dnsPolicy: ClusterFirst
|
|
securityContext: {}
|
|
schedulerName: default-scheduler
|
|
---
|
|
apiVersion: policy/v1
|
|
kind: PodDisruptionBudget
|
|
metadata:
|
|
name: wms-inventory-pdb
|
|
namespace: wms-system
|
|
spec:
|
|
minAvailable: 1
|
|
selector:
|
|
matchLabels:
|
|
app: wms-inventory
|