chore(project): 添加项目配置文件和忽略规则
- 添加 Babel 配置文件支持 ES6+ 语法转换 - 添加 ESLint 忽略规则和配置文件 - 添加 Git 忽略规则文件 - 添加 Travis CI 配置文件 - 添加 1.4.2 版本变更日志文件 - 添加 Helm 图表辅助模板文件 - 添加 Helm 忽略规则文件
This commit is contained in:
65
script/server/config/file.conf
Normal file
65
script/server/config/file.conf
Normal file
@@ -0,0 +1,65 @@
|
||||
|
||||
## transaction log store, only used in seata-server
|
||||
store {
|
||||
## store mode: file、db、redis
|
||||
mode = "file"
|
||||
|
||||
## file store property
|
||||
file {
|
||||
## store location dir
|
||||
dir = "sessionStore"
|
||||
# branch session size , if exceeded first try compress lockkey, still exceeded throws exceptions
|
||||
maxBranchSessionSize = 16384
|
||||
# globe session size , if exceeded throws exceptions
|
||||
maxGlobalSessionSize = 512
|
||||
# file buffer size , if exceeded allocate new buffer
|
||||
fileWriteBufferCacheSize = 16384
|
||||
# when recover batch read size
|
||||
sessionReloadReadSize = 100
|
||||
# async, sync
|
||||
flushDiskMode = async
|
||||
}
|
||||
|
||||
## database store property
|
||||
db {
|
||||
## the implement of javax.sql.DataSource, such as DruidDataSource(druid)/BasicDataSource(dbcp)/HikariDataSource(hikari) etc.
|
||||
datasource = "druid"
|
||||
## mysql/oracle/postgresql/h2/oceanbase etc.
|
||||
dbType = "mysql"
|
||||
driverClassName = "com.mysql.jdbc.Driver"
|
||||
## if using mysql to store the data, recommend add rewriteBatchedStatements=true in jdbc connection param
|
||||
url = "jdbc:mysql://127.0.0.1:3306/seata?rewriteBatchedStatements=true"
|
||||
user = "mysql"
|
||||
password = "mysql"
|
||||
minConn = 5
|
||||
maxConn = 100
|
||||
globalTable = "global_table"
|
||||
branchTable = "branch_table"
|
||||
lockTable = "lock_table"
|
||||
queryLimit = 100
|
||||
maxWait = 5000
|
||||
}
|
||||
|
||||
## redis store property
|
||||
redis {
|
||||
## redis mode: single、sentinel
|
||||
mode = "single"
|
||||
## single mode property
|
||||
single {
|
||||
host = "127.0.0.1"
|
||||
port = "6379"
|
||||
}
|
||||
## sentinel mode property
|
||||
sentinel {
|
||||
masterName = ""
|
||||
## such as "10.28.235.65:26379,10.28.235.65:26380,10.28.235.65:26381"
|
||||
sentinelHosts = ""
|
||||
}
|
||||
password = ""
|
||||
database = "0"
|
||||
minConn = 1
|
||||
maxConn = 10
|
||||
maxTotal = 100
|
||||
queryLimit = 100
|
||||
}
|
||||
}
|
||||
33
script/server/config/file.properties
Normal file
33
script/server/config/file.properties
Normal file
@@ -0,0 +1,33 @@
|
||||
store.mode=file
|
||||
store.file.dir=sessionStore
|
||||
store.file.maxBranchSessionSize=16384
|
||||
store.file.maxGlobalSessionSize=512
|
||||
store.file.fileWriteBufferCacheSize=16384
|
||||
store.file.sessionReloadReadSize=100
|
||||
store.file.flushDiskMode=async
|
||||
store.db.datasource=druid
|
||||
store.db.dbType=mysql
|
||||
store.db.driverClassName=com.mysql.jdbc.Driver
|
||||
# if using mysql to store the data, recommend add rewriteBatchedStatements=true in jdbc connection param
|
||||
store.db.url=jdbc:mysql://127.0.0.1:3306/seata?rewriteBatchedStatements=true
|
||||
store.db.user=mysql
|
||||
store.db.password=mysql
|
||||
store.db.minConn=5
|
||||
store.db.maxConn=100
|
||||
store.db.globalTable=global_table
|
||||
store.db.branchTable=branch_table
|
||||
store.db.lockTable=lock_table
|
||||
store.db.queryLimit=100
|
||||
store.db.maxWait=5000
|
||||
|
||||
seata.store.redis.mode=single
|
||||
seata.store.redis.single.host=127.0.0.1
|
||||
seata.store.redis.single.port=6379
|
||||
seata.store.redis.sentinel.masterName=
|
||||
seata.store.redis.sentinel.sentinelHosts=
|
||||
seata.store.redis.password=
|
||||
seata.store.redis.database=0
|
||||
seata.store.redis.minConn=1
|
||||
seata.store.redis.maxConn=10
|
||||
seata.store.redis.maxTotal=100
|
||||
seata.store.redis.queryLimit=100
|
||||
54
script/server/config/file.yml
Normal file
54
script/server/config/file.yml
Normal file
@@ -0,0 +1,54 @@
|
||||
|
||||
## transaction log store, only used in seata-server
|
||||
store:
|
||||
|
||||
## store mode: file、db、redis
|
||||
mode: file
|
||||
## file store property
|
||||
file:
|
||||
## store location dir
|
||||
dir: sessionStore
|
||||
# branch session size , if exceeded first try compress lockkey, still exceeded throws exceptions
|
||||
maxBranchSessionSize: 16384
|
||||
# globe session size , if exceeded throws exceptions
|
||||
maxGlobalSessionSize: 512
|
||||
# file buffer size , if exceeded allocate new buffer
|
||||
fileWriteBufferCacheSize: 16384
|
||||
# when recover batch read size
|
||||
sessionReloadReadSize: 100
|
||||
# async, sync
|
||||
flushDiskMode: async
|
||||
## database store property
|
||||
db:
|
||||
## the implement of javax.sql.DataSource, such as DruidDataSource(druid)/BasicDataSource(dbcp)/HikariDataSource(hikari) etc.
|
||||
datasource: druid
|
||||
## mysql/oracle/postgresql/h2/oceanbase etc.
|
||||
dbType: mysql
|
||||
driverClassName: com.mysql.jdbc.Driver
|
||||
## if using mysql to store the data, recommend add rewriteBatchedStatements=true in jdbc connection param
|
||||
url: jdbc:mysql://127.0.0.1:3306/seata?rewriteBatchedStatements=true
|
||||
user: mysql
|
||||
password: mysql
|
||||
minConn: 5
|
||||
maxConn: 100
|
||||
globalTable: global_table
|
||||
branchTable: branch_table
|
||||
lockTable: lock_table
|
||||
queryLimit: 100
|
||||
maxWait: 5000
|
||||
## redis store property
|
||||
redis:
|
||||
mode: "single"
|
||||
single:
|
||||
host: "127.0.0.1"
|
||||
port: "6379"
|
||||
sentinel:
|
||||
masterName: ""
|
||||
sentinelHosts: ""
|
||||
password: ""
|
||||
database: "0"
|
||||
minConn: 1
|
||||
maxConn: 10
|
||||
maxTotal: 100
|
||||
queryLimit: 100
|
||||
|
||||
91
script/server/config/registry.conf
Normal file
91
script/server/config/registry.conf
Normal file
@@ -0,0 +1,91 @@
|
||||
registry {
|
||||
# file,nacos,eureka,redis,zk,consul,etcd3,sofa
|
||||
type = "file"
|
||||
|
||||
nacos {
|
||||
application = "seata-server"
|
||||
serverAddr = "127.0.0.1:8848"
|
||||
group = "SEATA_GROUP"
|
||||
namespace = ""
|
||||
cluster = "default"
|
||||
username = ""
|
||||
password = ""
|
||||
}
|
||||
eureka {
|
||||
serviceUrl = "http://localhost:8761/eureka"
|
||||
application = "default"
|
||||
weight = "1"
|
||||
}
|
||||
redis {
|
||||
serverAddr = "localhost:6379"
|
||||
db = 0
|
||||
password = ""
|
||||
cluster = "default"
|
||||
timeout = 0
|
||||
}
|
||||
zk {
|
||||
cluster = "default"
|
||||
serverAddr = "127.0.0.1:2181"
|
||||
sessionTimeout = 6000
|
||||
connectTimeout = 2000
|
||||
username = ""
|
||||
password = ""
|
||||
}
|
||||
consul {
|
||||
cluster = "default"
|
||||
serverAddr = "127.0.0.1:8500"
|
||||
}
|
||||
etcd3 {
|
||||
cluster = "default"
|
||||
serverAddr = "http://localhost:2379"
|
||||
}
|
||||
sofa {
|
||||
serverAddr = "127.0.0.1:9603"
|
||||
application = "default"
|
||||
region = "DEFAULT_ZONE"
|
||||
datacenter = "DefaultDataCenter"
|
||||
cluster = "default"
|
||||
group = "SEATA_GROUP"
|
||||
addressWaitTime = "3000"
|
||||
}
|
||||
file {
|
||||
name = "file.conf"
|
||||
}
|
||||
}
|
||||
|
||||
config {
|
||||
# file、nacos 、apollo、zk、consul、etcd3
|
||||
type = "file"
|
||||
|
||||
nacos {
|
||||
serverAddr = "127.0.0.1:8848"
|
||||
namespace = ""
|
||||
group = "SEATA_GROUP"
|
||||
username = ""
|
||||
password = ""
|
||||
dataId = "seataServer.properties"
|
||||
}
|
||||
consul {
|
||||
serverAddr = "127.0.0.1:8500"
|
||||
}
|
||||
apollo {
|
||||
appId = "seata-server"
|
||||
apolloMeta = "http://192.168.1.204:8801"
|
||||
namespace = "application"
|
||||
apolloAccesskeySecret = ""
|
||||
}
|
||||
zk {
|
||||
serverAddr = "127.0.0.1:2181"
|
||||
sessionTimeout = 6000
|
||||
connectTimeout = 2000
|
||||
username = ""
|
||||
password = ""
|
||||
nodePath = "/seata/seata.properties"
|
||||
}
|
||||
etcd3 {
|
||||
serverAddr = "http://localhost:2379"
|
||||
}
|
||||
file {
|
||||
name = "file.conf"
|
||||
}
|
||||
}
|
||||
54
script/server/config/registry.properties
Normal file
54
script/server/config/registry.properties
Normal file
@@ -0,0 +1,54 @@
|
||||
registry.type=file
|
||||
registry.nacos.application=seata-server
|
||||
registry.nacos.serverAddr=127.0.0.1:8848
|
||||
registry.nacos.group=SEATA_GROUP
|
||||
registry.nacos.namespace=
|
||||
registry.nacos.cluster=default
|
||||
registry.nacos.username=
|
||||
registry.nacos.password=
|
||||
registry.eureka.serviceUrl=http://localhost:8761/eureka
|
||||
registry.eureka.application=default
|
||||
registry.eureka.weight=1
|
||||
registry.redis.serverAddr=localhost:6379
|
||||
registry.redis.db=0
|
||||
registry.redis.password=
|
||||
registry.redis.cluster=default
|
||||
registry.redis.timeout=0
|
||||
registry.zk.cluster=default
|
||||
registry.zk.serverAddr=127.0.0.1:2181
|
||||
registry.zk.sessionTimeout=6000
|
||||
registry.zk.connectTimeout=2000
|
||||
registry.zk.username=
|
||||
registry.zk.password=
|
||||
registry.consul.cluster=default
|
||||
registry.consul.serverAddr=127.0.0.1:8500
|
||||
registry.etcd3.cluster=default
|
||||
registry.etcd3.serverAddr=http://localhost:2379
|
||||
registry.sofa.serverAddr=127.0.0.1:9603
|
||||
registry.sofa.application=default
|
||||
registry.sofa.region=DEFAULT_ZONE
|
||||
registry.sofa.datacenter=DefaultDataCenter
|
||||
registry.sofa.cluster=default
|
||||
registry.sofa.group=SEATA_GROUP
|
||||
registry.sofa.addressWaitTime=3000
|
||||
registry.file.name=file.properties
|
||||
config.type=file
|
||||
config.nacos.serverAddr=127.0.0.1:8848
|
||||
config.nacos.namespace=
|
||||
config.nacos.group=SEATA_GROUP
|
||||
config.nacos.username=
|
||||
config.nacos.password=
|
||||
config.nacos.dataId=seataServer.properties
|
||||
config.consul.serverAddr=127.0.0.1:8500
|
||||
config.apollo.appId=seata-server
|
||||
config.apollo.apolloMeta=http://192.168.1.204:8801
|
||||
config.apollo.namespace=application
|
||||
config.apollo.apolloAccesskeySecret=
|
||||
config.zk.serverAddr=127.0.0.1:2181
|
||||
config.zk.sessionTimeout=6000
|
||||
config.zk.connectTimeout=2000
|
||||
config.zk.username=
|
||||
config.zk.password=
|
||||
config.zk.nodePath=/seata/seata.properties
|
||||
config.etcd3.serverAddr=http://localhost:2379
|
||||
config.file.name=file.properties
|
||||
91
script/server/config/registry.yml
Normal file
91
script/server/config/registry.yml
Normal file
@@ -0,0 +1,91 @@
|
||||
registry:
|
||||
# file,nacos,eureka,redis,zk,consul,etcd3,sofa
|
||||
type: file
|
||||
|
||||
nacos:
|
||||
application: seata-server
|
||||
serverAddr: 127.0.0.1:8848
|
||||
group: SEATA_GROUP
|
||||
namespace:
|
||||
cluster: default
|
||||
username:
|
||||
password:
|
||||
|
||||
eureka:
|
||||
serviceUrl: http://localhost:8761/eureka
|
||||
application: default
|
||||
weight: 1
|
||||
|
||||
redis:
|
||||
serverAddr: localhost:6379
|
||||
db: 0
|
||||
password:
|
||||
cluster: default
|
||||
timeout: 0
|
||||
|
||||
zk:
|
||||
cluster: default
|
||||
serverAddr: 127.0.0.1:2181
|
||||
sessionTimeout: 6000
|
||||
connectTimeout: 2000
|
||||
username:
|
||||
password:
|
||||
|
||||
consul:
|
||||
cluster: default
|
||||
serverAddr: 127.0.0.1:8500
|
||||
|
||||
etcd3:
|
||||
cluster: default
|
||||
serverAddr: http://localhost:2379
|
||||
|
||||
sofa:
|
||||
serverAddr: 127.0.0.1:9603
|
||||
application: default
|
||||
region: DEFAULT_ZONE
|
||||
datacenter: DefaultDataCenter
|
||||
cluster: default
|
||||
group: SEATA_GROUP
|
||||
addressWaitTime: 3000
|
||||
|
||||
file:
|
||||
name: file.yml
|
||||
|
||||
|
||||
|
||||
config:
|
||||
# file、nacos 、apollo、zk、consul、etcd3
|
||||
type: file
|
||||
|
||||
nacos:
|
||||
serverAddr: 127.0.0.1:8848
|
||||
namespace:
|
||||
group: SEATA_GROUP
|
||||
username:
|
||||
password:
|
||||
dataId: seataServer.properties
|
||||
|
||||
consul:
|
||||
serverAddr: 127.0.0.1:8500
|
||||
|
||||
apollo:
|
||||
appId: seata-server
|
||||
apolloMeta: http://192.168.1.204:8801
|
||||
namespace: application
|
||||
apolloAccesskeySecret:
|
||||
|
||||
zk:
|
||||
serverAddr: 127.0.0.1:2181
|
||||
sessionTimeout: 6000
|
||||
connectTimeout: 2000
|
||||
username:
|
||||
password:
|
||||
nodePath: /seata/seata.properties
|
||||
|
||||
etcd3:
|
||||
serverAddr: http://localhost:2379
|
||||
|
||||
file:
|
||||
name: file.yml
|
||||
|
||||
|
||||
56
script/server/db/mysql.sql
Normal file
56
script/server/db/mysql.sql
Normal file
@@ -0,0 +1,56 @@
|
||||
-- -------------------------------- The script used when storeMode is 'db' --------------------------------
|
||||
-- the table to store GlobalSession data
|
||||
CREATE TABLE IF NOT EXISTS `global_table`
|
||||
(
|
||||
`xid` VARCHAR(128) NOT NULL,
|
||||
`transaction_id` BIGINT,
|
||||
`status` TINYINT NOT NULL,
|
||||
`application_id` VARCHAR(32),
|
||||
`transaction_service_group` VARCHAR(32),
|
||||
`transaction_name` VARCHAR(128),
|
||||
`timeout` INT,
|
||||
`begin_time` BIGINT,
|
||||
`application_data` VARCHAR(2000),
|
||||
`gmt_create` DATETIME,
|
||||
`gmt_modified` DATETIME,
|
||||
PRIMARY KEY (`xid`),
|
||||
KEY `idx_gmt_modified_status` (`gmt_modified`, `status`),
|
||||
KEY `idx_transaction_id` (`transaction_id`)
|
||||
) ENGINE = InnoDB
|
||||
DEFAULT CHARSET = utf8;
|
||||
|
||||
-- the table to store BranchSession data
|
||||
CREATE TABLE IF NOT EXISTS `branch_table`
|
||||
(
|
||||
`branch_id` BIGINT NOT NULL,
|
||||
`xid` VARCHAR(128) NOT NULL,
|
||||
`transaction_id` BIGINT,
|
||||
`resource_group_id` VARCHAR(32),
|
||||
`resource_id` VARCHAR(256),
|
||||
`branch_type` VARCHAR(8),
|
||||
`status` TINYINT,
|
||||
`client_id` VARCHAR(64),
|
||||
`application_data` VARCHAR(2000),
|
||||
`gmt_create` DATETIME(6),
|
||||
`gmt_modified` DATETIME(6),
|
||||
PRIMARY KEY (`branch_id`),
|
||||
KEY `idx_xid` (`xid`)
|
||||
) ENGINE = InnoDB
|
||||
DEFAULT CHARSET = utf8;
|
||||
|
||||
-- the table to store lock data
|
||||
CREATE TABLE IF NOT EXISTS `lock_table`
|
||||
(
|
||||
`row_key` VARCHAR(128) NOT NULL,
|
||||
`xid` VARCHAR(128),
|
||||
`transaction_id` BIGINT,
|
||||
`branch_id` BIGINT NOT NULL,
|
||||
`resource_id` VARCHAR(256),
|
||||
`table_name` VARCHAR(32),
|
||||
`pk` VARCHAR(36),
|
||||
`gmt_create` DATETIME,
|
||||
`gmt_modified` DATETIME,
|
||||
PRIMARY KEY (`row_key`),
|
||||
KEY `idx_branch_id` (`branch_id`)
|
||||
) ENGINE = InnoDB
|
||||
DEFAULT CHARSET = utf8;
|
||||
56
script/server/db/oracle.sql
Normal file
56
script/server/db/oracle.sql
Normal file
@@ -0,0 +1,56 @@
|
||||
-- -------------------------------- The script used when storeMode is 'db' --------------------------------
|
||||
-- the table to store GlobalSession data
|
||||
CREATE TABLE global_table
|
||||
(
|
||||
xid VARCHAR2(128) NOT NULL,
|
||||
transaction_id NUMBER(19),
|
||||
status NUMBER(3) NOT NULL,
|
||||
application_id VARCHAR2(32),
|
||||
transaction_service_group VARCHAR2(32),
|
||||
transaction_name VARCHAR2(128),
|
||||
timeout NUMBER(10),
|
||||
begin_time NUMBER(19),
|
||||
application_data VARCHAR2(2000),
|
||||
gmt_create TIMESTAMP(0),
|
||||
gmt_modified TIMESTAMP(0),
|
||||
PRIMARY KEY (xid)
|
||||
);
|
||||
|
||||
CREATE INDEX idx_gmt_modified_status ON global_table (gmt_modified, status);
|
||||
CREATE INDEX idx_transaction_id ON global_table (transaction_id);
|
||||
|
||||
-- the table to store BranchSession data
|
||||
CREATE TABLE branch_table
|
||||
(
|
||||
branch_id NUMBER(19) NOT NULL,
|
||||
xid VARCHAR2(128) NOT NULL,
|
||||
transaction_id NUMBER(19),
|
||||
resource_group_id VARCHAR2(32),
|
||||
resource_id VARCHAR2(256),
|
||||
branch_type VARCHAR2(8),
|
||||
status NUMBER(3),
|
||||
client_id VARCHAR2(64),
|
||||
application_data VARCHAR2(2000),
|
||||
gmt_create TIMESTAMP(6),
|
||||
gmt_modified TIMESTAMP(6),
|
||||
PRIMARY KEY (branch_id)
|
||||
);
|
||||
|
||||
CREATE INDEX idx_xid ON branch_table (xid);
|
||||
|
||||
-- the table to store lock data
|
||||
CREATE TABLE lock_table
|
||||
(
|
||||
row_key VARCHAR2(128) NOT NULL,
|
||||
xid VARCHAR2(128),
|
||||
transaction_id NUMBER(19),
|
||||
branch_id NUMBER(19) NOT NULL,
|
||||
resource_id VARCHAR2(256),
|
||||
table_name VARCHAR2(32),
|
||||
pk VARCHAR2(36),
|
||||
gmt_create TIMESTAMP(0),
|
||||
gmt_modified TIMESTAMP(0),
|
||||
PRIMARY KEY (row_key)
|
||||
);
|
||||
|
||||
CREATE INDEX idx_branch_id ON lock_table (branch_id);
|
||||
56
script/server/db/postgresql.sql
Normal file
56
script/server/db/postgresql.sql
Normal file
@@ -0,0 +1,56 @@
|
||||
-- -------------------------------- The script used when storeMode is 'db' --------------------------------
|
||||
-- the table to store GlobalSession data
|
||||
CREATE TABLE IF NOT EXISTS public.global_table
|
||||
(
|
||||
xid VARCHAR(128) NOT NULL,
|
||||
transaction_id BIGINT,
|
||||
status SMALLINT NOT NULL,
|
||||
application_id VARCHAR(32),
|
||||
transaction_service_group VARCHAR(32),
|
||||
transaction_name VARCHAR(128),
|
||||
timeout INT,
|
||||
begin_time BIGINT,
|
||||
application_data VARCHAR(2000),
|
||||
gmt_create TIMESTAMP(0),
|
||||
gmt_modified TIMESTAMP(0),
|
||||
CONSTRAINT pk_global_table PRIMARY KEY (xid)
|
||||
);
|
||||
|
||||
CREATE INDEX idx_gmt_modified_status ON public.global_table (gmt_modified, status);
|
||||
CREATE INDEX idx_transaction_id ON public.global_table (transaction_id);
|
||||
|
||||
-- the table to store BranchSession data
|
||||
CREATE TABLE IF NOT EXISTS public.branch_table
|
||||
(
|
||||
branch_id BIGINT NOT NULL,
|
||||
xid VARCHAR(128) NOT NULL,
|
||||
transaction_id BIGINT,
|
||||
resource_group_id VARCHAR(32),
|
||||
resource_id VARCHAR(256),
|
||||
branch_type VARCHAR(8),
|
||||
status SMALLINT,
|
||||
client_id VARCHAR(64),
|
||||
application_data VARCHAR(2000),
|
||||
gmt_create TIMESTAMP(6),
|
||||
gmt_modified TIMESTAMP(6),
|
||||
CONSTRAINT pk_branch_table PRIMARY KEY (branch_id)
|
||||
);
|
||||
|
||||
CREATE INDEX idx_xid ON public.branch_table (xid);
|
||||
|
||||
-- the table to store lock data
|
||||
CREATE TABLE IF NOT EXISTS public.lock_table
|
||||
(
|
||||
row_key VARCHAR(128) NOT NULL,
|
||||
xid VARCHAR(128),
|
||||
transaction_id BIGINT,
|
||||
branch_id BIGINT NOT NULL,
|
||||
resource_id VARCHAR(256),
|
||||
table_name VARCHAR(32),
|
||||
pk VARCHAR(36),
|
||||
gmt_create TIMESTAMP(0),
|
||||
gmt_modified TIMESTAMP(0),
|
||||
CONSTRAINT pk_lock_table PRIMARY KEY (row_key)
|
||||
);
|
||||
|
||||
CREATE INDEX idx_branch_id ON public.lock_table (branch_id);
|
||||
10
script/server/docker-compose/docker-compose.yaml
Normal file
10
script/server/docker-compose/docker-compose.yaml
Normal file
@@ -0,0 +1,10 @@
|
||||
version: "3"
|
||||
services:
|
||||
seata-server:
|
||||
image: seataio/seata-server
|
||||
hostname: seata-server
|
||||
ports:
|
||||
- "8091:8091"
|
||||
environment:
|
||||
- SEATA_PORT=8091
|
||||
- STORE_MODE=file
|
||||
22
script/server/helm/seata-server/.helmignore
Normal file
22
script/server/helm/seata-server/.helmignore
Normal file
@@ -0,0 +1,22 @@
|
||||
# Patterns to ignore when building packages.
|
||||
# This supports shell glob matching, relative path matching, and
|
||||
# negation (prefixed with !). Only one pattern per line.
|
||||
.DS_Store
|
||||
# Common VCS dirs
|
||||
.git/
|
||||
.gitignore
|
||||
.bzr/
|
||||
.bzrignore
|
||||
.hg/
|
||||
.hgignore
|
||||
.svn/
|
||||
# Common backup files
|
||||
*.swp
|
||||
*.bak
|
||||
*.tmp
|
||||
*~
|
||||
# Various IDEs
|
||||
.project
|
||||
.idea/
|
||||
*.tmproj
|
||||
.vscode/
|
||||
5
script/server/helm/seata-server/Chart.yaml
Normal file
5
script/server/helm/seata-server/Chart.yaml
Normal file
@@ -0,0 +1,5 @@
|
||||
apiVersion: v1
|
||||
appVersion: "1.0"
|
||||
description: Seata Server
|
||||
name: seata-server
|
||||
version: 1.0.0
|
||||
15
script/server/helm/seata-server/templates/NOTES.txt
Normal file
15
script/server/helm/seata-server/templates/NOTES.txt
Normal file
@@ -0,0 +1,15 @@
|
||||
1. Get the application URL by running these commands:
|
||||
{{- if contains "NodePort" .Values.service.type }}
|
||||
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "seata-server.fullname" . }})
|
||||
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
|
||||
echo http://$NODE_IP:$NODE_PORT
|
||||
{{- else if contains "LoadBalancer" .Values.service.type }}
|
||||
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
|
||||
You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "seata-server.fullname" . }}'
|
||||
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "seata-server.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
|
||||
echo http://$SERVICE_IP:{{ .Values.service.port }}
|
||||
{{- else if contains "ClusterIP" .Values.service.type }}
|
||||
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "seata-server.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
|
||||
echo "Visit http://127.0.0.1:8080 to use your application"
|
||||
kubectl port-forward $POD_NAME 8080:80
|
||||
{{- end }}
|
||||
56
script/server/helm/seata-server/templates/_helpers.tpl
Normal file
56
script/server/helm/seata-server/templates/_helpers.tpl
Normal file
@@ -0,0 +1,56 @@
|
||||
{{/* vim: set filetype=mustache: */}}
|
||||
{{/*
|
||||
Expand the name of the chart.
|
||||
*/}}
|
||||
{{- define "seata-server.name" -}}
|
||||
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Create a default fully qualified app name.
|
||||
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
|
||||
If release name contains chart name it will be used as a full name.
|
||||
*/}}
|
||||
{{- define "seata-server.fullname" -}}
|
||||
{{- if .Values.fullnameOverride -}}
|
||||
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
|
||||
{{- else -}}
|
||||
{{- $name := default .Chart.Name .Values.nameOverride -}}
|
||||
{{- if contains $name .Release.Name -}}
|
||||
{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
|
||||
{{- else -}}
|
||||
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Create chart name and version as used by the chart label.
|
||||
*/}}
|
||||
{{- define "seata-server.chart" -}}
|
||||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Common labels
|
||||
*/}}
|
||||
{{- define "seata-server.labels" -}}
|
||||
app.kubernetes.io/name: {{ include "seata-server.name" . }}
|
||||
helm.sh/chart: {{ include "seata-server.chart" . }}
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
{{- if .Chart.AppVersion }}
|
||||
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
|
||||
{{- end }}
|
||||
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Create the name of the service account to use
|
||||
*/}}
|
||||
{{- define "seata-server.serviceAccountName" -}}
|
||||
{{- if .Values.serviceAccount.create -}}
|
||||
{{ default (include "seata-server.fullname" .) .Values.serviceAccount.name }}
|
||||
{{- else -}}
|
||||
{{ default "default" .Values.serviceAccount.name }}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
71
script/server/helm/seata-server/templates/deployment.yaml
Normal file
71
script/server/helm/seata-server/templates/deployment.yaml
Normal file
@@ -0,0 +1,71 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
{{- if .Values.namespace }}
|
||||
namespace: {{ .Values.namespace }}
|
||||
{{- end}}
|
||||
name: {{ include "seata-server.name" . }}
|
||||
labels:
|
||||
{{ include "seata-server.labels" . | indent 4 }}
|
||||
spec:
|
||||
replicas: {{ .Values.replicaCount }}
|
||||
selector:
|
||||
matchLabels:
|
||||
app.kubernetes.io/name: {{ include "seata-server.name" . }}
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app.kubernetes.io/name: {{ include "seata-server.name" . }}
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
spec:
|
||||
containers:
|
||||
- name: {{ .Chart.Name }}
|
||||
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
|
||||
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
||||
ports:
|
||||
- name: http
|
||||
containerPort: 8091
|
||||
protocol: TCP
|
||||
{{- if .Values.volume }}
|
||||
volumeMounts:
|
||||
{{- range .Values.volume }}
|
||||
- name: {{ .name }}
|
||||
mountPath: {{ .mountPath }}
|
||||
{{- end}}
|
||||
{{- end}}
|
||||
{{- if .Values.env }}
|
||||
env:
|
||||
{{- if .Values.env.seataIp }}
|
||||
- name: SEATA_IP
|
||||
value: {{ .Values.env.seataIp | quote }}
|
||||
{{- end }}
|
||||
{{- if .Values.env.seataPort }}
|
||||
- name: SEATA_PORT
|
||||
value: {{ .Values.env.seataPort | quote }}
|
||||
{{- end }}
|
||||
{{- if .Values.env.seataEnv }}
|
||||
- name: SEATA_ENV
|
||||
value: {{ .Values.env.seataEnv }}
|
||||
{{- end }}
|
||||
{{- if .Values.env.seataConfigName }}
|
||||
- name: SEATA_CONFIG_NAME
|
||||
value: {{ .Values.env.seataConfigName }}
|
||||
{{- end }}
|
||||
{{- if .Values.env.serverNode }}
|
||||
- name: SERVER_NODE
|
||||
value: {{ .Values.env.serverNode | quote }}
|
||||
{{- end }}
|
||||
{{- if .Values.env.storeMode }}
|
||||
- name: STORE_MODE
|
||||
value: {{ .Values.env.storeMode }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if .Values.volume }}
|
||||
volumes:
|
||||
{{- range .Values.volume }}
|
||||
- name: {{ .name }}
|
||||
hostPath:
|
||||
path: {{ .hostPath}}
|
||||
{{- end}}
|
||||
{{- end}}
|
||||
16
script/server/helm/seata-server/templates/service.yaml
Normal file
16
script/server/helm/seata-server/templates/service.yaml
Normal file
@@ -0,0 +1,16 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ include "seata-server.fullname" . }}
|
||||
labels:
|
||||
{{ include "seata-server.labels" . | indent 4 }}
|
||||
spec:
|
||||
type: {{ .Values.service.type }}
|
||||
ports:
|
||||
- port: {{ .Values.service.port }}
|
||||
targetPort: http
|
||||
protocol: TCP
|
||||
name: http
|
||||
selector:
|
||||
app.kubernetes.io/name: {{ include "seata-server.name" . }}
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
@@ -0,0 +1,15 @@
|
||||
apiVersion: v1
|
||||
kind: Pod
|
||||
metadata:
|
||||
name: "{{ include "seata-server.fullname" . }}-test-connection"
|
||||
labels:
|
||||
{{ include "seata-server.labels" . | indent 4 }}
|
||||
annotations:
|
||||
"helm.sh/hook": test-success
|
||||
spec:
|
||||
containers:
|
||||
- name: wget
|
||||
image: busybox
|
||||
command: ['wget']
|
||||
args: ['{{ include "seata-server.fullname" . }}:{{ .Values.service.port }}']
|
||||
restartPolicy: Never
|
||||
17
script/server/helm/seata-server/values.yaml
Normal file
17
script/server/helm/seata-server/values.yaml
Normal file
@@ -0,0 +1,17 @@
|
||||
replicaCount: 1
|
||||
|
||||
namespace: default
|
||||
|
||||
image:
|
||||
repository: seataio/seata-server
|
||||
tag: latest
|
||||
pullPolicy: IfNotPresent
|
||||
|
||||
service:
|
||||
type: NodePort
|
||||
port: 30091
|
||||
|
||||
env:
|
||||
seataPort: "8091"
|
||||
storeMode: "file"
|
||||
serverNode: "1"
|
||||
49
script/server/kubernetes/seata-server.yaml
Normal file
49
script/server/kubernetes/seata-server.yaml
Normal file
@@ -0,0 +1,49 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: seata-server
|
||||
namespace: default
|
||||
labels:
|
||||
k8s-app: seata-server
|
||||
spec:
|
||||
type: NodePort
|
||||
ports:
|
||||
- port: 8091
|
||||
nodePort: 30091
|
||||
protocol: TCP
|
||||
name: http
|
||||
selector:
|
||||
k8s-app: seata-server
|
||||
|
||||
---
|
||||
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: seata-server
|
||||
namespace: default
|
||||
labels:
|
||||
k8s-app: seata-server
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
k8s-app: seata-server
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
k8s-app: seata-server
|
||||
spec:
|
||||
containers:
|
||||
- name: seata-server
|
||||
image: docker.io/seataio/seata-server:latest
|
||||
imagePullPolicy: IfNotPresent
|
||||
env:
|
||||
- name: SEATA_PORT
|
||||
value: "8091"
|
||||
- name: STORE_MODE
|
||||
value: file
|
||||
ports:
|
||||
- name: http
|
||||
containerPort: 8091
|
||||
protocol: TCP
|
||||
Reference in New Issue
Block a user