apiVersion: apps/v1 kind: Deployment metadata: name: ${APP_NAME} namespace: ${NAMESPACE} labels: app: ${APP_NAME} spec: replicas: ${REPLICAS} selector: matchLabels: app: ${APP_NAME} template: metadata: labels: app: ${APP_NAME} spec: affinity: nodeAffinity: requiredDuringSchedulingIgnoredDuringExecution: nodeSelectorTerms: - matchExpressions: - key: schbrain.deploy operator: In values: - ${NODE_TAG} terminationGracePeriodSeconds: 20 initContainers: - name: ${APP_NAME}-init image: registry-vpc.cn-hangzhou.aliyuncs.com/acs/busybox command: [ 'mkdir', '-p', '/data/logs/gc', '/data/heapdump' ] volumeMounts: - name: ${APP_NAME}-volume mountPath: /data containers: - name: ${APP_NAME} image: ${IMAGE} imagePullPolicy: IfNotPresent resources: requests: memory: ${MEMORY_REQUEST} limits: memory: ${MEMORY_LIMIT} ports: - containerPort: ${PORT} protocol: TCP - containerPort: 1024 protocol: TCP #if($PROFILE != 'dev') startupProbe: httpGet: scheme: HTTP path: /actuator/health port: 1024 initialDelaySeconds: 20 failureThreshold: 18 periodSeconds: 5 livenessProbe: httpGet: scheme: HTTP path: /actuator/health/liveness port: 1024 periodSeconds: 10 readinessProbe: httpGet: scheme: HTTP path: /actuator/health/readiness port: 1024 periodSeconds: 10 #end volumeMounts: - name: ${APP_NAME}-volume mountPath: /data volumes: - name: ${APP_NAME}-volume hostPath: path: /share/pod/data/${APP_NAME} type: DirectoryOrCreate