Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
ibiz4edge
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
iBiz-R7后台标准模板
ibiz4edge
提交
2504db83
提交
2504db83
编写于
8月 23, 2022
作者:
sq3536
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
registry.cn-shanghai.aliyuncs.com/ibizsys/omni-omiehr-app-omniehrmob:2022.08.23.009
上级
8d03eeb8
变更
2
显示空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
324 行增加
和
0 行删除
+324
-0
%PUBPRJ%-app-%APP_PKGPATH%-k8s.yaml.ftl
...t/src/main/docker/%PUBPRJ%-app-%APP_PKGPATH%-k8s.yaml.ftl
+168
-0
%PUBPRJ%-app-%APP_PKGPATH%.yaml.ftl
...-boot/src/main/docker/%PUBPRJ%-app-%APP_PKGPATH%.yaml.ftl
+156
-0
未找到文件。
SLN/%PUBPRJ%-boot/src/main/docker/%PUBPRJ%-app-%APP_PKGPATH%-k8s.yaml.ftl
0 → 100644
浏览文件 @
2504db83
<#ibiztemplate>
TARGET=PSSYSAPP
</#ibiztemplate>
<#assign httpPort = "8080">
<#assign nacosUrl = "127.0.0.1:8848" >
<#assign redisHost = "127.0.0.1" >
<#assign redisPort = "6379" >
<#assign redisDataBase = "0" >
<#assign dbUserName="root">
<#assign dbPassWord="123456">
<#assign dbUrl="jdbc:mysql://127.0.0.1:3306/"+sys.name+"?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&useOldAliasMetadataBehavior=true&allowMultiQueries=true">
<#assign dbDriver="com.mysql.jdbc.Driver">
<#if sysrun?? && sysrun.getPSDevSlnMSDepApp()??>
<#assign depApp=sysrun.getPSDevSlnMSDepApp()>
<#if depApp.getHttpPort()??>
<#assign httpPort = sysrun.getPSDevSlnMSDepApp().getHttpPort()?c>
</#if>
<#if depApp.getPSDCMSPlatformNode()??>
<#assign appPlatformNode=depApp.getPSDCMSPlatformNode()>
<#assign appPlatform=depApp.getPSDCMSPlatform()>
<#if appPlatform.getUserParam("nacos","127.0.0.1:8848")??>
<#assign nacosUrl = appPlatform.getUserParam("nacos","127.0.0.1:8848")>
</#if>
<#if depApp.getUserParam("spring.redis.host","")?? && depApp.getUserParam("spring.redis.host","")!="">
<#assign redisHost = depApp.getUserParam("spring.redis.host","")>
<#elseif appPlatform.getUserParam("spring.redis.host","")?? && appPlatform.getUserParam("spring.redis.host","")!="">
<#assign redisHost = appPlatform.getUserParam("spring.redis.host","")>
</#if>
<#if depApp.getUserParam("spring.redis.port","")?? && depApp.getUserParam("spring.redis.port","")!="">
<#assign redisPort = depApp.getUserParam("spring.redis.port","")>
<#elseif appPlatform.getUserParam("spring.redis.port","")?? && appPlatform.getUserParam("spring.redis.port","")!="">
<#assign redisPort = appPlatform.getUserParam("spring.redis.port","")>
</#if>
<#if depApp.getUserParam("spring.redis.database","")?? && depApp.getUserParam("spring.redis.database","")!="">
<#assign redisDataBase = depApp.getUserParam("spring.redis.database","")>
<#elseif appPlatform.getUserParam("spring.redis.database","")?? && appPlatform.getUserParam("spring.redis.database","")!="">
<#assign redisDataBase = appPlatform.getUserParam("spring.redis.database","")>
</#if>
</#if>
</#if>
<#comment>数据库配置</#comment>
<#if sysrun.getPSDBDevInst()??>
<#assign sysRunDBInst = sysrun.getPSDBDevInst()>
<#assign dbUserName=sysRunDBInst.getUserName()>
<#assign dbPassWord=sysRunDBInst.getPassword()>
<#assign dbUrl=sysRunDBInst.getConnUrl()>
<#if (sysRunDBInst.getDBType()=='MYSQL5')>
<#assign dbDriver="com.mysql.jdbc.Driver">
<#assign dbUrl=dbUrl+"&allowMultiQueries=true">
<#elseif (sysRunDBInst.getDBType()=='DB2')>
<#assign dbDriver="com.ibm.db2.jcc.DB2Driver">
<#elseif (sysRunDBInst.getDBType()=='ORACLE')>
<#assign dbDriver="oracle.jdbc.driver.OracleDriver">
<#elseif (sysRunDBInst.getDBType()=='SQLSERVER')>
<#assign dbDriver="com.microsoft.sqlserver.jdbc.SQLServerDriver">
<#elseif (sysRunDBInst.getDBType()=='POSTGRESQL')>
<#assign dbDriver="org.postgresql.Driver">
<#elseif (sysRunDBInst.getDBType()=='PPAS')>
<#assign dbDriver="com.edb.Driver">
</#if>
</#if>
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: ${pub.getCodeName()?lower_case}-app-${app.getPKGCodeName()?lower_case}
labels:
app: ${pub.getCodeName()?lower_case}-app-${app.getPKGCodeName()?lower_case}
spec:
replicas: 1
selector:
matchLabels:
app: ${pub.getCodeName()?lower_case}-app-${app.getPKGCodeName()?lower_case}
template:
metadata:
labels:
app: ${pub.getCodeName()?lower_case}-app-${app.getPKGCodeName()?lower_case}
spec:
imagePullSecrets:
- name: aly-shanghai
containers:
- name: ${pub.getCodeName()?lower_case}-app-${app.getPKGCodeName()?lower_case}
image: registry.cn-shanghai.aliyuncs.com/ibizsys/${pub.getCodeName()?lower_case}-app-${app.getPKGCodeName()?lower_case}:latest
imagePullPolicy: Always
ports:
- containerPort: ${httpPort}
<#if sysrun?? && sysrun.getPSDevSlnMSDepApp()?? && sysrun.getPSDevSlnMSDepApp().getPSDCMSPlatformNode()??>
<#assign depApp=sysrun.getPSDevSlnMSDepApp()>
<#assign appPlatformNode=sysrun.getPSDevSlnMSDepApp().getPSDCMSPlatformNode()>
<#assign appPlatform=sysrun.getPSDevSlnMSDepApp().getPSDCMSPlatform()>
env:
<#if appPlatformNode.getSSHIPAddr()??>
- name: SPRING_CLOUD_NACOS_DISCOVERY_IP
value: "${appPlatformNode.getSSHIPAddr()}"
</#if>
<#comment>系统运行参数设置,从SysRun中获取到当前部署相关信息</#comment>
- name: SERVER_PORT
value: "${httpPort}"
- name: SPRING_CLOUD_NACOS_DISCOVERY_SERVER-ADDR
value: "${nacosUrl}"
- name: SPRING_REDIS_HOST
value: "${redisHost}"
- name: SPRING_REDIS_PORT
value: "${redisPort}"
- name: SPRING_REDIS_DATABASE
value: "${redisDataBase}"
- name: SPRING_DATASOURCE_USERNAME
value: "${dbUserName}"
- name: SPRING_DATASOURCE_PASSWORD
value: "${dbPassWord}"
- name: SPRING_DATASOURCE_URL
value: "${dbUrl}"
- name: SPRING_DATASOURCE_DRIVER-CLASS-NAME
value: "${dbDriver}"
- name: SPRING_DATASOURCE_DEFAULTSCHEMA
value: "${dbUserName}"
<#comment>输出前端应用自定义参数替换标准参数</#comment>
<#if depApp.getUserParamNames()??>
<@outputUserParam depApp depApp.getUserParamNames()/>
</#if>
<#comment>输出微服务平台自定义参数替换标准参数</#comment>
<#if appPlatform.getUserParamNames()??>
<@outputUserParam appPlatform appPlatform.getUserParamNames()/>
</#if>
</#if>
volumeMounts:
- name: data
mountPath: /app/file
volumes:
- name: data
persistentVolumeClaim:
claimName: demo-date-pvc-nfs
---
apiVersion: v1
kind: Service
metadata:
name: ${pub.getCodeName()?lower_case}-app-${app.getPKGCodeName()?lower_case}
labels:
app: ${pub.getCodeName()?lower_case}-app-${app.getPKGCodeName()?lower_case}
spec:
type: NodePort
ports:
- name: http
port: ${httpPort}
targetPort: ${httpPort}
nodePort: ${httpPort}
protocol: TCP
selector:
app: ${pub.getCodeName()?lower_case}-app-${app.getPKGCodeName()?lower_case}
<#comment>输出用户自定义参数</#comment>
<#macro outputUserParam paramObj paramList>
<#list paramList as param>
<#assign userParamkey=param?upper_case?replace(".","_")>
<#comment>nacos、数据库连接等信息从sysRun中获取</#comment>
<#if userParamkey!="SPRING_CLOUD_NACOS_DISCOVERY_SERVER-ADDR" && userParamkey!="SPRING_REDIS_HOST" &&
userParamkey!="SERVER_PORT" &&userParamkey!="SPRING_REDIS_PORT" &&userParamkey!="SPRING_REDIS_DATABASE"
&&userParamkey!="SPRING_DATASOURCE_USERNAME" &&userParamkey!="SPRING_DATASOURCE_PASSWORD"
&&userParamkey!="SPRING_DATASOURCE_URL" &&userParamkey!="SPRING_DATASOURCE_DRIVER-CLASS-NAME" &&userParamkey!="SPRING_DATASOURCE_DEFAULTSCHEMA">
<#comment>扩展标准配置:用户配置参数替换标准配置(application-sys.yml)</#comment>
<#if !P.exists('AppDeployUserParam',param)>
- name: ${userParamkey}
value: "${paramObj.getUserParam(param,"")}"
</#if>
</#if>
</#list>
</#macro>
\ No newline at end of file
SLN/%PUBPRJ%-boot/src/main/docker/%PUBPRJ%-app-%APP_PKGPATH%.yaml.ftl
0 → 100644
浏览文件 @
2504db83
<#ibiztemplate>
TARGET=PSSYSAPP
</#ibiztemplate>
<#assign httpPort = "8080">
<#assign nacosUrl = "127.0.0.1:8848" >
<#assign redisHost = "127.0.0.1" >
<#assign redisPort = "6379" >
<#assign redisDataBase = "0" >
<#assign dbUserName="root">
<#assign dbPassWord="123456">
<#assign dbUrl="jdbc:mysql://127.0.0.1:3306/"+sys.name+"?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&useOldAliasMetadataBehavior=true&allowMultiQueries=true">
<#assign dbDriver="com.mysql.jdbc.Driver">
<#assign dockerPortMap="">
<#if sysrun?? && sysrun.getPSDevSlnMSDepApp()??>
<#assign depApp=sysrun.getPSDevSlnMSDepApp()>
<#if depApp.getHttpPort()??>
<#assign httpPort = sysrun.getPSDevSlnMSDepApp().getHttpPort()?c>
</#if>
<#if depApp.getPSDCMSPlatformNode()??>
<#assign appPlatformNode=depApp.getPSDCMSPlatformNode()>
<#assign appPlatform=depApp.getPSDCMSPlatform()>
<#if appPlatform.getUserParam("nacos","127.0.0.1:8848")??>
<#assign nacosUrl = appPlatform.getUserParam("nacos","127.0.0.1:8848")>
</#if>
<#if depApp.getUserParam("spring.redis.host","")?? && depApp.getUserParam("spring.redis.host","")!="">
<#assign redisHost = depApp.getUserParam("spring.redis.host","")>
<#elseif appPlatform.getUserParam("spring.redis.host","")?? && appPlatform.getUserParam("spring.redis.host","")!="">
<#assign redisHost = appPlatform.getUserParam("spring.redis.host","")>
</#if>
<#if depApp.getUserParam("spring.redis.port","")?? && depApp.getUserParam("spring.redis.port","")!="">
<#assign redisPort = depApp.getUserParam("spring.redis.port","")>
<#elseif appPlatform.getUserParam("spring.redis.port","")?? && appPlatform.getUserParam("spring.redis.port","")!="">
<#assign redisPort = appPlatform.getUserParam("spring.redis.port","")>
</#if>
<#if depApp.getUserParam("spring.redis.database","")?? && depApp.getUserParam("spring.redis.database","")!="">
<#assign redisDataBase = depApp.getUserParam("spring.redis.database","")>
<#elseif appPlatform.getUserParam("spring.redis.database","")?? && appPlatform.getUserParam("spring.redis.database","")!="">
<#assign redisDataBase = appPlatform.getUserParam("spring.redis.database","")>
</#if>
<#if depApp.getUserParam("portmap","")?? && depApp.getUserParam("portmap","")!="">
<#assign dockerPortMap = depApp.getUserParam("portmap","")>
<#elseif appPlatform.getUserParam("portmap","")?? && appPlatform.getUserParam("portmap","")!="">
<#assign dockerPortMap = appPlatform.getUserParam("portmap","")>
</#if>
</#if>
</#if>
<#comment>数据库配置</#comment>
<#if sysrun.getPSDBDevInst()??>
<#assign sysRunDBInst = sysrun.getPSDBDevInst()>
<#assign dbUserName=sysRunDBInst.getUserName()>
<#assign dbPassWord=sysRunDBInst.getPassword()>
<#assign dbUrl=sysRunDBInst.getConnUrl()>
<#if (sysRunDBInst.getDBType()=='MYSQL5')>
<#assign dbDriver="com.mysql.jdbc.Driver">
<#assign dbUrl=dbUrl+"&allowMultiQueries=true">
<#elseif (sysRunDBInst.getDBType()=='DB2')>
<#assign dbDriver="com.ibm.db2.jcc.DB2Driver">
<#elseif (sysRunDBInst.getDBType()=='ORACLE')>
<#assign dbDriver="oracle.jdbc.driver.OracleDriver">
<#elseif (sysRunDBInst.getDBType()=='SQLSERVER')>
<#assign dbDriver="com.microsoft.sqlserver.jdbc.SQLServerDriver">
<#elseif (sysRunDBInst.getDBType()=='POSTGRESQL')>
<#assign dbDriver="org.postgresql.Driver">
<#elseif (sysRunDBInst.getDBType()=='PPAS')>
<#assign dbDriver="com.edb.Driver">
</#if>
</#if>
version: "3.2"
services:
${pub.getCodeName()?lower_case}-app-${app.getPKGCodeName()?lower_case}:
image: registry.cn-shanghai.aliyuncs.com/ibizsys/${pub.getCodeName()?lower_case}-app-${app.getPKGCodeName()?lower_case}:latest
ports:
- "${httpPort}:${httpPort}"
<#if dockerPortMap!=''>
- "${dockerPortMap}"
</#if>
networks:
- agent_network
<#if sysrun?? && sysrun.getPSDevSlnMSDepApp()?? && sysrun.getPSDevSlnMSDepApp().getPSDCMSPlatformNode()??>
<#assign depApp=sysrun.getPSDevSlnMSDepApp()>
<#assign appPlatformNode=sysrun.getPSDevSlnMSDepApp().getPSDCMSPlatformNode()>
<#assign appPlatform=sysrun.getPSDevSlnMSDepApp().getPSDCMSPlatform()>
#logging:
# driver: loki
# options:
# loki-url: "http://172.16.240.111:3100/loki/api/v1/push"
# max-size: "50m"
# max-file: "10"
environment:
<#if appPlatformNode.getSSHIPAddr()??>
- SPRING_CLOUD_NACOS_DISCOVERY_IP=${appPlatformNode.getSSHIPAddr()}
</#if>
<#comment>系统运行参数设置,从SysRun中获取到当前部署相关信息</#comment>
- SERVER_PORT=${httpPort}
- SPRING_CLOUD_NACOS_DISCOVERY_SERVER-ADDR=${nacosUrl}
- SPRING_REDIS_HOST=${redisHost}
- SPRING_REDIS_PORT=${redisPort}
- SPRING_REDIS_DATABASE=${redisDataBase}
- SPRING_DATASOURCE_USERNAME=${dbUserName}
- SPRING_DATASOURCE_PASSWORD=${dbPassWord}
- SPRING_DATASOURCE_URL=${dbUrl}
- SPRING_DATASOURCE_DRIVER-CLASS-NAME=${dbDriver}
- SPRING_DATASOURCE_DEFAULTSCHEMA=${dbUserName}
<#comment>输出前端应用自定义参数替换标准参数</#comment>
<#if depApp.getUserParamNames()??>
<@outputUserParam depApp depApp.getUserParamNames()/>
</#if>
<#comment>输出微服务平台自定义参数替换标准参数</#comment>
<#if appPlatform.getUserParamNames()??>
<@outputUserParam appPlatform appPlatform.getUserParamNames()/>
</#if>
</#if>
deploy:
resources:
limits:
memory: 800M
reservations:
memory: 400M
mode: replicated
replicas: 1
restart_policy:
condition: on-failure
max_attempts: 3
window: 120s
volumes:
- "nfs:/app/file"
volumes:
nfs:
driver: local
driver_opts:
type: "nfs"
o: "addr=172.16.240.109,rw"
device: ":/nfs"
networks:
agent_network:
driver: overlay
attachable: true
<#comment>输出用户自定义参数</#comment>
<#macro outputUserParam paramObj paramList>
<#list paramList as param>
<#assign userParamkey=param?upper_case?replace(".","_")>
<#comment>nacos、数据库连接等信息从sysRun中获取</#comment>
<#if userParamkey!="SPRING_CLOUD_NACOS_DISCOVERY_SERVER-ADDR" && userParamkey!="SPRING_REDIS_HOST" &&
userParamkey!="SERVER_PORT" &&userParamkey!="SPRING_REDIS_PORT" &&userParamkey!="SPRING_REDIS_DATABASE"
&&userParamkey!="SPRING_DATASOURCE_USERNAME" &&userParamkey!="SPRING_DATASOURCE_PASSWORD"
&&userParamkey!="SPRING_DATASOURCE_URL" &&userParamkey!="SPRING_DATASOURCE_DRIVER-CLASS-NAME" &&userParamkey!="SPRING_DATASOURCE_DEFAULTSCHEMA">
<#comment>扩展标准配置:用户配置参数替换标准配置(application-sys.yml)</#comment>
<#if !P.exists('AppDeployUserParam',param)>
- ${userParamkey}=${paramObj.getUserParam(param,"")}
</#if>
</#if>
</#list>
</#macro>
\ No newline at end of file
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录