|
| 1 | +--- |
| 2 | +layout: post |
| 3 | +title: weathermap |
| 4 | +pid: 445 |
| 5 | +tags: [servicestage, k8s, 微服务] |
| 6 | +--- |
| 7 | + |
| 8 | +# 创建后台应用构建任务 |
| 9 | + |
| 10 | ++ 登录ServiceStage,选择“持续交付 > 构建”,单击“基于源码构建”。 |
| 11 | ++ 基本信息 |
| 12 | + + 名称: weathermap |
| 13 | + + 源代码来源: Github |
| 14 | + + 命名空间:baoguoding |
| 15 | + + 仓库名称:weathermap |
| 16 | + + 分支:master |
| 17 | + + 构建集群 |
| 18 | + + 构建集群:cce-demoxxxxxx |
| 19 | ++ 环境配置 |
| 20 | + + 编译 |
| 21 | + + Maven |
| 22 | + + 任务名称:Maven-bjbr78 |
| 23 | + + POM文件目录:./ |
| 24 | + + Goals & Options:clean package |
| 25 | + + JDK版本:JDK8 |
| 26 | + + Docker |
| 27 | + + Dockerfile地址:./weather-beta/ |
| 28 | + + 镜像名称:weather-beta |
| 29 | + + Docker |
| 30 | + + Dockerfile地址:./weather/ |
| 31 | + + 镜像名称:weather |
| 32 | + + Docker |
| 33 | + + Dockerfile地址:./forecast/ |
| 34 | + + 镜像名称:forecast |
| 35 | + + Docker |
| 36 | + + Dockerfile地址:./fusionweather/ |
| 37 | + + 镜像名称:fusionweather |
| 38 | + + 归档 |
| 39 | + + 将上面的编译,归档 |
| 40 | ++ 构建完成后,结果如下图 |
| 41 | + |
| 42 | + |
| 43 | + |
| 44 | + |
| 45 | + |
| 46 | +# 创建前台应用构建任务 |
| 47 | ++ 登录ServiceStage,选择“持续交付 > 构建”,单击“基于源码构建”。 |
| 48 | ++ 基本信息 |
| 49 | + + 名称: weathermapweb |
| 50 | + + 源代码来源: Github |
| 51 | + + 命名空间:baoguoding |
| 52 | + + 仓库名称:weathermap |
| 53 | + + 分支:master |
| 54 | + + 构建集群 |
| 55 | + + 构建集群:cce-demoxxxxxx |
| 56 | ++ 环境配置 |
| 57 | + + 编译 |
| 58 | + + Docker |
| 59 | + + Dockerfile地址:./weathermapweb/ |
| 60 | + + 镜像名称:weathermapweb |
| 61 | + + 镜像版本:latest |
| 62 | + + 归档 |
| 63 | + + 将上面的编译,归档 |
| 64 | ++ 构建完成后,结果如上图 |
| 65 | + |
| 66 | +# 创建后台应用 |
| 67 | + |
| 68 | ++ 选择“应用管理 > 应用列表”,单击“创建应用”。 |
| 69 | ++ 选择“ServiceComb应用”,然后单击“创建应用”。 |
| 70 | ++ 基本信息 |
| 71 | + + 运行环境: Docker |
| 72 | + + 实例数量: 1 |
| 73 | + |
| 74 | +<table> |
| 75 | +<tr><th>应用名称</th><th>选择镜像</th><th>环境变量</th><th>TCP/UDP路由配置</th></tr> |
| 76 | +<tr><td>weather</td><td>weather</td><td>否</td><td>否</td></tr> |
| 77 | +<tr><td>weather-beta</td><td>weather-beta</td><td>否</td><td>否</td></tr> |
| 78 | +<tr><td>forecast</td><td>forecast</td><td>否</td><td>否</td></tr> |
| 79 | +<tr><td>fusionweather</td><td>fusionweather</td><td>否</td> |
| 80 | +<td> |
| 81 | +应用创建成功后,在“应用列表”页单击“fusionweather”,进入应用详情页。 |
| 82 | + |
| 83 | +选择“访问方式”页签。 |
| 84 | + |
| 85 | ++ 单击“TCP/UDP路由配置”区域的“添加服务”。 |
| 86 | ++ “服务名称”建议填写fusion。 |
| 87 | ++ “访问方式”选择“集群内访问”。 |
| 88 | ++ “协议”选择TCP。 |
| 89 | ++ “容器端口”填写13092。 |
| 90 | ++ “访问端口”请自行填写,但请保证该端口未被占用,建议与容器端口相同。 |
| 91 | + |
| 92 | +</td></tr> |
| 93 | +</table> |
| 94 | + |
| 95 | + |
| 96 | + |
| 97 | +# 创建前台应用 |
| 98 | + |
| 99 | ++ 选择“应用管理 > 应用列表”,单击“创建应用”。 |
| 100 | ++ 选择“Mesher”,然后单击“创建应用”。 |
| 101 | ++ 基本信息 |
| 102 | + + 运行环境: Docker |
| 103 | + + 实例数量: 1 |
| 104 | + |
| 105 | +<table> |
| 106 | +<tr><th>应用名称</th><th>选择镜像</th><th>环境变量</th><th>TCP/UDP路由配置</th></tr> |
| 107 | +<tr><td>weathermapweb</td><td>weathermapweb</td><td> |
| 108 | + |
| 109 | ++ HTTP_PROXY_PORT: 30101 |
| 110 | ++ SERVICE_ADDR: fusionweather |
| 111 | + |
| 112 | + |
| 113 | +</td><td>否</td></tr> |
| 114 | +</table> |
| 115 | + |
| 116 | ++ 应用创建成功后,在“应用列表”页单击“weathermapweb”。 进入应用详情页。 |
| 117 | ++ 选择“访问方式”页签。 |
| 118 | + + 单击“TCP/UDP路由配置”区域的“添加服务”。 |
| 119 | + + “服务名称”建议填写weathermapweb。 |
| 120 | + + “访问方式”选择“公网访问”。 |
| 121 | + + “访问类型”选择“弹性IP”。 |
| 122 | + + “协议”选择TCP。 |
| 123 | + + “容器端口”填写3000。 |
| 124 | + + “访问端口”请自行填写,但请保证该端口未被占用。 |
| 125 | + |
| 126 | + |
| 127 | + |
| 128 | +# 访问应用 |
| 129 | + |
| 130 | ++ 选择“应用管理 > 应用列表”。 |
| 131 | ++ 在应用列表中找到weathermapweb应用,并单击其名称进入详细信息页面。 |
| 132 | ++ 在详细信息页单击访问地址。 |
| 133 | + |
| 134 | + |
| 135 | + |
| 136 | + |
| 137 | + |
| 138 | +# 参考 |
| 139 | + |
| 140 | ++ [容器部署weathermap](https://support.huaweicloud.com/bestpractice-servicestage/servicestage_bestpractice_0031.html) |
0 commit comments