configmap.yaml
2.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
apiVersion: v1
kind: ConfigMap
metadata:
name: inventory-service-config
namespace: ecommerce
labels:
app: inventory-service
data:
application.yml: |
server:
port: 8080
servlet:
context-path: /api/inventory
spring:
application:
name: inventory-service
profiles:
active: production
# PostgreSQL 数据库配置
datasource:
url: jdbc:postgresql://postgresql-service:5432/ecommerce
username: admin
password: ${POSTGRES_PASSWORD}
driver-class-name: org.postgresql.Driver
hikari:
maximum-pool-size: 10
minimum-idle: 2
connection-timeout: 30000
idle-timeout: 600000
max-lifetime: 1800000
# JPA 配置
jpa:
hibernate:
ddl-auto: validate
naming:
physical-strategy: org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
show-sql: false
properties:
hibernate:
dialect: org.hibernate.dialect.PostgreSQLDialect
format_sql: true
jdbc:
batch_size: 20
order_inserts: true
order_updates: true
# MongoDB 配置
data:
mongodb:
uri: mongodb://admin:${MONGO_PASSWORD}@mongodb-service:27017/ecommerce?authSource=admin
database: ecommerce
auto-index-creation: true
# Redis 配置
redis:
host: redis-service
port: 6379
password: ${REDIS_PASSWORD}
timeout: 2000
lettuce:
pool:
max-active: 10
max-idle: 5
min-idle: 2
max-wait: 1000
# RabbitMQ 配置
spring:
rabbitmq:
host: rabbitmq-service
port: 5672
username: guest
password: ${RABBITMQ_PASSWORD}
virtual-host: /
# 缓存配置
cache:
type: redis
redis:
time-to-live: 1800000
cache-null-values: false
# 外部服务配置
service:
product:
url: http://product-service:8080
order:
url: http://order-service:8080
# 日志配置
logging:
level:
com.ecommerce.inventoryservice: DEBUG
org.hibernate.SQL: WARN
org.hibernate.type.descriptor.sql.BasicBinder: WARN
org.springframework.data.mongodb.core: WARN
# Actuator 配置
management:
endpoints:
web:
exposure:
include: health,info,metrics,prometheus
endpoint:
health:
show-details: always
probes:
enabled: true