1. apiVersion: apps/v1
    2. kind: Deployment
    3. metadata:
    4. name: seata-server
    5. namespace: infrastructure
    6. labels:
    7. app: seata-server
    8. spec:
    9. replicas: 2
    10. selector:
    11. matchLabels:
    12. app: seata-server
    13. template:
    14. metadata:
    15. labels:
    16. app: seata-server
    17. spec:
    18. containers:
    19. - name: seata-server
    20. image: bytest-harbor.ur.com.cn/base-image/seata-server:1.3.0
    21. imagePullPolicy: IfNotPresent
    22. env:
    23. - name: SEATA_CONFIG_NAME
    24. value: file:/root/seata-config/registry
    25. ports:
    26. - name: http
    27. containerPort: 8091
    28. protocol: TCP
    29. volumeMounts:
    30. - name: seata-config
    31. mountPath: /root/seata-config
    32. - name: seata-file
    33. mountPath: /root/seata-config-file
    34. volumes:
    35. - name: seata-config
    36. configMap:
    37. name: seata-server-config
    38. - name: seata-file
    39. configMap:
    40. name: seata-server-file
    41. imagePullSecrets:
    42. - name: myregistrykey
    43. ---
    44. apiVersion: v1
    45. kind: ConfigMap
    46. metadata:
    47. name: seata-server-config
    48. namespace: infrastructure
    49. data:
    50. registry.conf: |
    51. registry {
    52. type = "nacos"
    53. nacos {
    54. application = "seata-server"
    55. serverAddr = "nacos-service.nacos.svc.devcluster.local"
    56. namespace = "29684f54-d3ce-4d1b-90a0-cdb9ad852fa3"
    57. group = "scp"
    58. }
    59. }
    60. config {
    61. type = "file"
    62. file {
    63. name = "/root/seata-config-file/file.conf"
    64. }
    65. }
    66. ---
    67. apiVersion: v1
    68. kind: ConfigMap
    69. metadata:
    70. name: seata-server-file
    71. namespace: infrastructure
    72. data:
    73. file.conf: |
    74. store {
    75. mode = "db"
    76. file {
    77. dir = "sessionStore"
    78. maxBranchSessionSize = 16384
    79. maxGlobalSessionSize = 512
    80. fileWriteBufferCacheSize = 16384
    81. sessionReloadReadSize = 100
    82. flushDiskMode = async
    83. }
    84. db {
    85. store.db.datasource=druid
    86. store.db.dbType=mysql
    87. store.db.driverClassName=com.mysql.jdbc.Driver
    88. store.db.url=jdbc:mysql://192.168.13.175:3306/seata?useUnicode=true&rewriteBatchedStatements=true
    89. store.db.user=root
    90. store.db.password=Ur$pwd%321
    91. store.db.minConn=5
    92. store.db.maxConn=30
    93. store.db.globalTable=global_table
    94. store.db.branchTable=branch_table
    95. store.db.distributedLockTable=distributed_lock
    96. store.db.queryLimit=100
    97. store.db.lockTable=lock_table
    98. store.db.maxWait=5000
    99. }
    100. }
    101. ---
    102. apiVersion: v1
    103. kind: Service
    104. metadata:
    105. name: seata-server
    106. namespace: infrastructure
    107. labels:
    108. app: seata-server
    109. spec:
    110. type: ClusterIP
    111. ports:
    112. - port: 8091
    113. targetPort: 8091
    114. protocol: TCP
    115. selector:
    116. app: seata-server