148 lines
3.9 KiB
YAML
148 lines
3.9 KiB
YAML
|
|
apiVersion: apps/v1
|
||
|
|
kind: Deployment
|
||
|
|
metadata:
|
||
|
|
name: wms-outbound-service
|
||
|
|
namespace: wms-system
|
||
|
|
labels:
|
||
|
|
app: wms-outbound
|
||
|
|
version: v1
|
||
|
|
app.kubernetes.io/name: wms-outbound
|
||
|
|
app.kubernetes.io/part-of: cpte-wms
|
||
|
|
spec:
|
||
|
|
replicas: 2
|
||
|
|
selector:
|
||
|
|
matchLabels:
|
||
|
|
app: wms-outbound
|
||
|
|
version: v1
|
||
|
|
template:
|
||
|
|
metadata:
|
||
|
|
labels:
|
||
|
|
app: wms-outbound
|
||
|
|
version: v1
|
||
|
|
annotations:
|
||
|
|
prometheus.io/scrape: "true"
|
||
|
|
prometheus.io/port: "8080"
|
||
|
|
prometheus.io/path: "/actuator/prometheus"
|
||
|
|
spec:
|
||
|
|
containers:
|
||
|
|
- name: wms-outbound
|
||
|
|
image: registry.yourcompany.com/wms/cpte-wms-outbound-service:latest
|
||
|
|
imagePullPolicy: Always
|
||
|
|
ports:
|
||
|
|
- containerPort: 8080
|
||
|
|
name: http
|
||
|
|
protocol: TCP
|
||
|
|
env:
|
||
|
|
- name: SPRING_PROFILES_ACTIVE
|
||
|
|
value: "k8s"
|
||
|
|
- name: SERVER_PORT
|
||
|
|
value: "8080"
|
||
|
|
- name: REDIS_HOST
|
||
|
|
valueFrom:
|
||
|
|
secretKeyRef:
|
||
|
|
name: wms-redis-secret
|
||
|
|
key: host
|
||
|
|
- name: REDIS_PORT
|
||
|
|
valueFrom:
|
||
|
|
secretKeyRef:
|
||
|
|
name: wms-redis-secret
|
||
|
|
key: port
|
||
|
|
- name: REDIS_PASSWORD
|
||
|
|
valueFrom:
|
||
|
|
secretKeyRef:
|
||
|
|
name: wms-redis-secret
|
||
|
|
key: password
|
||
|
|
- name: MYSQL_HOST
|
||
|
|
valueFrom:
|
||
|
|
secretKeyRef:
|
||
|
|
name: wms-mysql-secret
|
||
|
|
key: host
|
||
|
|
- name: MYSQL_PORT
|
||
|
|
valueFrom:
|
||
|
|
secretKeyRef:
|
||
|
|
name: wms-mysql-secret
|
||
|
|
key: port
|
||
|
|
- name: MYSQL_USERNAME
|
||
|
|
valueFrom:
|
||
|
|
secretKeyRef:
|
||
|
|
name: wms-mysql-secret
|
||
|
|
key: username
|
||
|
|
- name: MYSQL_PASSWORD
|
||
|
|
valueFrom:
|
||
|
|
secretKeyRef:
|
||
|
|
name: wms-mysql-secret
|
||
|
|
key: password
|
||
|
|
- name: MINIO_ENDPOINT
|
||
|
|
valueFrom:
|
||
|
|
configMapKeyRef:
|
||
|
|
name: wms-common-config
|
||
|
|
key: MINIO_ENDPOINT
|
||
|
|
- name: MINIO_ACCESS_KEY
|
||
|
|
valueFrom:
|
||
|
|
secretKeyRef:
|
||
|
|
name: wms-minio-secret
|
||
|
|
key: access-key
|
||
|
|
- name: MINIO_SECRET_KEY
|
||
|
|
valueFrom:
|
||
|
|
secretKeyRef:
|
||
|
|
name: wms-minio-secret
|
||
|
|
key: secret-key
|
||
|
|
resources:
|
||
|
|
requests:
|
||
|
|
cpu: "500m"
|
||
|
|
memory: "512Mi"
|
||
|
|
limits:
|
||
|
|
cpu: "2"
|
||
|
|
memory: "4Gi"
|
||
|
|
livenessProbe:
|
||
|
|
httpGet:
|
||
|
|
path: /actuator/health/liveness
|
||
|
|
port: 8080
|
||
|
|
initialDelaySeconds: 60
|
||
|
|
periodSeconds: 10
|
||
|
|
timeoutSeconds: 5
|
||
|
|
failureThreshold: 3
|
||
|
|
readinessProbe:
|
||
|
|
httpGet:
|
||
|
|
path: /actuator/health/readiness
|
||
|
|
port: 8080
|
||
|
|
initialDelaySeconds: 30
|
||
|
|
periodSeconds: 10
|
||
|
|
timeoutSeconds: 5
|
||
|
|
failureThreshold: 3
|
||
|
|
startupProbe:
|
||
|
|
httpGet:
|
||
|
|
path: /actuator/health
|
||
|
|
port: 8080
|
||
|
|
initialDelaySeconds: 0
|
||
|
|
periodSeconds: 5
|
||
|
|
timeoutSeconds: 3
|
||
|
|
failureThreshold: 60
|
||
|
|
volumeMounts:
|
||
|
|
- name: logs-volume
|
||
|
|
mountPath: /app/logs
|
||
|
|
- name: config-volume
|
||
|
|
mountPath: /app/config
|
||
|
|
volumes:
|
||
|
|
- name: logs-volume
|
||
|
|
emptyDir: {}
|
||
|
|
- name: config-volume
|
||
|
|
configMap:
|
||
|
|
name: wms-common-config
|
||
|
|
affinity:
|
||
|
|
podAntiAffinity:
|
||
|
|
preferredDuringSchedulingIgnoredDuringExecution:
|
||
|
|
- weight: 100
|
||
|
|
podAffinityTerm:
|
||
|
|
labelSelector:
|
||
|
|
matchExpressions:
|
||
|
|
- key: app
|
||
|
|
operator: In
|
||
|
|
values:
|
||
|
|
- wms-outbound
|
||
|
|
topologyKey: kubernetes.io/hostname
|
||
|
|
terminationGracePeriodSeconds: 30
|
||
|
|
securityContext:
|
||
|
|
runAsNonRoot: true
|
||
|
|
fsGroup: 1000
|