apiVersion: apps/v1
kind: Deployment
metadata:
name: seata-server
namespace: infrastructure
labels:
app: seata-server
spec:
replicas: 2
selector:
matchLabels:
app: seata-server
template:
metadata:
labels:
app: seata-server
spec:
containers:
- name: seata-server
image: bytest-harbor.ur.com.cn/base-image/seata-server:1.3.0
imagePullPolicy: IfNotPresent
env:
- name: SEATA_CONFIG_NAME
value: file:/root/seata-config/registry
ports:
- name: http
containerPort: 8091
protocol: TCP
volumeMounts:
- name: seata-config
mountPath: /root/seata-config
- name: seata-file
mountPath: /root/seata-config-file
volumes:
- name: seata-config
configMap:
name: seata-server-config
- name: seata-file
configMap:
name: seata-server-file
imagePullSecrets:
- name: myregistrykey
---
apiVersion: v1
kind: ConfigMap
metadata:
name: seata-server-config
namespace: infrastructure
data:
registry.conf: |
registry {
type = "nacos"
nacos {
application = "seata-server"
serverAddr = "nacos-service.nacos.svc.devcluster.local"
namespace = "29684f54-d3ce-4d1b-90a0-cdb9ad852fa3"
group = "scp"
}
}
config {
type = "file"
file {
name = "/root/seata-config-file/file.conf"
}
}
---
apiVersion: v1
kind: ConfigMap
metadata:
name: seata-server-file
namespace: infrastructure
data:
file.conf: |
store {
mode = "db"
file {
dir = "sessionStore"
maxBranchSessionSize = 16384
maxGlobalSessionSize = 512
fileWriteBufferCacheSize = 16384
sessionReloadReadSize = 100
flushDiskMode = async
}
db {
store.db.datasource=druid
store.db.dbType=mysql
store.db.driverClassName=com.mysql.jdbc.Driver
store.db.url=jdbc:mysql://192.168.13.175:3306/seata?useUnicode=true&rewriteBatchedStatements=true
store.db.user=root
store.db.password=Ur$pwd%321
store.db.minConn=5
store.db.maxConn=30
store.db.globalTable=global_table
store.db.branchTable=branch_table
store.db.distributedLockTable=distributed_lock
store.db.queryLimit=100
store.db.lockTable=lock_table
store.db.maxWait=5000
}
}
---
apiVersion: v1
kind: Service
metadata:
name: seata-server
namespace: infrastructure
labels:
app: seata-server
spec:
type: ClusterIP
ports:
- port: 8091
targetPort: 8091
protocol: TCP
selector:
app: seata-server