Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
wrr-cat
apollo
提交
1e5a9190
apollo
项目概览
wrr-cat
/
apollo
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
apollo
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
1e5a9190
编写于
8月 30, 2018
作者:
J
Jason Song
提交者:
GitHub
8月 30, 2018
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #1416 from AiotCEO/kubernetes
增加 kubernetes 支持
上级
bcb4b58d
49906bc0
变更
44
展开全部
显示空白变更内容
内联
并排
Showing
44 changed file
with
3491 addition
and
1 deletion
+3491
-1
apollo-portal/src/main/docker/Dockerfile
apollo-portal/src/main/docker/Dockerfile
+1
-1
scripts/apollo-on-kubernetes/README.md
scripts/apollo-on-kubernetes/README.md
+156
-0
scripts/apollo-on-kubernetes/alpine-bash-3.8-image/Dockerfile
...pts/apollo-on-kubernetes/alpine-bash-3.8-image/Dockerfile
+14
-0
scripts/apollo-on-kubernetes/apollo-admin-server/.dockerignore
...ts/apollo-on-kubernetes/apollo-admin-server/.dockerignore
+1
-0
scripts/apollo-on-kubernetes/apollo-admin-server/Dockerfile
scripts/apollo-on-kubernetes/apollo-admin-server/Dockerfile
+29
-0
scripts/apollo-on-kubernetes/apollo-admin-server/apollo-adminservice.conf
...n-kubernetes/apollo-admin-server/apollo-adminservice.conf
+3
-0
scripts/apollo-on-kubernetes/apollo-admin-server/config/app.properties
...o-on-kubernetes/apollo-admin-server/config/app.properties
+2
-0
scripts/apollo-on-kubernetes/apollo-admin-server/config/application-github.properties
.../apollo-admin-server/config/application-github.properties
+4
-0
scripts/apollo-on-kubernetes/apollo-admin-server/entrypoint.sh
...ts/apollo-on-kubernetes/apollo-admin-server/entrypoint.sh
+16
-0
scripts/apollo-on-kubernetes/apollo-admin-server/scripts/startup-kubernetes.sh
...ernetes/apollo-admin-server/scripts/startup-kubernetes.sh
+35
-0
scripts/apollo-on-kubernetes/apollo-config-server/.dockerignore
...s/apollo-on-kubernetes/apollo-config-server/.dockerignore
+1
-0
scripts/apollo-on-kubernetes/apollo-config-server/Dockerfile
scripts/apollo-on-kubernetes/apollo-config-server/Dockerfile
+29
-0
scripts/apollo-on-kubernetes/apollo-config-server/apollo-configservice.conf
...kubernetes/apollo-config-server/apollo-configservice.conf
+3
-0
scripts/apollo-on-kubernetes/apollo-config-server/config/app.properties
...-on-kubernetes/apollo-config-server/config/app.properties
+2
-0
scripts/apollo-on-kubernetes/apollo-config-server/config/application-github.properties
...apollo-config-server/config/application-github.properties
+4
-0
scripts/apollo-on-kubernetes/apollo-config-server/entrypoint.sh
...s/apollo-on-kubernetes/apollo-config-server/entrypoint.sh
+16
-0
scripts/apollo-on-kubernetes/apollo-config-server/scripts/startup-kubernetes.sh
...rnetes/apollo-config-server/scripts/startup-kubernetes.sh
+34
-0
scripts/apollo-on-kubernetes/apollo-portal-server/.dockerignore
...s/apollo-on-kubernetes/apollo-portal-server/.dockerignore
+1
-0
scripts/apollo-on-kubernetes/apollo-portal-server/Dockerfile
scripts/apollo-on-kubernetes/apollo-portal-server/Dockerfile
+34
-0
scripts/apollo-on-kubernetes/apollo-portal-server/apollo-portal.conf
...llo-on-kubernetes/apollo-portal-server/apollo-portal.conf
+3
-0
scripts/apollo-on-kubernetes/apollo-portal-server/config/apollo-env.properties
...ernetes/apollo-portal-server/config/apollo-env.properties
+4
-0
scripts/apollo-on-kubernetes/apollo-portal-server/config/app.properties
...-on-kubernetes/apollo-portal-server/config/app.properties
+2
-0
scripts/apollo-on-kubernetes/apollo-portal-server/config/application-github.properties
...apollo-portal-server/config/application-github.properties
+4
-0
scripts/apollo-on-kubernetes/apollo-portal-server/entrypoint.sh
...s/apollo-on-kubernetes/apollo-portal-server/entrypoint.sh
+28
-0
scripts/apollo-on-kubernetes/apollo-portal-server/scripts/startup-kubernetes.sh
...rnetes/apollo-portal-server/scripts/startup-kubernetes.sh
+35
-0
scripts/apollo-on-kubernetes/db/config-db-dev/apolloconfigdb.sql
.../apollo-on-kubernetes/db/config-db-dev/apolloconfigdb.sql
+378
-0
scripts/apollo-on-kubernetes/db/config-db-prod/apolloconfigdb.sql
...apollo-on-kubernetes/db/config-db-prod/apolloconfigdb.sql
+378
-0
scripts/apollo-on-kubernetes/db/config-db-test-alpha/apolloconfigdb.sql
...-on-kubernetes/db/config-db-test-alpha/apolloconfigdb.sql
+378
-0
scripts/apollo-on-kubernetes/db/config-db-test-beta/apolloconfigdb.sql
...o-on-kubernetes/db/config-db-test-beta/apolloconfigdb.sql
+378
-0
scripts/apollo-on-kubernetes/db/portal-db/apolloportaldb.sql
scripts/apollo-on-kubernetes/db/portal-db/apolloportaldb.sql
+328
-0
scripts/apollo-on-kubernetes/kubernetes/apollo-env-dev/service-apollo-admin-server-dev.yaml
...netes/apollo-env-dev/service-apollo-admin-server-dev.yaml
+104
-0
scripts/apollo-on-kubernetes/kubernetes/apollo-env-dev/service-apollo-config-server-dev.yaml
...etes/apollo-env-dev/service-apollo-config-server-dev.yaml
+117
-0
scripts/apollo-on-kubernetes/kubernetes/apollo-env-dev/service-mysql-for-apollo-dev-env.yaml
...etes/apollo-env-dev/service-mysql-for-apollo-dev-env.yaml
+29
-0
scripts/apollo-on-kubernetes/kubernetes/apollo-env-prod/service-apollo-admin-server-prod.yaml
...tes/apollo-env-prod/service-apollo-admin-server-prod.yaml
+104
-0
scripts/apollo-on-kubernetes/kubernetes/apollo-env-prod/service-apollo-config-server-prod.yaml
...es/apollo-env-prod/service-apollo-config-server-prod.yaml
+116
-0
scripts/apollo-on-kubernetes/kubernetes/apollo-env-prod/service-mysql-for-apollo-prod-env.yaml
...es/apollo-env-prod/service-mysql-for-apollo-prod-env.yaml
+28
-0
scripts/apollo-on-kubernetes/kubernetes/apollo-env-test-alpha/service-apollo-admin-server-test-alpha.yaml
...nv-test-alpha/service-apollo-admin-server-test-alpha.yaml
+104
-0
scripts/apollo-on-kubernetes/kubernetes/apollo-env-test-alpha/service-apollo-config-server-test-alpha.yaml
...v-test-alpha/service-apollo-config-server-test-alpha.yaml
+116
-0
scripts/apollo-on-kubernetes/kubernetes/apollo-env-test-alpha/service-mysql-for-apollo-test-alpha-env.yaml
...v-test-alpha/service-mysql-for-apollo-test-alpha-env.yaml
+28
-0
scripts/apollo-on-kubernetes/kubernetes/apollo-env-test-beta/service-apollo-admin-server-test-beta.yaml
...-env-test-beta/service-apollo-admin-server-test-beta.yaml
+102
-0
scripts/apollo-on-kubernetes/kubernetes/apollo-env-test-beta/service-apollo-config-server-test-beta.yaml
...env-test-beta/service-apollo-config-server-test-beta.yaml
+116
-0
scripts/apollo-on-kubernetes/kubernetes/apollo-env-test-beta/service-mysql-for-apollo-test-beta-env.yaml
...env-test-beta/service-mysql-for-apollo-test-beta-env.yaml
+28
-0
scripts/apollo-on-kubernetes/kubernetes/kubectl-apply.sh
scripts/apollo-on-kubernetes/kubernetes/kubectl-apply.sh
+25
-0
scripts/apollo-on-kubernetes/kubernetes/service-apollo-portal-server.yaml
...n-kubernetes/kubernetes/service-apollo-portal-server.yaml
+173
-0
未找到文件。
apollo-portal/src/main/docker/Dockerfile
浏览文件 @
1e5a9190
...
...
@@ -25,6 +25,6 @@ RUN unzip /apollo-portal/apollo-portal-${VERSION}-github.zip -d /apollo-portal \
&&
sed
-i
'$d'
/apollo-portal/scripts/startup.sh
\
&&
echo
"tail -f /dev/null"
>>
/apollo-portal/scripts/startup.sh
EXPOSE
80
8
0
EXPOSE
80
7
0
CMD
["/apollo-portal/scripts/startup.sh"]
scripts/apollo-on-kubernetes/README.md
0 → 100644
浏览文件 @
1e5a9190
# 使用方法
## 一、构建镜像
### 1.1 获取 apollo 压缩包
从 https://github.com/ctripcorp/apollo/releases 下载预先打好的 java 包
<br/>
例如你下载的是:
<br/>
apollo-portal-1.0.0-github.zip
<br/>
apollo-adminservice-1.0.0-github.zip
<br/>
apollo-configservice-1.0.0-github.zip
<br/>
### 1.2 解压压缩包, 获取程序 jar 包
-
解压 apollo-portal-1.0.0-github.zip
<br/>
获取 apollo-portal-1.0.0.jar, 重命名为 apollo-portal.jar, 放到 scripts/apollo-on-kubernetes/apollo-portal-server
-
解压 apollo-adminservice-1.0.0-github.zip
<br/>
获取 apollo-adminservice-1.0.0.jar, 重命名为 apollo-adminservice.jar, 放到 scripts/apollo-on-kubernetes/apollo-admin-server
-
解压 apollo-configservice-1.0.0-github.zip
<br/>
获取 apollo-configservice-1.0.0.jar, 重命名为 apollo-configservice.jar, 放到 scripts/apollo-on-kubernetes/apollo-config-server
### 1.3 build image
以 build apollo-config-server image 为例, 其他类似
```
bash
scripts/apollo-on-kubernetes/apollo-config-server
$
tree
-L
2
.
├── apollo-configservice.conf
├── apollo-configservice.jar
├── config
│ ├── application-github.properties
│ └── app.properties
├── Dockerfile
├── entrypoint.sh
└── scripts
└── startup-kubernetes.sh
```
build image
```
bash
# 在 scripts/apollo-on-kubernetes/apollo-config-server 路径下
docker build
-t
apollo-config-server:v1.0.0 .
```
push image
<br/>
将 image push 到你的 docker registry, 例如 vmware harbor
## 二、Deploy apollo on kubernetes
### 2.1 部署 MySQL 服务
你可以选用 MySQL-Galera-WSrep 或 TiDB 来提高你的 MySQL 服务的可用性
<br/>
MySQL 部署步骤略
### 2.1 导入 MySQL DB 文件
由于上面部署了分布式的 MySQL, 所有 config-server、admin-server、portal-server 使用同一个 MySQL 服务的不同数据库
示例假设你的 apollo 开启了 4 个环境, 即 dev、test-alpha、test-beta、prod, 在你的 MySQL 中导入 scripts/apollo-on-kubernetes/db 下的文件即可
如果有需要, 你可以更改 eureka.service.url 的地址, 格式为 http://config-server-pod-name-index.meta-server-service-name:8080/eureka/ , 例如 http://statefulset-apollo-config-server-dev-0.service-apollo-meta-server-dev:8080/eureka/
### 2.2 Deploy apollo on kubernetes
示例假设你有 4 台 kubernetes node 来部署 apollo, apollo 开启了 4 个环境, 即 dev、test-alpha、test-beta、prod
按照 scripts/apollo-on-kubernetes/kubernetes/kubectl-apply.sh 文件的内容部署 apollo 即可
```
bash
scripts/apollo-on-kubernetes/kubernetes
$
cat
kubectl-apply.sh
# create namespace
kubectl create namespace sre
# dev-env
kubectl apply
-f
service-mysql-for-apollo-dev-env.yaml
--record
&&
\
kubectl apply
-f
service-apollo-config-server-dev.yaml
--record
&&
\
kubectl apply
-f
service-apollo-admin-server-dev.yaml
--record
# fat-env(test-alpha-env)
kubectl apply
-f
service-mysql-for-apollo-test-alpha-env.yaml
--record
&&
\
kubectl apply
-f
service-apollo-config-server-test-alpha.yaml
--record
&&
\
kubectl apply
-f
service-apollo-admin-server-test-alpha.yaml
--record
# uat-env(test-beta-env)
kubectl apply
-f
service-mysql-for-apollo-test-beta-env.yaml
--record
&&
\
kubectl apply
-f
service-apollo-config-server-test-beta.yaml
--record
&&
\
kubectl apply
-f
service-apollo-admin-server-test-beta.yaml
--record
# prod-env
kubectl apply
-f
service-mysql-for-apollo-prod-env.yaml
--record
&&
\
kubectl apply
-f
service-apollo-config-server-prod.yaml
--record
&&
\
kubectl apply
-f
service-apollo-admin-server-prod.yaml
--record
# portal
kubectl apply
-f
service-apollo-portal-server.yaml
--record
```
你需要注意的是, 应当尽量让同一个 server 的不同 pod 在不同 node 上, 这个通过 kubernetes nodeSelector 实现
### 2.3 验证所有 pod 处于 Running 并且 READY 状态
```
bash
kubectl get pod
-n
sre
-o
wide
# 示例结果
NAME READY STATUS RESTARTS AGE IP NODE
deployment-apollo-admin-server-dev-b7bbd657-4d5jx 1/1 Running 0 2d 10.247.4.79 k8s-apollo-node-2
deployment-apollo-admin-server-dev-b7bbd657-lwz5x 1/1 Running 0 2d 10.247.8.7 k8s-apollo-node-3
deployment-apollo-admin-server-dev-b7bbd657-xs4wt 1/1 Running 0 2d 10.247.1.23 k8s-apollo-node-1
deployment-apollo-admin-server-prod-699bbd894f-j977p 1/1 Running 0 2d 10.247.4.83 k8s-apollo-node-2
deployment-apollo-admin-server-prod-699bbd894f-n9m54 1/1 Running 0 2d 10.247.8.11 k8s-apollo-node-3
deployment-apollo-admin-server-prod-699bbd894f-vs56w 1/1 Running 0 2d 10.247.1.27 k8s-apollo-node-1
deployment-apollo-admin-server-test-beta-7c855cd4f5-9br65 1/1 Running 0 2d 10.247.1.25 k8s-apollo-node-1
deployment-apollo-admin-server-test-beta-7c855cd4f5-cck5g 1/1 Running 0 2d 10.247.8.9 k8s-apollo-node-3
deployment-apollo-admin-server-test-beta-7c855cd4f5-x6gt4 1/1 Running 0 2d 10.247.4.81 k8s-apollo-node-2
deployment-apollo-portal-server-6d4bbc879c-bv7cn 1/1 Running 0 2d 10.247.8.12 k8s-apollo-node-3
deployment-apollo-portal-server-6d4bbc879c-c4zrb 1/1 Running 0 2d 10.247.1.28 k8s-apollo-node-1
deployment-apollo-portal-server-6d4bbc879c-qm4mn 1/1 Running 0 2d 10.247.4.84 k8s-apollo-node-2
statefulset-apollo-config-server-dev-0 1/1 Running 0 2d 10.247.8.6 k8s-apollo-node-3
statefulset-apollo-config-server-dev-1 1/1 Running 0 2d 10.247.4.78 k8s-apollo-node-2
statefulset-apollo-config-server-dev-2 1/1 Running 0 2d 10.247.1.22 k8s-apollo-node-1
statefulset-apollo-config-server-prod-0 1/1 Running 0 2d 10.247.8.10 k8s-apollo-node-3
statefulset-apollo-config-server-prod-1 1/1 Running 0 2d 10.247.4.82 k8s-apollo-node-2
statefulset-apollo-config-server-prod-2 1/1 Running 0 2d 10.247.1.26 k8s-apollo-node-1
statefulset-apollo-config-server-test-beta-0 1/1 Running 0 2d 10.247.8.8 k8s-apollo-node-3
statefulset-apollo-config-server-test-beta-1 1/1 Running 0 2d 10.247.4.80 k8s-apollo-node-2
statefulset-apollo-config-server-test-beta-2 1/1 Running 0 2d 10.247.1.24 k8s-apollo-node-1
```
### 2.4 访问 apollo service
-
server 端(即 portal)
<br/>
kubernetes-master-ip:30001
-
client 端, 在 client 端无需再实现负载均衡
<br/>
Dev
<br/>
kubernetes-master-ip:30002
<br/>
Test-Alpha
<br/>
kubernetes-master-ip:30003
<br/>
Test-Beta
<br/>
kubernetes-master-ip:30004
<br/>
Prod
<br/>
kubernetes-master-ip:30005
<br/>
# FAQ
-
关于修改的 Dockerfile
<br/>
添加 ENV 和 entrypoint.sh, 启动 server 需要的配置, 在 kubernetes yaml 文件中可以通过 configmap 传入、也可以通过 ENV 传入
<br/>
关于 Dockerfile、entrypoint.sh 具体内容, 你可以查看文件里的内容
-
关于 kubernetes yaml 文件
<br/>
具体内容请查看 scripts/apollo-on-kubernetes/kubernetes/service-apollo-portal-server.yaml 注释
<br/>
其他类似
-
关于 eureka.service.url
<br/>
请在 ApolloConfigDB.ServerConfig 表中配置, 使用 meta-server(即 config-server) 的 pod name, config-server 务必使用 statefulset
<br/>
以 apollo-env-dev 为例:
<br/>
('eureka.service.url', 'default', 'http://statefulset-apollo-config-server-dev-0.service-apollo-meta-server-dev:8080/eureka/,http://statefulset-apollo-config-server-dev-1.service-apollo-meta-server-dev:8080/eureka/,http://statefulset-apollo-config-server-dev-2.service-apollo-meta-server-dev:8080/eureka/', 'Eureka服务Url,多个service以英文逗号分隔')
<br/>
你可以精简 config-server pod 的 name, 示例的长名字是为了更好的阅读与理解
\ No newline at end of file
scripts/apollo-on-kubernetes/alpine-bash-3.8-image/Dockerfile
0 → 100755
浏览文件 @
1e5a9190
# Build with:
# docker build -t alpine-bash:3.8 .
FROM
alpine:3.8
RUN
\
echo
"http://mirrors.aliyun.com/alpine/v3.8/main"
>
/etc/apk/repositories
&&
\
echo
"http://mirrors.aliyun.com/alpine/v3.8/community"
>>
/etc/apk/repositories
&&
\
apk update upgrade
&&
\
apk add
--no-cache
procps curl bash
&&
\
ln
-sf
/usr/share/zoneinfo/Asia/Shanghai /etc/localtime
&&
\
echo
"Asia/Shanghai"
>
/etc/timezone
CMD
["bash"]
scripts/apollo-on-kubernetes/apollo-admin-server/.dockerignore
0 → 100755
浏览文件 @
1e5a9190
./Dockerfile*
scripts/apollo-on-kubernetes/apollo-admin-server/Dockerfile
0 → 100755
浏览文件 @
1e5a9190
# Dockerfile for apollo-admin-server
# Build with:
# docker build -t apollo-admin-server:v1.0.0 .
FROM
openjdk:8-jre-alpine3.8
RUN
\
echo
"http://mirrors.aliyun.com/alpine/v3.8/main"
>
/etc/apk/repositories
&&
\
echo
"http://mirrors.aliyun.com/alpine/v3.8/community"
>>
/etc/apk/repositories
&&
\
apk update upgrade
&&
\
apk add
--no-cache
procps curl bash tzdata
&&
\
ln
-sf
/usr/share/zoneinfo/Asia/Shanghai /etc/localtime
&&
\
echo
"Asia/Shanghai"
>
/etc/timezone
&&
\
mkdir
-p
/apollo-admin-server
ADD
. /apollo-admin-server/
ENV
APOLLO_ADMIN_SERVICE_NAME="service-apollo-admin-server.sre"
ENV
DATASOURCES_URL="jdbc:mysql://service-mysql-for-apollo.sre:3306/ApolloConfigDB?characterEncoding=utf8"
ENV
DATASOURCES_USERNAME="FillInCorrectUser"
ENV
DATASOURCES_PASSWORD="FillInCorrectPassword"
EXPOSE
8090
ENTRYPOINT
["/apollo-admin-server/entrypoint.sh"]
CMD
["/apollo-admin-server/scripts/startup-kubernetes.sh"]
scripts/apollo-on-kubernetes/apollo-admin-server/apollo-adminservice.conf
0 → 100755
浏览文件 @
1e5a9190
MODE
=
service
PID_FOLDER
=.
LOG_FOLDER
=/
opt
/
logs
/
apollo
-
admin
-
server
scripts/apollo-on-kubernetes/apollo-admin-server/config/app.properties
0 → 100755
浏览文件 @
1e5a9190
appId
=
100003172
jdkVersion
=
1.8
scripts/apollo-on-kubernetes/apollo-admin-server/config/application-github.properties
0 → 100755
浏览文件 @
1e5a9190
# DataSource
spring.datasource.url
=
DATASOURCES_URL
spring.datasource.username
=
DATASOURCES_USERNAME
spring.datasource.password
=
DATASOURCES_PASSWORD
scripts/apollo-on-kubernetes/apollo-admin-server/entrypoint.sh
0 → 100755
浏览文件 @
1e5a9190
#!/bin/sh
set
-e
# admin-server config
admin_server_config
=
/apollo-admin-server/config/application-github.properties
cp
${
admin_server_config
}
${
admin_server_config
}
.cp
sed
-i
-E
"s#DATASOURCES_URL#
${
DATASOURCES_URL
}
#g"
${
admin_server_config
}
.cp
sed
-i
-E
"s#DATASOURCES_USERNAME#
${
DATASOURCES_USERNAME
}
#g"
${
admin_server_config
}
.cp
sed
-i
-E
"s#DATASOURCES_PASSWORD#
${
DATASOURCES_PASSWORD
}
#g"
${
admin_server_config
}
.cp
cat
${
admin_server_config
}
.cp
>
${
admin_server_config
}
rm
-rf
${
admin_server_config
}
.cp
exec
"
$@
"
scripts/apollo-on-kubernetes/apollo-admin-server/scripts/startup-kubernetes.sh
0 → 100755
浏览文件 @
1e5a9190
#!/bin/bash
SERVICE_NAME
=
apollo-adminservice
## Adjust log dir if necessary
LOG_DIR
=
/opt/logs/apollo-admin-server
## Adjust server port if necessary
SERVER_PORT
=
8090
# SERVER_URL="http://localhost:${SERVER_PORT}"
SERVER_URL
=
"http://
${
APOLLO_ADMIN_SERVICE_NAME
}
:
${
SERVER_PORT
}
"
## Adjust memory settings if necessary
#export JAVA_OPTS="-Xms2560m -Xmx2560m -Xss256k -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=384m -XX:NewSize=1536m -XX:MaxNewSize=1536m -XX:SurvivorRatio=8"
## Only uncomment the following when you are using server jvm
#export JAVA_OPTS="$JAVA_OPTS -server -XX:-ReduceInitialCardMarks"
########### The following is the same for configservice, adminservice, portal ###########
export
JAVA_OPTS
=
"
$JAVA_OPTS
-XX:+UseParNewGC -XX:ParallelGCThreads=4 -XX:MaxTenuringThreshold=9 -XX:+UseConcMarkSweepGC -XX:+DisableExplicitGC -XX:+UseCMSInitiatingOccupancyOnly -XX:+ScavengeBeforeFullGC -XX:+UseCMSCompactAtFullCollection -XX:+CMSParallelRemarkEnabled -XX:CMSFullGCsBeforeCompaction=9 -XX:CMSInitiatingOccupancyFraction=60 -XX:+CMSClassUnloadingEnabled -XX:SoftRefLRUPolicyMSPerMB=0 -XX:+CMSPermGenSweepingEnabled -XX:CMSInitiatingPermOccupancyFraction=70 -XX:+ExplicitGCInvokesConcurrent -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCApplicationConcurrentTime -XX:+PrintHeapAtGC -XX:+HeapDumpOnOutOfMemoryError -XX:-OmitStackTraceInFastThrow -Duser.timezone=Asia/Shanghai -Dclient.encoding.override=UTF-8 -Dfile.encoding=UTF-8 -Djava.security.egd=file:/dev/./urandom"
export
JAVA_OPTS
=
"
$JAVA_OPTS
-Dserver.port=
$SERVER_PORT
-Dlogging.file=
$LOG_DIR
/
$SERVICE_NAME
.log -Xloggc:
$LOG_DIR
/heap_trace.txt -XX:HeapDumpPath=
$LOG_DIR
/HeapDumpOnOutOfMemoryError/"
printf
"
$(
date
)
==== Starting ====
\n
"
cd
`
dirname
$0
`
/..
chmod
755
$SERVICE_NAME
".jar"
./
$SERVICE_NAME
".jar"
start
rc
=
$?
;
if
[[
$rc
!=
0
]]
;
then
echo
"
$(
date
)
Failed to start
$SERVICE_NAME
.jar, return code:
$rc
"
exit
$rc
;
fi
tail
-f
/dev/null
scripts/apollo-on-kubernetes/apollo-config-server/.dockerignore
0 → 100755
浏览文件 @
1e5a9190
./Dockerfile*
scripts/apollo-on-kubernetes/apollo-config-server/Dockerfile
0 → 100755
浏览文件 @
1e5a9190
# Dockerfile for apollo-config-server
# Build with:
# docker build -t apollo-config-server:v1.0.0 .
FROM
openjdk:8-jre-alpine3.8
RUN
\
echo
"http://mirrors.aliyun.com/alpine/v3.8/main"
>
/etc/apk/repositories
&&
\
echo
"http://mirrors.aliyun.com/alpine/v3.8/community"
>>
/etc/apk/repositories
&&
\
apk update upgrade
&&
\
apk add
--no-cache
procps curl bash tzdata
&&
\
ln
-sf
/usr/share/zoneinfo/Asia/Shanghai /etc/localtime
&&
\
echo
"Asia/Shanghai"
>
/etc/timezone
&&
\
mkdir
-p
/apollo-config-server
ADD
. /apollo-config-server/
ENV
APOLLO_CONFIG_SERVICE_NAME="service-apollo-config-server.sre"
ENV
DATASOURCES_URL="jdbc:mysql://service-mysql-for-apollo.sre:3306/ApolloConfigDB?characterEncoding=utf8"
ENV
DATASOURCES_USERNAME="FillInCorrectUser"
ENV
DATASOURCES_PASSWORD="FillInCorrectPassword"
EXPOSE
8080
ENTRYPOINT
["/apollo-config-server/entrypoint.sh"]
CMD
["/apollo-config-server/scripts/startup-kubernetes.sh"]
scripts/apollo-on-kubernetes/apollo-config-server/apollo-configservice.conf
0 → 100755
浏览文件 @
1e5a9190
MODE
=
service
PID_FOLDER
=.
LOG_FOLDER
=/
opt
/
logs
/
apollo
-
config
-
server
scripts/apollo-on-kubernetes/apollo-config-server/config/app.properties
0 → 100755
浏览文件 @
1e5a9190
appId
=
100003171
jdkVersion
=
1.8
scripts/apollo-on-kubernetes/apollo-config-server/config/application-github.properties
0 → 100755
浏览文件 @
1e5a9190
# DataSource
spring.datasource.url
=
DATASOURCES_URL
spring.datasource.username
=
DATASOURCES_USERNAME
spring.datasource.password
=
DATASOURCES_PASSWORD
scripts/apollo-on-kubernetes/apollo-config-server/entrypoint.sh
0 → 100755
浏览文件 @
1e5a9190
#!/bin/sh
set
-e
# config-server config
config_server_config
=
/apollo-config-server/config/application-github.properties
cp
${
config_server_config
}
${
config_server_config
}
.cp
sed
-i
-E
"s#DATASOURCES_URL#
${
DATASOURCES_URL
}
#g"
${
config_server_config
}
.cp
sed
-i
-E
"s#DATASOURCES_USERNAME#
${
DATASOURCES_USERNAME
}
#g"
${
config_server_config
}
.cp
sed
-i
-E
"s#DATASOURCES_PASSWORD#
${
DATASOURCES_PASSWORD
}
#g"
${
config_server_config
}
.cp
cat
${
config_server_config
}
.cp
>
${
config_server_config
}
rm
-rf
${
config_server_config
}
.cp
exec
"
$@
"
scripts/apollo-on-kubernetes/apollo-config-server/scripts/startup-kubernetes.sh
0 → 100755
浏览文件 @
1e5a9190
#!/bin/bash
SERVICE_NAME
=
apollo-configservice
## Adjust log dir if necessary
LOG_DIR
=
/opt/logs/apollo-config-server
## Adjust server port if necessary
SERVER_PORT
=
8080
SERVER_URL
=
"http://
${
APOLLO_CONFIG_SERVICE_NAME
}
:
${
SERVER_PORT
}
"
## Adjust memory settings if necessary
#export JAVA_OPTS="-Xms6144m -Xmx6144m -Xss256k -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=384m -XX:NewSize=4096m -XX:MaxNewSize=4096m -XX:SurvivorRatio=8"
## Only uncomment the following when you are using server jvm
#export JAVA_OPTS="$JAVA_OPTS -server -XX:-ReduceInitialCardMarks"
########### The following is the same for configservice, adminservice, portal ###########
export
JAVA_OPTS
=
"
$JAVA_OPTS
-XX:+UseParNewGC -XX:ParallelGCThreads=4 -XX:MaxTenuringThreshold=9 -XX:+UseConcMarkSweepGC -XX:+DisableExplicitGC -XX:+UseCMSInitiatingOccupancyOnly -XX:+ScavengeBeforeFullGC -XX:+UseCMSCompactAtFullCollection -XX:+CMSParallelRemarkEnabled -XX:CMSFullGCsBeforeCompaction=9 -XX:CMSInitiatingOccupancyFraction=60 -XX:+CMSClassUnloadingEnabled -XX:SoftRefLRUPolicyMSPerMB=0 -XX:+CMSPermGenSweepingEnabled -XX:CMSInitiatingPermOccupancyFraction=70 -XX:+ExplicitGCInvokesConcurrent -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCApplicationConcurrentTime -XX:+PrintHeapAtGC -XX:+HeapDumpOnOutOfMemoryError -XX:-OmitStackTraceInFastThrow -Duser.timezone=Asia/Shanghai -Dclient.encoding.override=UTF-8 -Dfile.encoding=UTF-8 -Djava.security.egd=file:/dev/./urandom"
export
JAVA_OPTS
=
"
$JAVA_OPTS
-Dserver.port=
$SERVER_PORT
-Dlogging.file=
$LOG_DIR
/
$SERVICE_NAME
.log -Xloggc:
$LOG_DIR
/heap_trace.txt -XX:HeapDumpPath=
$LOG_DIR
/HeapDumpOnOutOfMemoryError/"
printf
"
$(
date
)
==== Starting ====
\n
"
cd
`
dirname
$0
`
/..
chmod
755
$SERVICE_NAME
".jar"
./
$SERVICE_NAME
".jar"
start
rc
=
$?
;
if
[[
$rc
!=
0
]]
;
then
echo
"
$(
date
)
Failed to start
$SERVICE_NAME
.jar, return code:
$rc
"
exit
$rc
;
fi
tail
-f
/dev/null
scripts/apollo-on-kubernetes/apollo-portal-server/.dockerignore
0 → 100755
浏览文件 @
1e5a9190
./Dockerfile*
\ No newline at end of file
scripts/apollo-on-kubernetes/apollo-portal-server/Dockerfile
0 → 100755
浏览文件 @
1e5a9190
# Dockerfile for apollo-portal-server
# Build with:
# docker build -t apollo-portal-server:v1.0.0 .
FROM
openjdk:8-jre-alpine3.8
RUN
\
echo
"http://mirrors.aliyun.com/alpine/v3.8/main"
>
/etc/apk/repositories
&&
\
echo
"http://mirrors.aliyun.com/alpine/v3.8/community"
>>
/etc/apk/repositories
&&
\
apk update upgrade
&&
\
apk add
--no-cache
procps curl bash tzdata
&&
\
ln
-sf
/usr/share/zoneinfo/Asia/Shanghai /etc/localtime
&&
\
echo
"Asia/Shanghai"
>
/etc/timezone
&&
\
mkdir
-p
/apollo-portal-server
ADD
. /apollo-portal-server/
ENV
APOLLO_PORTAL_SERVICE_NAME="service-apollo-portal-server.sre"
ENV
DATASOURCES_URL="jdbc:mysql://service-mysql-for-apollo.sre:3306/ApolloPortalDB?characterEncoding=utf8"
ENV
DATASOURCES_USERNAME="FillInCorrectUser"
ENV
DATASOURCES_PASSWORD="FillInCorrectPassword"
ENV
DEV_META_SERVICE_NAME="service-apollo-config-server-dev.sre"
ENV
TEST_ALPHA_META_SERVICE_NAME="service-apollo-config-server-test-alpha.sre"
ENV
TEST_BETA_META_SERVICE_NAME="service-apollo-config-server-test-beta.sre"
ENV
PROD_META_SERVICE_NAME="service-apollo-config-server-prod.sre"
EXPOSE
8070
ENTRYPOINT
["/apollo-portal-server/entrypoint.sh"]
CMD
["/apollo-portal-server/scripts/startup-kubernetes.sh"]
scripts/apollo-on-kubernetes/apollo-portal-server/apollo-portal.conf
0 → 100755
浏览文件 @
1e5a9190
MODE
=
service
PID_FOLDER
=.
LOG_FOLDER
=/
opt
/
logs
/
apollo
-
portal
-
server
scripts/apollo-on-kubernetes/apollo-portal-server/config/apollo-env.properties
0 → 100755
浏览文件 @
1e5a9190
dev.meta
=
http://DEV_META_SERVICE_NAME:8080
fat.meta
=
http://TEST_ALPHA_META_SERVICE_NAME:8080
uat.meta
=
http://TEST_BETA_META_SERVICE_NAME:8080
pro.meta
=
http://PROD_META_SERVICE_NAME:8080
scripts/apollo-on-kubernetes/apollo-portal-server/config/app.properties
0 → 100755
浏览文件 @
1e5a9190
appId
=
100003173
jdkVersion
=
1.8
scripts/apollo-on-kubernetes/apollo-portal-server/config/application-github.properties
0 → 100755
浏览文件 @
1e5a9190
# DataSource
spring.datasource.url
=
DATASOURCES_URL
spring.datasource.username
=
DATASOURCES_USERNAME
spring.datasource.password
=
DATASOURCES_PASSWORD
scripts/apollo-on-kubernetes/apollo-portal-server/entrypoint.sh
0 → 100755
浏览文件 @
1e5a9190
#!/bin/sh
set
-e
# portal-server config
portal_server_config
=
/apollo-portal-server/config/application-github.properties
cp
${
portal_server_config
}
${
portal_server_config
}
.cp
sed
-i
-E
"s#DATASOURCES_URL#
${
DATASOURCES_URL
}
#g"
${
portal_server_config
}
.cp
sed
-i
-E
"s#DATASOURCES_USERNAME#
${
DATASOURCES_USERNAME
}
#g"
${
portal_server_config
}
.cp
sed
-i
-E
"s#DATASOURCES_PASSWORD#
${
DATASOURCES_PASSWORD
}
#g"
${
portal_server_config
}
.cp
cat
${
portal_server_config
}
.cp
>
${
portal_server_config
}
rm
-rf
${
portal_server_config
}
.cp
# meta-server config
meta_server_config
=
/apollo-portal-server/config/apollo-env.properties
cp
${
meta_server_config
}
${
meta_server_config
}
.cp
sed
-i
-E
"s#DEV_META_SERVICE_NAME#
${
DEV_META_SERVICE_NAME
}
#g"
${
meta_server_config
}
.cp
sed
-i
-E
"s#TEST_ALPHA_META_SERVICE_NAME#
${
TEST_ALPHA_META_SERVICE_NAME
}
#g"
${
meta_server_config
}
.cp
sed
-i
-E
"s#TEST_BETA_META_SERVICE_NAME#
${
TEST_BETA_META_SERVICE_NAME
}
#g"
${
meta_server_config
}
.cp
sed
-i
-E
"s#PROD_META_SERVICE_NAME#
${
PROD_META_SERVICE_NAME
}
#g"
${
meta_server_config
}
.cp
cat
${
meta_server_config
}
.cp
>
${
meta_server_config
}
rm
-rf
${
meta_server_config
}
.cp
exec
"
$@
"
scripts/apollo-on-kubernetes/apollo-portal-server/scripts/startup-kubernetes.sh
0 → 100755
浏览文件 @
1e5a9190
#!/bin/bash
SERVICE_NAME
=
apollo-portal
## Adjust log dir if necessary
LOG_DIR
=
/opt/logs/apollo-portal-server
## Adjust server port if necessary
SERVER_PORT
=
8070
# SERVER_URL="http://localhost:$SERVER_PORT"
SERVER_URL
=
"http://
${
APOLLO_PORTAL_SERVICE_NAME
}
:
${
SERVER_PORT
}
"
## Adjust memory settings if necessary
#export JAVA_OPTS="-Xms2560m -Xmx2560m -Xss256k -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=384m -XX:NewSize=1536m -XX:MaxNewSize=1536m -XX:SurvivorRatio=8"
## Only uncomment the following when you are using server jvm
#export JAVA_OPTS="$JAVA_OPTS -server -XX:-ReduceInitialCardMarks"
########### The following is the same for configservice, adminservice, portal ###########
export
JAVA_OPTS
=
"
$JAVA_OPTS
-XX:+UseParNewGC -XX:ParallelGCThreads=4 -XX:MaxTenuringThreshold=9 -XX:+UseConcMarkSweepGC -XX:+DisableExplicitGC -XX:+UseCMSInitiatingOccupancyOnly -XX:+ScavengeBeforeFullGC -XX:+UseCMSCompactAtFullCollection -XX:+CMSParallelRemarkEnabled -XX:CMSFullGCsBeforeCompaction=9 -XX:CMSInitiatingOccupancyFraction=60 -XX:+CMSClassUnloadingEnabled -XX:SoftRefLRUPolicyMSPerMB=0 -XX:+CMSPermGenSweepingEnabled -XX:CMSInitiatingPermOccupancyFraction=70 -XX:+ExplicitGCInvokesConcurrent -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCApplicationConcurrentTime -XX:+PrintHeapAtGC -XX:+HeapDumpOnOutOfMemoryError -XX:-OmitStackTraceInFastThrow -Duser.timezone=Asia/Shanghai -Dclient.encoding.override=UTF-8 -Dfile.encoding=UTF-8 -Djava.security.egd=file:/dev/./urandom"
export
JAVA_OPTS
=
"
$JAVA_OPTS
-Dserver.port=
$SERVER_PORT
-Dlogging.file=
$LOG_DIR
/
$SERVICE_NAME
.log -Xloggc:
$LOG_DIR
/heap_trace.txt -XX:HeapDumpPath=
$LOG_DIR
/HeapDumpOnOutOfMemoryError/"
printf
"
$(
date
)
==== Starting ====
\n
"
cd
`
dirname
$0
`
/..
chmod
755
$SERVICE_NAME
".jar"
./
$SERVICE_NAME
".jar"
start
rc
=
$?
;
if
[[
$rc
!=
0
]]
;
then
echo
"
$(
date
)
Failed to start
$SERVICE_NAME
.jar, return code:
$rc
"
exit
$rc
;
fi
tail
-f
/dev/null
scripts/apollo-on-kubernetes/db/config-db-dev/apolloconfigdb.sql
0 → 100755
浏览文件 @
1e5a9190
此差异已折叠。
点击以展开。
scripts/apollo-on-kubernetes/db/config-db-prod/apolloconfigdb.sql
0 → 100755
浏览文件 @
1e5a9190
此差异已折叠。
点击以展开。
scripts/apollo-on-kubernetes/db/config-db-test-alpha/apolloconfigdb.sql
0 → 100755
浏览文件 @
1e5a9190
此差异已折叠。
点击以展开。
scripts/apollo-on-kubernetes/db/config-db-test-beta/apolloconfigdb.sql
0 → 100755
浏览文件 @
1e5a9190
此差异已折叠。
点击以展开。
scripts/apollo-on-kubernetes/db/portal-db/apolloportaldb.sql
0 → 100755
浏览文件 @
1e5a9190
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */
;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */
;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */
;
/*!40101 SET NAMES utf8 */
;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */
;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */
;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */
;
#
Create
Database
#
------------------------------------------------------------
CREATE
DATABASE
IF
NOT
EXISTS
ApolloPortalDB
DEFAULT
CHARACTER
SET
=
utf8mb4
;
Use
ApolloPortalDB
;
#
Dump
of
table
app
#
------------------------------------------------------------
DROP
TABLE
IF
EXISTS
`App`
;
CREATE
TABLE
`App`
(
`Id`
int
(
10
)
unsigned
NOT
NULL
AUTO_INCREMENT
COMMENT
'主键'
,
`AppId`
varchar
(
500
)
NOT
NULL
DEFAULT
'default'
COMMENT
'AppID'
,
`Name`
varchar
(
500
)
NOT
NULL
DEFAULT
'default'
COMMENT
'应用名'
,
`OrgId`
varchar
(
32
)
NOT
NULL
DEFAULT
'default'
COMMENT
'部门Id'
,
`OrgName`
varchar
(
64
)
NOT
NULL
DEFAULT
'default'
COMMENT
'部门名字'
,
`OwnerName`
varchar
(
500
)
NOT
NULL
DEFAULT
'default'
COMMENT
'ownerName'
,
`OwnerEmail`
varchar
(
500
)
NOT
NULL
DEFAULT
'default'
COMMENT
'ownerEmail'
,
`IsDeleted`
bit
(
1
)
NOT
NULL
DEFAULT
b
'0'
COMMENT
'1: deleted, 0: normal'
,
`DataChange_CreatedBy`
varchar
(
32
)
NOT
NULL
DEFAULT
'default'
COMMENT
'创建人邮箱前缀'
,
`DataChange_CreatedTime`
timestamp
NOT
NULL
DEFAULT
CURRENT_TIMESTAMP
COMMENT
'创建时间'
,
`DataChange_LastModifiedBy`
varchar
(
32
)
DEFAULT
''
COMMENT
'最后修改人邮箱前缀'
,
`DataChange_LastTime`
timestamp
NULL
DEFAULT
CURRENT_TIMESTAMP
ON
UPDATE
CURRENT_TIMESTAMP
COMMENT
'最后修改时间'
,
PRIMARY
KEY
(
`Id`
),
KEY
`AppId`
(
`AppId`
(
191
)),
KEY
`DataChange_LastTime`
(
`DataChange_LastTime`
),
KEY
`IX_Name`
(
`Name`
(
191
))
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8mb4
COMMENT
=
'应用表'
;
#
Dump
of
table
appnamespace
#
------------------------------------------------------------
DROP
TABLE
IF
EXISTS
`AppNamespace`
;
CREATE
TABLE
`AppNamespace`
(
`Id`
int
(
10
)
unsigned
NOT
NULL
AUTO_INCREMENT
COMMENT
'自增主键'
,
`Name`
varchar
(
32
)
NOT
NULL
DEFAULT
''
COMMENT
'namespace名字,注意,需要全局唯一'
,
`AppId`
varchar
(
32
)
NOT
NULL
DEFAULT
''
COMMENT
'app id'
,
`Format`
varchar
(
32
)
NOT
NULL
DEFAULT
'properties'
COMMENT
'namespace的format类型'
,
`IsPublic`
bit
(
1
)
NOT
NULL
DEFAULT
b
'0'
COMMENT
'namespace是否为公共'
,
`Comment`
varchar
(
64
)
NOT
NULL
DEFAULT
''
COMMENT
'注释'
,
`IsDeleted`
bit
(
1
)
NOT
NULL
DEFAULT
b
'0'
COMMENT
'1: deleted, 0: normal'
,
`DataChange_CreatedBy`
varchar
(
32
)
NOT
NULL
DEFAULT
''
COMMENT
'创建人邮箱前缀'
,
`DataChange_CreatedTime`
timestamp
NOT
NULL
DEFAULT
CURRENT_TIMESTAMP
COMMENT
'创建时间'
,
`DataChange_LastModifiedBy`
varchar
(
32
)
DEFAULT
''
COMMENT
'最后修改人邮箱前缀'
,
`DataChange_LastTime`
timestamp
NULL
DEFAULT
CURRENT_TIMESTAMP
ON
UPDATE
CURRENT_TIMESTAMP
COMMENT
'最后修改时间'
,
PRIMARY
KEY
(
`Id`
),
KEY
`IX_AppId`
(
`AppId`
),
KEY
`Name_AppId`
(
`Name`
,
`AppId`
),
KEY
`DataChange_LastTime`
(
`DataChange_LastTime`
)
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8mb4
COMMENT
=
'应用namespace定义'
;
#
Dump
of
table
consumer
#
------------------------------------------------------------
DROP
TABLE
IF
EXISTS
`Consumer`
;
CREATE
TABLE
`Consumer`
(
`Id`
int
(
11
)
unsigned
NOT
NULL
AUTO_INCREMENT
COMMENT
'自增Id'
,
`AppId`
varchar
(
500
)
NOT
NULL
DEFAULT
'default'
COMMENT
'AppID'
,
`Name`
varchar
(
500
)
NOT
NULL
DEFAULT
'default'
COMMENT
'应用名'
,
`OrgId`
varchar
(
32
)
NOT
NULL
DEFAULT
'default'
COMMENT
'部门Id'
,
`OrgName`
varchar
(
64
)
NOT
NULL
DEFAULT
'default'
COMMENT
'部门名字'
,
`OwnerName`
varchar
(
500
)
NOT
NULL
DEFAULT
'default'
COMMENT
'ownerName'
,
`OwnerEmail`
varchar
(
500
)
NOT
NULL
DEFAULT
'default'
COMMENT
'ownerEmail'
,
`IsDeleted`
bit
(
1
)
NOT
NULL
DEFAULT
b
'0'
COMMENT
'1: deleted, 0: normal'
,
`DataChange_CreatedBy`
varchar
(
32
)
NOT
NULL
DEFAULT
'default'
COMMENT
'创建人邮箱前缀'
,
`DataChange_CreatedTime`
timestamp
NOT
NULL
DEFAULT
CURRENT_TIMESTAMP
COMMENT
'创建时间'
,
`DataChange_LastModifiedBy`
varchar
(
32
)
DEFAULT
''
COMMENT
'最后修改人邮箱前缀'
,
`DataChange_LastTime`
timestamp
NULL
DEFAULT
CURRENT_TIMESTAMP
ON
UPDATE
CURRENT_TIMESTAMP
COMMENT
'最后修改时间'
,
PRIMARY
KEY
(
`Id`
),
KEY
`AppId`
(
`AppId`
(
191
)),
KEY
`DataChange_LastTime`
(
`DataChange_LastTime`
)
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8mb4
COMMENT
=
'开放API消费者'
;
#
Dump
of
table
consumeraudit
#
------------------------------------------------------------
DROP
TABLE
IF
EXISTS
`ConsumerAudit`
;
CREATE
TABLE
`ConsumerAudit`
(
`Id`
int
(
11
)
unsigned
NOT
NULL
AUTO_INCREMENT
COMMENT
'自增Id'
,
`ConsumerId`
int
(
11
)
unsigned
DEFAULT
NULL
COMMENT
'Consumer Id'
,
`Uri`
varchar
(
1024
)
NOT
NULL
DEFAULT
''
COMMENT
'访问的Uri'
,
`Method`
varchar
(
16
)
NOT
NULL
DEFAULT
''
COMMENT
'访问的Method'
,
`DataChange_CreatedTime`
timestamp
NOT
NULL
DEFAULT
CURRENT_TIMESTAMP
COMMENT
'创建时间'
,
`DataChange_LastTime`
timestamp
NULL
DEFAULT
CURRENT_TIMESTAMP
ON
UPDATE
CURRENT_TIMESTAMP
COMMENT
'最后修改时间'
,
PRIMARY
KEY
(
`Id`
),
KEY
`IX_DataChange_LastTime`
(
`DataChange_LastTime`
),
KEY
`IX_ConsumerId`
(
`ConsumerId`
)
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8mb4
COMMENT
=
'consumer审计表'
;
#
Dump
of
table
consumerrole
#
------------------------------------------------------------
DROP
TABLE
IF
EXISTS
`ConsumerRole`
;
CREATE
TABLE
`ConsumerRole`
(
`Id`
int
(
11
)
unsigned
NOT
NULL
AUTO_INCREMENT
COMMENT
'自增Id'
,
`ConsumerId`
int
(
11
)
unsigned
DEFAULT
NULL
COMMENT
'Consumer Id'
,
`RoleId`
int
(
10
)
unsigned
DEFAULT
NULL
COMMENT
'Role Id'
,
`IsDeleted`
bit
(
1
)
NOT
NULL
DEFAULT
b
'0'
COMMENT
'1: deleted, 0: normal'
,
`DataChange_CreatedBy`
varchar
(
32
)
DEFAULT
''
COMMENT
'创建人邮箱前缀'
,
`DataChange_CreatedTime`
timestamp
NOT
NULL
DEFAULT
CURRENT_TIMESTAMP
COMMENT
'创建时间'
,
`DataChange_LastModifiedBy`
varchar
(
32
)
DEFAULT
''
COMMENT
'最后修改人邮箱前缀'
,
`DataChange_LastTime`
timestamp
NULL
DEFAULT
CURRENT_TIMESTAMP
ON
UPDATE
CURRENT_TIMESTAMP
COMMENT
'最后修改时间'
,
PRIMARY
KEY
(
`Id`
),
KEY
`IX_DataChange_LastTime`
(
`DataChange_LastTime`
),
KEY
`IX_RoleId`
(
`RoleId`
),
KEY
`IX_ConsumerId_RoleId`
(
`ConsumerId`
,
`RoleId`
)
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8mb4
COMMENT
=
'consumer和role的绑定表'
;
#
Dump
of
table
consumertoken
#
------------------------------------------------------------
DROP
TABLE
IF
EXISTS
`ConsumerToken`
;
CREATE
TABLE
`ConsumerToken`
(
`Id`
int
(
11
)
unsigned
NOT
NULL
AUTO_INCREMENT
COMMENT
'自增Id'
,
`ConsumerId`
int
(
11
)
unsigned
DEFAULT
NULL
COMMENT
'ConsumerId'
,
`Token`
varchar
(
128
)
NOT
NULL
DEFAULT
''
COMMENT
'token'
,
`Expires`
datetime
NOT
NULL
DEFAULT
'2099-01-01 00:00:00'
COMMENT
'token失效时间'
,
`IsDeleted`
bit
(
1
)
NOT
NULL
DEFAULT
b
'0'
COMMENT
'1: deleted, 0: normal'
,
`DataChange_CreatedBy`
varchar
(
32
)
NOT
NULL
DEFAULT
'default'
COMMENT
'创建人邮箱前缀'
,
`DataChange_CreatedTime`
timestamp
NOT
NULL
DEFAULT
CURRENT_TIMESTAMP
COMMENT
'创建时间'
,
`DataChange_LastModifiedBy`
varchar
(
32
)
DEFAULT
''
COMMENT
'最后修改人邮箱前缀'
,
`DataChange_LastTime`
timestamp
NULL
DEFAULT
CURRENT_TIMESTAMP
ON
UPDATE
CURRENT_TIMESTAMP
COMMENT
'最后修改时间'
,
PRIMARY
KEY
(
`Id`
),
UNIQUE
KEY
`IX_Token`
(
`Token`
),
KEY
`DataChange_LastTime`
(
`DataChange_LastTime`
)
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8mb4
COMMENT
=
'consumer token表'
;
#
Dump
of
table
favorite
#
------------------------------------------------------------
DROP
TABLE
IF
EXISTS
`Favorite`
;
CREATE
TABLE
`Favorite`
(
`Id`
int
(
10
)
unsigned
NOT
NULL
AUTO_INCREMENT
COMMENT
'主键'
,
`UserId`
varchar
(
32
)
NOT
NULL
DEFAULT
'default'
COMMENT
'收藏的用户'
,
`AppId`
varchar
(
500
)
NOT
NULL
DEFAULT
'default'
COMMENT
'AppID'
,
`Position`
int
(
32
)
NOT
NULL
DEFAULT
'10000'
COMMENT
'收藏顺序'
,
`IsDeleted`
bit
(
1
)
NOT
NULL
DEFAULT
b
'0'
COMMENT
'1: deleted, 0: normal'
,
`DataChange_CreatedBy`
varchar
(
32
)
NOT
NULL
DEFAULT
'default'
COMMENT
'创建人邮箱前缀'
,
`DataChange_CreatedTime`
timestamp
NOT
NULL
DEFAULT
CURRENT_TIMESTAMP
COMMENT
'创建时间'
,
`DataChange_LastModifiedBy`
varchar
(
32
)
DEFAULT
''
COMMENT
'最后修改人邮箱前缀'
,
`DataChange_LastTime`
timestamp
NULL
DEFAULT
CURRENT_TIMESTAMP
ON
UPDATE
CURRENT_TIMESTAMP
COMMENT
'最后修改时间'
,
PRIMARY
KEY
(
`Id`
),
KEY
`AppId`
(
`AppId`
(
191
)),
KEY
`IX_UserId`
(
`UserId`
),
KEY
`DataChange_LastTime`
(
`DataChange_LastTime`
)
)
ENGINE
=
InnoDB
AUTO_INCREMENT
=
23
DEFAULT
CHARSET
=
utf8mb4
COMMENT
=
'应用收藏表'
;
#
Dump
of
table
permission
#
------------------------------------------------------------
DROP
TABLE
IF
EXISTS
`Permission`
;
CREATE
TABLE
`Permission`
(
`Id`
int
(
11
)
unsigned
NOT
NULL
AUTO_INCREMENT
COMMENT
'自增Id'
,
`PermissionType`
varchar
(
32
)
NOT
NULL
DEFAULT
''
COMMENT
'权限类型'
,
`TargetId`
varchar
(
256
)
NOT
NULL
DEFAULT
''
COMMENT
'权限对象类型'
,
`IsDeleted`
bit
(
1
)
NOT
NULL
DEFAULT
b
'0'
COMMENT
'1: deleted, 0: normal'
,
`DataChange_CreatedBy`
varchar
(
32
)
NOT
NULL
DEFAULT
''
COMMENT
'创建人邮箱前缀'
,
`DataChange_CreatedTime`
timestamp
NOT
NULL
DEFAULT
CURRENT_TIMESTAMP
COMMENT
'创建时间'
,
`DataChange_LastModifiedBy`
varchar
(
32
)
DEFAULT
''
COMMENT
'最后修改人邮箱前缀'
,
`DataChange_LastTime`
timestamp
NULL
DEFAULT
CURRENT_TIMESTAMP
ON
UPDATE
CURRENT_TIMESTAMP
COMMENT
'最后修改时间'
,
PRIMARY
KEY
(
`Id`
),
KEY
`IX_TargetId_PermissionType`
(
`TargetId`
(
191
),
`PermissionType`
),
KEY
`IX_DataChange_LastTime`
(
`DataChange_LastTime`
)
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8mb4
COMMENT
=
'permission表'
;
#
Dump
of
table
role
#
------------------------------------------------------------
DROP
TABLE
IF
EXISTS
`Role`
;
CREATE
TABLE
`Role`
(
`Id`
int
(
11
)
unsigned
NOT
NULL
AUTO_INCREMENT
COMMENT
'自增Id'
,
`RoleName`
varchar
(
256
)
NOT
NULL
DEFAULT
''
COMMENT
'Role name'
,
`IsDeleted`
bit
(
1
)
NOT
NULL
DEFAULT
b
'0'
COMMENT
'1: deleted, 0: normal'
,
`DataChange_CreatedBy`
varchar
(
32
)
NOT
NULL
DEFAULT
'default'
COMMENT
'创建人邮箱前缀'
,
`DataChange_CreatedTime`
timestamp
NOT
NULL
DEFAULT
CURRENT_TIMESTAMP
COMMENT
'创建时间'
,
`DataChange_LastModifiedBy`
varchar
(
32
)
DEFAULT
''
COMMENT
'最后修改人邮箱前缀'
,
`DataChange_LastTime`
timestamp
NULL
DEFAULT
CURRENT_TIMESTAMP
ON
UPDATE
CURRENT_TIMESTAMP
COMMENT
'最后修改时间'
,
PRIMARY
KEY
(
`Id`
),
KEY
`IX_RoleName`
(
`RoleName`
(
191
)),
KEY
`IX_DataChange_LastTime`
(
`DataChange_LastTime`
)
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8mb4
COMMENT
=
'角色表'
;
#
Dump
of
table
rolepermission
#
------------------------------------------------------------
DROP
TABLE
IF
EXISTS
`RolePermission`
;
CREATE
TABLE
`RolePermission`
(
`Id`
int
(
11
)
unsigned
NOT
NULL
AUTO_INCREMENT
COMMENT
'自增Id'
,
`RoleId`
int
(
10
)
unsigned
DEFAULT
NULL
COMMENT
'Role Id'
,
`PermissionId`
int
(
10
)
unsigned
DEFAULT
NULL
COMMENT
'Permission Id'
,
`IsDeleted`
bit
(
1
)
NOT
NULL
DEFAULT
b
'0'
COMMENT
'1: deleted, 0: normal'
,
`DataChange_CreatedBy`
varchar
(
32
)
DEFAULT
''
COMMENT
'创建人邮箱前缀'
,
`DataChange_CreatedTime`
timestamp
NOT
NULL
DEFAULT
CURRENT_TIMESTAMP
COMMENT
'创建时间'
,
`DataChange_LastModifiedBy`
varchar
(
32
)
DEFAULT
''
COMMENT
'最后修改人邮箱前缀'
,
`DataChange_LastTime`
timestamp
NULL
DEFAULT
CURRENT_TIMESTAMP
ON
UPDATE
CURRENT_TIMESTAMP
COMMENT
'最后修改时间'
,
PRIMARY
KEY
(
`Id`
),
KEY
`IX_DataChange_LastTime`
(
`DataChange_LastTime`
),
KEY
`IX_RoleId`
(
`RoleId`
),
KEY
`IX_PermissionId`
(
`PermissionId`
)
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8mb4
COMMENT
=
'角色和权限的绑定表'
;
#
Dump
of
table
serverconfig
#
------------------------------------------------------------
DROP
TABLE
IF
EXISTS
`ServerConfig`
;
CREATE
TABLE
`ServerConfig`
(
`Id`
int
(
10
)
unsigned
NOT
NULL
AUTO_INCREMENT
COMMENT
'自增Id'
,
`Key`
varchar
(
64
)
NOT
NULL
DEFAULT
'default'
COMMENT
'配置项Key'
,
`Value`
varchar
(
2048
)
NOT
NULL
DEFAULT
'default'
COMMENT
'配置项值'
,
`Comment`
varchar
(
1024
)
DEFAULT
''
COMMENT
'注释'
,
`IsDeleted`
bit
(
1
)
NOT
NULL
DEFAULT
b
'0'
COMMENT
'1: deleted, 0: normal'
,
`DataChange_CreatedBy`
varchar
(
32
)
NOT
NULL
DEFAULT
'default'
COMMENT
'创建人邮箱前缀'
,
`DataChange_CreatedTime`
timestamp
NOT
NULL
DEFAULT
CURRENT_TIMESTAMP
COMMENT
'创建时间'
,
`DataChange_LastModifiedBy`
varchar
(
32
)
DEFAULT
''
COMMENT
'最后修改人邮箱前缀'
,
`DataChange_LastTime`
timestamp
NULL
DEFAULT
CURRENT_TIMESTAMP
ON
UPDATE
CURRENT_TIMESTAMP
COMMENT
'最后修改时间'
,
PRIMARY
KEY
(
`Id`
),
KEY
`IX_Key`
(
`Key`
),
KEY
`DataChange_LastTime`
(
`DataChange_LastTime`
)
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8mb4
COMMENT
=
'配置服务自身配置'
;
#
Dump
of
table
userrole
#
------------------------------------------------------------
DROP
TABLE
IF
EXISTS
`UserRole`
;
CREATE
TABLE
`UserRole`
(
`Id`
int
(
11
)
unsigned
NOT
NULL
AUTO_INCREMENT
COMMENT
'自增Id'
,
`UserId`
varchar
(
128
)
DEFAULT
''
COMMENT
'用户身份标识'
,
`RoleId`
int
(
10
)
unsigned
DEFAULT
NULL
COMMENT
'Role Id'
,
`IsDeleted`
bit
(
1
)
NOT
NULL
DEFAULT
b
'0'
COMMENT
'1: deleted, 0: normal'
,
`DataChange_CreatedBy`
varchar
(
32
)
DEFAULT
''
COMMENT
'创建人邮箱前缀'
,
`DataChange_CreatedTime`
timestamp
NOT
NULL
DEFAULT
CURRENT_TIMESTAMP
COMMENT
'创建时间'
,
`DataChange_LastModifiedBy`
varchar
(
32
)
DEFAULT
''
COMMENT
'最后修改人邮箱前缀'
,
`DataChange_LastTime`
timestamp
NULL
DEFAULT
CURRENT_TIMESTAMP
ON
UPDATE
CURRENT_TIMESTAMP
COMMENT
'最后修改时间'
,
PRIMARY
KEY
(
`Id`
),
KEY
`IX_DataChange_LastTime`
(
`DataChange_LastTime`
),
KEY
`IX_RoleId`
(
`RoleId`
),
KEY
`IX_UserId_RoleId`
(
`UserId`
,
`RoleId`
)
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8mb4
COMMENT
=
'用户和role的绑定表'
;
#
Dump
of
table
Users
#
------------------------------------------------------------
DROP
TABLE
IF
EXISTS
`Users`
;
CREATE
TABLE
`Users`
(
`Id`
int
(
10
)
unsigned
NOT
NULL
AUTO_INCREMENT
COMMENT
'自增Id'
,
`Username`
varchar
(
64
)
NOT
NULL
DEFAULT
'default'
COMMENT
'用户名'
,
`Password`
varchar
(
64
)
NOT
NULL
DEFAULT
'default'
COMMENT
'密码'
,
`Email`
varchar
(
64
)
NOT
NULL
DEFAULT
'default'
COMMENT
'邮箱地址'
,
`Enabled`
tinyint
(
4
)
DEFAULT
NULL
COMMENT
'是否有效'
,
PRIMARY
KEY
(
`Id`
)
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8mb4
COMMENT
=
'用户表'
;
#
Dump
of
table
Authorities
#
------------------------------------------------------------
DROP
TABLE
IF
EXISTS
`Authorities`
;
CREATE
TABLE
`Authorities`
(
`Id`
int
(
11
)
unsigned
NOT
NULL
AUTO_INCREMENT
COMMENT
'自增Id'
,
`Username`
varchar
(
50
)
NOT
NULL
,
`Authority`
varchar
(
50
)
NOT
NULL
,
PRIMARY
KEY
(
`Id`
)
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8mb4
;
#
Config
#
------------------------------------------------------------
INSERT
INTO
`ServerConfig`
(
`Key`
,
`Value`
,
`Comment`
)
VALUES
(
'apollo.portal.envs'
,
'dev, fat, uat, pro'
,
'可支持的环境列表'
),
(
'organizations'
,
'[{
\"
orgId
\"
:
\"
TEST1
\"
,
\"
orgName
\"
:
\"
样例部门1
\"
},{
\"
orgId
\"
:
\"
TEST2
\"
,
\"
orgName
\"
:
\"
样例部门2
\"
}]'
,
'部门列表'
),
(
'superAdmin'
,
'apollo'
,
'Portal超级管理员'
),
(
'api.readTimeout'
,
'10000'
,
'http接口read timeout'
),
(
'consumer.token.salt'
,
'someSalt'
,
'consumer token salt'
),
(
'admin.createPrivateNamespace.switch'
,
'true'
,
'是否允许项目管理员创建私有namespace'
);
INSERT
INTO
`Users`
(
`Username`
,
`Password`
,
`Email`
,
`Enabled`
)
VALUES
(
'apollo'
,
'$2a$10$7r20uS.BQ9uBpf3Baj3uQOZvMVvB1RN3PYoKE94gtz2.WAOuiiwXS'
,
'apollo@admin.com'
,
1
);
INSERT
INTO
`Authorities`
(
`Username`
,
`Authority`
)
VALUES
(
'apollo'
,
'ROLE_user'
);
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */
;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */
;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */
;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */
;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */
;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */
;
scripts/apollo-on-kubernetes/kubernetes/apollo-env-dev/service-apollo-admin-server-dev.yaml
0 → 100755
浏览文件 @
1e5a9190
---
# configmap for apollo-admin-server-dev
kind
:
ConfigMap
apiVersion
:
v1
metadata
:
namespace
:
sre
name
:
configmap-apollo-admin-server-dev
data
:
application-github.properties
:
|
spring.datasource.url = jdbc:mysql://service-mysql-for-apollo-dev-env.sre:3306/DevApolloConfigDB?characterEncoding=utf8
spring.datasource.username = FillInCorrectUser
spring.datasource.password = FillInCorrectPassword
---
kind
:
Service
apiVersion
:
v1
metadata
:
namespace
:
sre
name
:
service-apollo-admin-server-dev
labels
:
app
:
service-apollo-admin-server-dev
spec
:
ports
:
-
protocol
:
TCP
port
:
8090
targetPort
:
8090
selector
:
app
:
pod-apollo-admin-server-dev
type
:
ClusterIP
sessionAffinity
:
ClientIP
---
kind
:
Deployment
apiVersion
:
apps/v1beta2
metadata
:
namespace
:
sre
name
:
deployment-apollo-admin-server-dev
labels
:
app
:
deployment-apollo-admin-server-dev
spec
:
replicas
:
3
selector
:
matchLabels
:
app
:
pod-apollo-admin-server-dev
strategy
:
rollingUpdate
:
maxSurge
:
1
maxUnavailable
:
1
type
:
RollingUpdate
template
:
metadata
:
labels
:
app
:
pod-apollo-admin-server-dev
spec
:
nodeSelector
:
node
:
"
apollo"
volumes
:
-
name
:
volume-configmap-apollo-admin-server-dev
configMap
:
name
:
configmap-apollo-admin-server-dev
items
:
-
key
:
application-github.properties
path
:
application-github.properties
initContainers
:
-
image
:
alpine-bash:3.8
name
:
check-service-apollo-config-server-dev
command
:
[
'
bash'
,
'
-c'
,
"
curl
--connect-timeout
2
--max-time
5
--retry
60
--retry-delay
1
--retry-max-time
120
service-apollo-config-server-dev.sre:8080"
]
containers
:
-
image
:
apollo-admin-server:v1.0.0
securityContext
:
privileged
:
true
imagePullPolicy
:
IfNotPresent
name
:
container-apollo-admin-server-dev
ports
:
-
protocol
:
TCP
containerPort
:
8090
volumeMounts
:
-
name
:
volume-configmap-apollo-admin-server-dev
mountPath
:
/apollo-admin-server/config/application-github.properties
subPath
:
application-github.properties
env
:
-
name
:
APOLLO_ADMIN_SERVICE_NAME
value
:
"
service-apollo-admin-server-dev.sre"
readinessProbe
:
tcpSocket
:
port
:
8090
initialDelaySeconds
:
10
periodSeconds
:
5
livenessProbe
:
tcpSocket
:
port
:
8090
initialDelaySeconds
:
120
periodSeconds
:
10
dnsPolicy
:
ClusterFirst
restartPolicy
:
Always
\ No newline at end of file
scripts/apollo-on-kubernetes/kubernetes/apollo-env-dev/service-apollo-config-server-dev.yaml
0 → 100755
浏览文件 @
1e5a9190
---
# configmap for apollo-config-server-dev
kind
:
ConfigMap
apiVersion
:
v1
metadata
:
namespace
:
sre
name
:
configmap-apollo-config-server-dev
data
:
application-github.properties
:
|
spring.datasource.url = jdbc:mysql://service-mysql-for-apollo-dev-env.sre:3306/DevApolloConfigDB?characterEncoding=utf8
spring.datasource.username = FillInCorrectUser
spring.datasource.password = FillInCorrectPassword
---
kind
:
Service
apiVersion
:
v1
metadata
:
namespace
:
sre
name
:
service-apollo-meta-server-dev
labels
:
app
:
service-apollo-meta-server-dev
spec
:
ports
:
-
protocol
:
TCP
port
:
8080
targetPort
:
8080
selector
:
app
:
pod-apollo-config-server-dev
type
:
ClusterIP
clusterIP
:
None
sessionAffinity
:
ClientIP
---
kind
:
Service
apiVersion
:
v1
metadata
:
namespace
:
sre
name
:
service-apollo-config-server-dev
labels
:
app
:
service-apollo-config-server-dev
spec
:
ports
:
-
protocol
:
TCP
port
:
8080
targetPort
:
8080
nodePort
:
30002
selector
:
app
:
pod-apollo-config-server-dev
type
:
NodePort
sessionAffinity
:
ClientIP
---
kind
:
StatefulSet
apiVersion
:
apps/v1beta2
metadata
:
namespace
:
sre
name
:
statefulset-apollo-config-server-dev
labels
:
app
:
statefulset-apollo-config-server-dev
spec
:
serviceName
:
service-apollo-meta-server-dev
replicas
:
3
selector
:
matchLabels
:
app
:
pod-apollo-config-server-dev
updateStrategy
:
type
:
RollingUpdate
template
:
metadata
:
labels
:
app
:
pod-apollo-config-server-dev
spec
:
nodeSelector
:
node
:
"
apollo"
volumes
:
-
name
:
volume-configmap-apollo-config-server-dev
configMap
:
name
:
configmap-apollo-config-server-dev
items
:
-
key
:
application-github.properties
path
:
application-github.properties
containers
:
-
image
:
apollo-config-server:v1.0.0
securityContext
:
privileged
:
true
imagePullPolicy
:
IfNotPresent
name
:
container-apollo-config-server-dev
ports
:
-
protocol
:
TCP
containerPort
:
8080
volumeMounts
:
-
name
:
volume-configmap-apollo-config-server-dev
mountPath
:
/apollo-config-server/config/application-github.properties
subPath
:
application-github.properties
env
:
-
name
:
APOLLO_CONFIG_SERVICE_NAME
value
:
"
service-apollo-config-server-dev.sre"
readinessProbe
:
tcpSocket
:
port
:
8080
initialDelaySeconds
:
10
periodSeconds
:
5
livenessProbe
:
tcpSocket
:
port
:
8080
initialDelaySeconds
:
120
periodSeconds
:
10
dnsPolicy
:
ClusterFirst
restartPolicy
:
Always
\ No newline at end of file
scripts/apollo-on-kubernetes/kubernetes/apollo-env-dev/service-mysql-for-apollo-dev-env.yaml
0 → 100755
浏览文件 @
1e5a9190
---
# 为外部 mysql 服务设置 service
kind
:
Service
apiVersion
:
v1
metadata
:
namespace
:
sre
name
:
service-mysql-for-apollo-dev-env
labels
:
app
:
service-mysql-for-apollo-dev-env
spec
:
ports
:
-
protocol
:
TCP
port
:
3306
targetPort
:
3306
type
:
ClusterIP
sessionAffinity
:
None
---
kind
:
Endpoints
apiVersion
:
v1
metadata
:
namespace
:
sre
name
:
service-mysql-for-apollo-dev-env
subsets
:
-
addresses
:
-
ip
:
your-mysql-addresses
ports
:
-
protocol
:
TCP
port
:
3306
scripts/apollo-on-kubernetes/kubernetes/apollo-env-prod/service-apollo-admin-server-prod.yaml
0 → 100755
浏览文件 @
1e5a9190
---
# configmap for apollo-admin-server-prod
kind
:
ConfigMap
apiVersion
:
v1
metadata
:
namespace
:
sre
name
:
configmap-apollo-admin-server-prod
data
:
application-github.properties
:
|
spring.datasource.url = jdbc:mysql://service-mysql-for-apollo-prod-env.sre:3306/ProdApolloConfigDB?characterEncoding=utf8
spring.datasource.username = FillInCorrectUser
spring.datasource.password = FillInCorrectPassword
---
kind
:
Service
apiVersion
:
v1
metadata
:
namespace
:
sre
name
:
service-apollo-admin-server-prod
labels
:
app
:
service-apollo-admin-server-prod
spec
:
ports
:
-
protocol
:
TCP
port
:
8090
targetPort
:
8090
selector
:
app
:
pod-apollo-admin-server-prod
type
:
ClusterIP
sessionAffinity
:
ClientIP
---
kind
:
Deployment
apiVersion
:
apps/v1beta2
metadata
:
namespace
:
sre
name
:
deployment-apollo-admin-server-prod
labels
:
app
:
deployment-apollo-admin-server-prod
spec
:
replicas
:
3
selector
:
matchLabels
:
app
:
pod-apollo-admin-server-prod
strategy
:
rollingUpdate
:
maxSurge
:
1
maxUnavailable
:
1
type
:
RollingUpdate
template
:
metadata
:
labels
:
app
:
pod-apollo-admin-server-prod
spec
:
nodeSelector
:
node
:
"
apollo"
volumes
:
-
name
:
volume-configmap-apollo-admin-server-prod
configMap
:
name
:
configmap-apollo-admin-server-prod
items
:
-
key
:
application-github.properties
path
:
application-github.properties
initContainers
:
-
image
:
alpine-bash:3.8
name
:
check-service-apollo-config-server-prod
command
:
[
'
bash'
,
'
-c'
,
"
curl
--connect-timeout
2
--max-time
5
--retry
50
--retry-delay
1
--retry-max-time
120
service-apollo-config-server-prod.sre:8080"
]
containers
:
-
image
:
apollo-admin-server:v1.0.0
securityContext
:
privileged
:
true
imagePullPolicy
:
IfNotPresent
name
:
container-apollo-admin-server-prod
ports
:
-
protocol
:
TCP
containerPort
:
8090
volumeMounts
:
-
name
:
volume-configmap-apollo-admin-server-prod
mountPath
:
/apollo-admin-server/config/application-github.properties
subPath
:
application-github.properties
env
:
-
name
:
APOLLO_ADMIN_SERVICE_NAME
value
:
"
service-apollo-admin-server-prod.sre"
readinessProbe
:
tcpSocket
:
port
:
8090
initialDelaySeconds
:
10
periodSeconds
:
5
livenessProbe
:
tcpSocket
:
port
:
8090
initialDelaySeconds
:
120
periodSeconds
:
10
dnsPolicy
:
ClusterFirst
restartPolicy
:
Always
\ No newline at end of file
scripts/apollo-on-kubernetes/kubernetes/apollo-env-prod/service-apollo-config-server-prod.yaml
0 → 100755
浏览文件 @
1e5a9190
---
# configmap for apollo-config-server-prod
kind
:
ConfigMap
apiVersion
:
v1
metadata
:
namespace
:
sre
name
:
configmap-apollo-config-server-prod
data
:
application-github.properties
:
|
spring.datasource.url = jdbc:mysql://service-mysql-for-apollo-prod-env.sre:3306/ProdApolloConfigDB?characterEncoding=utf8
spring.datasource.username = FillInCorrectUser
spring.datasource.password = FillInCorrectPassword
---
kind
:
Service
apiVersion
:
v1
metadata
:
namespace
:
sre
name
:
service-apollo-meta-server-prod
labels
:
app
:
service-apollo-meta-server-prod
spec
:
ports
:
-
protocol
:
TCP
port
:
8080
targetPort
:
8080
selector
:
app
:
pod-apollo-config-server-prod
type
:
ClusterIP
clusterIP
:
None
sessionAffinity
:
ClientIP
---
kind
:
Service
apiVersion
:
v1
metadata
:
namespace
:
sre
name
:
service-apollo-config-server-prod
labels
:
app
:
service-apollo-config-server-prod
spec
:
ports
:
-
protocol
:
TCP
port
:
8080
targetPort
:
8080
nodePort
:
30005
selector
:
app
:
pod-apollo-config-server-prod
type
:
NodePort
sessionAffinity
:
ClientIP
---
kind
:
StatefulSet
apiVersion
:
apps/v1beta2
metadata
:
namespace
:
sre
name
:
statefulset-apollo-config-server-prod
labels
:
app
:
statefulset-apollo-config-server-prod
spec
:
serviceName
:
service-apollo-meta-server-prod
replicas
:
3
selector
:
matchLabels
:
app
:
pod-apollo-config-server-prod
updateStrategy
:
type
:
RollingUpdate
template
:
metadata
:
labels
:
app
:
pod-apollo-config-server-prod
spec
:
nodeSelector
:
node
:
"
apollo"
volumes
:
-
name
:
volume-configmap-apollo-config-server-prod
configMap
:
name
:
configmap-apollo-config-server-prod
items
:
-
key
:
application-github.properties
path
:
application-github.properties
containers
:
-
image
:
apollo-config-server:v1.0.0
securityContext
:
privileged
:
true
imagePullPolicy
:
IfNotPresent
name
:
container-apollo-config-server-prod
ports
:
-
protocol
:
TCP
containerPort
:
8080
volumeMounts
:
-
name
:
volume-configmap-apollo-config-server-prod
mountPath
:
/apollo-config-server/config/application-github.properties
subPath
:
application-github.properties
env
:
-
name
:
APOLLO_CONFIG_SERVICE_NAME
value
:
"
service-apollo-config-server-prod.sre"
readinessProbe
:
tcpSocket
:
port
:
8080
initialDelaySeconds
:
10
periodSeconds
:
5
livenessProbe
:
tcpSocket
:
port
:
8080
initialDelaySeconds
:
120
periodSeconds
:
10
dnsPolicy
:
ClusterFirst
restartPolicy
:
Always
\ No newline at end of file
scripts/apollo-on-kubernetes/kubernetes/apollo-env-prod/service-mysql-for-apollo-prod-env.yaml
0 → 100755
浏览文件 @
1e5a9190
---
kind
:
Service
apiVersion
:
v1
metadata
:
namespace
:
sre
name
:
service-mysql-for-apollo-prod-env
labels
:
app
:
service-mysql-for-apollo-prod-env
spec
:
ports
:
-
protocol
:
TCP
port
:
3306
targetPort
:
3306
type
:
ClusterIP
sessionAffinity
:
None
---
kind
:
Endpoints
apiVersion
:
v1
metadata
:
namespace
:
sre
name
:
service-mysql-for-apollo-prod-env
subsets
:
-
addresses
:
-
ip
:
your-mysql-addresses
ports
:
-
protocol
:
TCP
port
:
3306
\ No newline at end of file
scripts/apollo-on-kubernetes/kubernetes/apollo-env-test-alpha/service-apollo-admin-server-test-alpha.yaml
0 → 100755
浏览文件 @
1e5a9190
---
# configmap for apollo-admin-server-test-alpha
kind
:
ConfigMap
apiVersion
:
v1
metadata
:
namespace
:
sre
name
:
configmap-apollo-admin-server-test-alpha
data
:
application-github.properties
:
|
spring.datasource.url = jdbc:mysql://service-mysql-for-apollo-test-alpha-env.sre:3306/TestAlphaApolloConfigDB?characterEncoding=utf8
spring.datasource.username = FillInCorrectUser
spring.datasource.password = FillInCorrectPassword
---
kind
:
Service
apiVersion
:
v1
metadata
:
namespace
:
sre
name
:
service-apollo-admin-server-test-alpha
labels
:
app
:
service-apollo-admin-server-test-alpha
spec
:
ports
:
-
protocol
:
TCP
port
:
8090
targetPort
:
8090
selector
:
app
:
pod-apollo-admin-server-test-alpha
type
:
ClusterIP
sessionAffinity
:
ClientIP
---
kind
:
Deployment
apiVersion
:
apps/v1beta2
metadata
:
namespace
:
sre
name
:
deployment-apollo-admin-server-test-alpha
labels
:
app
:
deployment-apollo-admin-server-test-alpha
spec
:
replicas
:
3
selector
:
matchLabels
:
app
:
pod-apollo-admin-server-test-alpha
strategy
:
rollingUpdate
:
maxSurge
:
1
maxUnavailable
:
1
type
:
RollingUpdate
template
:
metadata
:
labels
:
app
:
pod-apollo-admin-server-test-alpha
spec
:
nodeSelector
:
node
:
"
apollo"
volumes
:
-
name
:
volume-configmap-apollo-admin-server-test-alpha
configMap
:
name
:
configmap-apollo-admin-server-test-alpha
items
:
-
key
:
application-github.properties
path
:
application-github.properties
initContainers
:
-
image
:
alpine-bash:3.8
name
:
check-service-apollo-config-server-test-alpha
command
:
[
'
bash'
,
'
-c'
,
"
curl
--connect-timeout
2
--max-time
5
--retry
60
--retry-delay
1
--retry-max-time
120
service-apollo-config-server-test-alpha.sre:8080"
]
containers
:
-
image
:
apollo-admin-server:v1.0.0
securityContext
:
privileged
:
true
imagePullPolicy
:
IfNotPresent
name
:
container-apollo-admin-server-test-alpha
ports
:
-
protocol
:
TCP
containerPort
:
8090
volumeMounts
:
-
name
:
volume-configmap-apollo-admin-server-test-alpha
mountPath
:
/apollo-admin-server/config/application-github.properties
subPath
:
application-github.properties
env
:
-
name
:
APOLLO_ADMIN_SERVICE_NAME
value
:
"
service-apollo-admin-server-test-alpha.sre"
readinessProbe
:
tcpSocket
:
port
:
8090
initialDelaySeconds
:
10
periodSeconds
:
5
livenessProbe
:
tcpSocket
:
port
:
8090
initialDelaySeconds
:
120
periodSeconds
:
10
dnsPolicy
:
ClusterFirst
restartPolicy
:
Always
\ No newline at end of file
scripts/apollo-on-kubernetes/kubernetes/apollo-env-test-alpha/service-apollo-config-server-test-alpha.yaml
0 → 100755
浏览文件 @
1e5a9190
---
# configmap for apollo-config-server-test-alpha
kind
:
ConfigMap
apiVersion
:
v1
metadata
:
namespace
:
sre
name
:
configmap-apollo-config-server-test-alpha
data
:
application-github.properties
:
|
spring.datasource.url = jdbc:mysql://service-mysql-for-apollo-test-alpha-env.sre:3306/TestAlphaApolloConfigDB?characterEncoding=utf8
spring.datasource.username = FillInCorrectUser
spring.datasource.password = FillInCorrectPassword
---
kind
:
Service
apiVersion
:
v1
metadata
:
namespace
:
sre
name
:
service-apollo-meta-server-test-alpha
labels
:
app
:
service-apollo-meta-server-test-alpha
spec
:
ports
:
-
protocol
:
TCP
port
:
8080
targetPort
:
8080
selector
:
app
:
pod-apollo-config-server-test-alpha
type
:
ClusterIP
clusterIP
:
None
sessionAffinity
:
ClientIP
---
kind
:
Service
apiVersion
:
v1
metadata
:
namespace
:
sre
name
:
service-apollo-config-server-test-alpha
labels
:
app
:
service-apollo-config-server-test-alpha
spec
:
ports
:
-
protocol
:
TCP
port
:
8080
targetPort
:
8080
nodePort
:
30003
selector
:
app
:
pod-apollo-config-server-test-alpha
type
:
NodePort
sessionAffinity
:
ClientIP
---
kind
:
StatefulSet
apiVersion
:
apps/v1beta2
metadata
:
namespace
:
sre
name
:
statefulset-apollo-config-server-test-alpha
labels
:
app
:
statefulset-apollo-config-server-test-alpha
spec
:
serviceName
:
service-apollo-meta-server-test-alpha
replicas
:
3
selector
:
matchLabels
:
app
:
pod-apollo-config-server-test-alpha
updateStrategy
:
type
:
RollingUpdate
template
:
metadata
:
labels
:
app
:
pod-apollo-config-server-test-alpha
spec
:
nodeSelector
:
node
:
"
apollo"
volumes
:
-
name
:
volume-configmap-apollo-config-server-test-alpha
configMap
:
name
:
configmap-apollo-config-server-test-alpha
items
:
-
key
:
application-github.properties
path
:
application-github.properties
containers
:
-
image
:
apollo-config-server:v1.0.0
securityContext
:
privileged
:
true
imagePullPolicy
:
IfNotPresent
name
:
container-apollo-config-server-test-alpha
ports
:
-
protocol
:
TCP
containerPort
:
8080
volumeMounts
:
-
name
:
volume-configmap-apollo-config-server-test-alpha
mountPath
:
/apollo-config-server/config/application-github.properties
subPath
:
application-github.properties
env
:
-
name
:
APOLLO_CONFIG_SERVICE_NAME
value
:
"
service-apollo-config-server-test-alpha.sre"
readinessProbe
:
tcpSocket
:
port
:
8080
initialDelaySeconds
:
10
periodSeconds
:
5
livenessProbe
:
tcpSocket
:
port
:
8080
initialDelaySeconds
:
120
periodSeconds
:
10
dnsPolicy
:
ClusterFirst
restartPolicy
:
Always
\ No newline at end of file
scripts/apollo-on-kubernetes/kubernetes/apollo-env-test-alpha/service-mysql-for-apollo-test-alpha-env.yaml
0 → 100755
浏览文件 @
1e5a9190
---
kind
:
Service
apiVersion
:
v1
metadata
:
namespace
:
sre
name
:
service-mysql-for-apollo-test-alpha-env
labels
:
app
:
service-mysql-for-apollo-test-alpha-env
spec
:
ports
:
-
protocol
:
TCP
port
:
3306
targetPort
:
3306
type
:
ClusterIP
sessionAffinity
:
None
---
kind
:
Endpoints
apiVersion
:
v1
metadata
:
namespace
:
sre
name
:
service-mysql-for-apollo-test-alpha-env
subsets
:
-
addresses
:
-
ip
:
your-mysql-addresses
ports
:
-
protocol
:
TCP
port
:
3306
\ No newline at end of file
scripts/apollo-on-kubernetes/kubernetes/apollo-env-test-beta/service-apollo-admin-server-test-beta.yaml
0 → 100755
浏览文件 @
1e5a9190
---
# configmap for apollo-admin-server-test-beta
kind
:
ConfigMap
apiVersion
:
v1
metadata
:
namespace
:
sre
name
:
configmap-apollo-admin-server-test-beta
data
:
application-github.properties
:
|
spring.datasource.url = jdbc:mysql://service-mysql-for-apollo-test-beta-env.sre:3306/TestBetaApolloConfigDB?characterEncoding=utf8
spring.datasource.username = FillInCorrectUser
spring.datasource.password = FillInCorrectPassword
---
kind
:
Service
apiVersion
:
v1
metadata
:
namespace
:
sre
name
:
service-apollo-admin-server-test-beta
labels
:
app
:
service-apollo-admin-server-test-beta
spec
:
ports
:
-
protocol
:
TCP
port
:
8090
targetPort
:
8090
selector
:
app
:
pod-apollo-admin-server-test-beta
type
:
ClusterIP
sessionAffinity
:
ClientIP
---
kind
:
Deployment
apiVersion
:
apps/v1beta2
metadata
:
namespace
:
sre
name
:
deployment-apollo-admin-server-test-beta
labels
:
app
:
deployment-apollo-admin-server-test-beta
spec
:
replicas
:
3
selector
:
matchLabels
:
app
:
pod-apollo-admin-server-test-beta
strategy
:
rollingUpdate
:
maxSurge
:
1
maxUnavailable
:
1
type
:
RollingUpdate
template
:
metadata
:
labels
:
app
:
pod-apollo-admin-server-test-beta
spec
:
nodeSelector
:
node
:
"
apollo"
volumes
:
-
name
:
volume-configmap-apollo-admin-server-test-beta
configMap
:
name
:
configmap-apollo-admin-server-test-beta
items
:
-
key
:
application-github.properties
path
:
application-github.properties
initContainers
:
-
image
:
alpine-bash:3.8
name
:
check-service-apollo-config-server-test-beta
command
:
[
'
bash'
,
'
-c'
,
"
curl
--connect-timeout
2
--max-time
5
--retry
60
--retry-delay
1
--retry-max-time
120
service-apollo-config-server-test-beta.sre:8080"
]
containers
:
-
image
:
apollo-admin-server:v1.0.0
imagePullPolicy
:
IfNotPresent
name
:
container-apollo-admin-server-test-beta
ports
:
-
protocol
:
TCP
containerPort
:
8090
volumeMounts
:
-
name
:
volume-configmap-apollo-admin-server-test-beta
mountPath
:
/apollo-admin-server/config/application-github.properties
subPath
:
application-github.properties
env
:
-
name
:
APOLLO_ADMIN_SERVICE_NAME
value
:
"
service-apollo-admin-server-test-beta.sre"
readinessProbe
:
tcpSocket
:
port
:
8090
initialDelaySeconds
:
10
periodSeconds
:
5
livenessProbe
:
tcpSocket
:
port
:
8090
initialDelaySeconds
:
120
periodSeconds
:
10
dnsPolicy
:
ClusterFirst
restartPolicy
:
Always
\ No newline at end of file
scripts/apollo-on-kubernetes/kubernetes/apollo-env-test-beta/service-apollo-config-server-test-beta.yaml
0 → 100755
浏览文件 @
1e5a9190
---
# configmap for apollo-config-server-test-beta
kind
:
ConfigMap
apiVersion
:
v1
metadata
:
namespace
:
sre
name
:
configmap-apollo-config-server-test-beta
data
:
application-github.properties
:
|
spring.datasource.url = jdbc:mysql://service-mysql-for-apollo-test-beta-env.sre:3306/TestBetaApolloConfigDB?characterEncoding=utf8
spring.datasource.username = FillInCorrectUser
spring.datasource.password = FillInCorrectPassword
---
kind
:
Service
apiVersion
:
v1
metadata
:
namespace
:
sre
name
:
service-apollo-meta-server-test-beta
labels
:
app
:
service-apollo-meta-server-test-beta
spec
:
ports
:
-
protocol
:
TCP
port
:
8080
targetPort
:
8080
selector
:
app
:
pod-apollo-config-server-test-beta
type
:
ClusterIP
clusterIP
:
None
sessionAffinity
:
ClientIP
---
kind
:
Service
apiVersion
:
v1
metadata
:
namespace
:
sre
name
:
service-apollo-config-server-test-beta
labels
:
app
:
service-apollo-config-server-test-beta
spec
:
ports
:
-
protocol
:
TCP
port
:
8080
targetPort
:
8080
nodePort
:
30004
selector
:
app
:
pod-apollo-config-server-test-beta
type
:
NodePort
sessionAffinity
:
ClientIP
---
kind
:
StatefulSet
apiVersion
:
apps/v1beta2
metadata
:
namespace
:
sre
name
:
statefulset-apollo-config-server-test-beta
labels
:
app
:
statefulset-apollo-config-server-test-beta
spec
:
serviceName
:
service-apollo-meta-server-test-beta
replicas
:
3
selector
:
matchLabels
:
app
:
pod-apollo-config-server-test-beta
updateStrategy
:
type
:
RollingUpdate
template
:
metadata
:
labels
:
app
:
pod-apollo-config-server-test-beta
spec
:
nodeSelector
:
node
:
"
apollo"
volumes
:
-
name
:
volume-configmap-apollo-config-server-test-beta
configMap
:
name
:
configmap-apollo-config-server-test-beta
items
:
-
key
:
application-github.properties
path
:
application-github.properties
containers
:
-
image
:
apollo-config-server:v1.0.0
securityContext
:
privileged
:
true
imagePullPolicy
:
IfNotPresent
name
:
container-apollo-config-server-test-beta
ports
:
-
protocol
:
TCP
containerPort
:
8080
volumeMounts
:
-
name
:
volume-configmap-apollo-config-server-test-beta
mountPath
:
/apollo-config-server/config/application-github.properties
subPath
:
application-github.properties
env
:
-
name
:
APOLLO_CONFIG_SERVICE_NAME
value
:
"
service-apollo-config-server-test-beta.sre"
readinessProbe
:
tcpSocket
:
port
:
8080
initialDelaySeconds
:
10
periodSeconds
:
5
livenessProbe
:
tcpSocket
:
port
:
8080
initialDelaySeconds
:
120
periodSeconds
:
15
dnsPolicy
:
ClusterFirst
restartPolicy
:
Always
\ No newline at end of file
scripts/apollo-on-kubernetes/kubernetes/apollo-env-test-beta/service-mysql-for-apollo-test-beta-env.yaml
0 → 100755
浏览文件 @
1e5a9190
---
kind
:
Service
apiVersion
:
v1
metadata
:
namespace
:
sre
name
:
service-mysql-for-apollo-test-beta-env
labels
:
app
:
service-mysql-for-apollo-test-beta-env
spec
:
ports
:
-
protocol
:
TCP
port
:
3306
targetPort
:
3306
type
:
ClusterIP
sessionAffinity
:
None
---
kind
:
Endpoints
apiVersion
:
v1
metadata
:
namespace
:
sre
name
:
service-mysql-for-apollo-test-beta-env
subsets
:
-
addresses
:
-
ip
:
your-mysql-addresses
ports
:
-
protocol
:
TCP
port
:
3306
\ No newline at end of file
scripts/apollo-on-kubernetes/kubernetes/kubectl-apply.sh
0 → 100755
浏览文件 @
1e5a9190
# create namespace
kubectl create namespace sre
# dev-env
kubectl apply
-f
service-mysql-for-apollo-dev-env.yaml
--record
&&
\
kubectl apply
-f
service-apollo-config-server-dev.yaml
--record
&&
\
kubectl apply
-f
service-apollo-admin-server-dev.yaml
--record
# fat-env(test-alpha-env)
kubectl apply
-f
service-mysql-for-apollo-test-alpha-env.yaml
--record
&&
\
kubectl apply
-f
service-apollo-config-server-test-alpha.yaml
--record
&&
\
kubectl apply
-f
service-apollo-admin-server-test-alpha.yaml
--record
# uat-env(test-beta-env)
kubectl apply
-f
service-mysql-for-apollo-test-beta-env.yaml
--record
&&
\
kubectl apply
-f
service-apollo-config-server-test-beta.yaml
--record
&&
\
kubectl apply
-f
service-apollo-admin-server-test-beta.yaml
--record
# prod-env
kubectl apply
-f
service-mysql-for-apollo-prod-env.yaml
--record
&&
\
kubectl apply
-f
service-apollo-config-server-prod.yaml
--record
&&
\
kubectl apply
-f
service-apollo-admin-server-prod.yaml
--record
# portal
kubectl apply
-f
service-apollo-portal-server.yaml
--record
scripts/apollo-on-kubernetes/kubernetes/service-apollo-portal-server.yaml
0 → 100755
浏览文件 @
1e5a9190
---
# 为外部 mysql 服务设置 service
kind
:
Service
apiVersion
:
v1
metadata
:
namespace
:
sre
name
:
service-mysql-for-portal-server
labels
:
app
:
service-mysql-for-portal-server
spec
:
ports
:
-
protocol
:
TCP
port
:
3306
targetPort
:
3306
type
:
ClusterIP
sessionAffinity
:
None
---
kind
:
Endpoints
apiVersion
:
v1
metadata
:
namespace
:
sre
name
:
service-mysql-for-portal-server
subsets
:
-
addresses
:
# 更改为你的 mysql addresses, 例如 1.1.1.1
# 其中 1.1.1.1、2.2.2.2、3.3.3.3 为你的 mysql 集群, 例如 MySQL-Galera-WSrep 或 TiDB
-
ip
:
your-mysql-addresses
ports
:
-
protocol
:
TCP
port
:
3306
-
addresses
:
# 更改为你的 mysql addresses, 例如 2.2.2.2
-
ip
:
your-mysql-addresses
ports
:
-
protocol
:
TCP
port
:
3306
-
addresses
:
# 更改为你的 mysql addresses, 例如 3.3.3.3
-
ip
:
your-mysql-addresses
ports
:
-
protocol
:
TCP
port
:
3306
---
# configmap for apollo-portal-server
kind
:
ConfigMap
apiVersion
:
v1
metadata
:
namespace
:
sre
name
:
configmap-apollo-portal-server
data
:
application-github.properties
:
|
spring.datasource.url = jdbc:mysql://service-mysql-for-portal-server.sre:3306/ApolloPortalDB?characterEncoding=utf8
# mysql username
spring.datasource.username = FillInCorrectUser
# mysql password
spring.datasource.password = FillInCorrectPassword
apollo-env.properties
:
|
dev.meta=http://service-apollo-config-server-dev.sre:8080
fat.meta=http://service-apollo-config-server-test-alpha.sre:8080
uat.meta=http://service-apollo-config-server-test-beta.sre:8080
pro.meta=http://service-apollo-config-server-prod.sre:8080
---
kind
:
Service
apiVersion
:
v1
metadata
:
namespace
:
sre
name
:
service-apollo-portal-server
labels
:
app
:
service-apollo-portal-server
spec
:
ports
:
-
protocol
:
TCP
port
:
8070
targetPort
:
8070
nodePort
:
30001
selector
:
app
:
pod-apollo-portal-server
type
:
NodePort
# portal session 保持
sessionAffinity
:
ClientIP
---
kind
:
Deployment
apiVersion
:
apps/v1beta2
metadata
:
namespace
:
sre
name
:
deployment-apollo-portal-server
labels
:
app
:
deployment-apollo-portal-server
spec
:
# 3 个实例
replicas
:
3
selector
:
matchLabels
:
app
:
pod-apollo-portal-server
strategy
:
rollingUpdate
:
maxSurge
:
1
maxUnavailable
:
1
type
:
RollingUpdate
template
:
metadata
:
labels
:
app
:
pod-apollo-portal-server
spec
:
nodeSelector
:
node
:
"
apollo"
volumes
:
-
name
:
volume-configmap-apollo-portal-server
configMap
:
name
:
configmap-apollo-portal-server
items
:
-
key
:
application-github.properties
path
:
application-github.properties
-
key
:
apollo-env.properties
path
:
apollo-env.properties
initContainers
:
# 确保 admin-service 正常提供服务
-
image
:
alpine-bash:3.8
name
:
check-service-apollo-admin-server-dev
command
:
[
'
bash'
,
'
-c'
,
"
curl
--connect-timeout
2
--max-time
5
--retry
60
--retry-delay
1
--retry-max-time
120
service-apollo-admin-server-dev.sre:8090"
]
-
image
:
alpine-bash:3.8
name
:
check-service-apollo-admin-server-dev
command
:
[
'
bash'
,
'
-c'
,
"
curl
--connect-timeout
2
--max-time
5
--retry
60
--retry-delay
1
--retry-max-time
120
service-apollo-admin-server-test-alpha.sre:8090"
]
-
image
:
alpine-bash:3.8
name
:
check-service-apollo-admin-server-dev
command
:
[
'
bash'
,
'
-c'
,
"
curl
--connect-timeout
2
--max-time
5
--retry
60
--retry-delay
1
--retry-max-time
120
service-apollo-admin-server-test-beta.sre:8090"
]
-
image
:
alpine-bash:3.8
name
:
check-service-apollo-admin-server-dev
command
:
[
'
bash'
,
'
-c'
,
"
curl
--connect-timeout
2
--max-time
5
--retry
60
--retry-delay
1
--retry-max-time
120
service-apollo-admin-server-prod.sre:8090"
]
containers
:
-
image
:
apollo-portal-server:v1.0.0
# 更改为你的 docker registry 下的 image
securityContext
:
privileged
:
true
imagePullPolicy
:
IfNotPresent
name
:
container-apollo-portal-server
ports
:
-
protocol
:
TCP
containerPort
:
8070
volumeMounts
:
-
name
:
volume-configmap-apollo-portal-server
mountPath
:
/apollo-portal-server/config/application-github.properties
subPath
:
application-github.properties
-
name
:
volume-configmap-apollo-portal-server
mountPath
:
/apollo-portal-server/config/apollo-env.properties
subPath
:
apollo-env.properties
env
:
-
name
:
APOLLO_PORTAL_SERVICE_NAME
value
:
"
service-apollo-portal-server.sre"
readinessProbe
:
tcpSocket
:
port
:
8070
initialDelaySeconds
:
10
periodSeconds
:
5
livenessProbe
:
tcpSocket
:
port
:
8070
# 120s 内, server 未启动则重启 container
initialDelaySeconds
:
120
periodSeconds
:
15
dnsPolicy
:
ClusterFirst
restartPolicy
:
Always
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录