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