157 lines
4.1 KiB
YAML
157 lines
4.1 KiB
YAML
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: wms-basic-service
|
|
namespace: wms-system
|
|
labels:
|
|
app: wms-basic
|
|
version: v1
|
|
app.kubernetes.io/name: wms-basic
|
|
app.kubernetes.io/part-of: cpte-wms
|
|
spec:
|
|
replicas: 2
|
|
selector:
|
|
matchLabels:
|
|
app: wms-basic
|
|
version: v1
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: wms-basic
|
|
version: v1
|
|
annotations:
|
|
prometheus.io/scrape: "true"
|
|
prometheus.io/port: "8080"
|
|
prometheus.io/path: "/actuator/prometheus"
|
|
spec:
|
|
containers:
|
|
- name: wms-basic
|
|
image: registry.yourcompany.com/wms/cpte-wms-basic-service:latest
|
|
imagePullPolicy: Always
|
|
ports:
|
|
- containerPort: 8080
|
|
name: http
|
|
protocol: TCP
|
|
- containerPort: 8080
|
|
name: http-metrics
|
|
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: upload-volume
|
|
mountPath: /data/upload
|
|
- name: logs-volume
|
|
mountPath: /app/logs
|
|
- name: config-volume
|
|
mountPath: /app/config
|
|
volumes:
|
|
- name: upload-volume
|
|
persistentVolumeClaim:
|
|
claimName: wms-upload-pvc
|
|
- 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-basic
|
|
topologyKey: kubernetes.io/hostname
|
|
terminationGracePeriodSeconds: 30
|
|
serviceAccountName: default
|
|
securityContext:
|
|
runAsNonRoot: true
|
|
fsGroup: 1000
|