traefik-gateway-dashboard
本文为dashboard用法,基础用法请参考:traefik-gateway
三个镜像
traefik: swr.cn-south-1.myhuaweicloud.com/vp-whdev/all-in-devops/traefik:20230516
内置插件:rewritebody
- 内置插件:rewriteHeaders
动态服务发现: swr.cn-south-1.myhuaweicloud.com/vp-whdev/all-in-devops/traefik-service-discovery:20230526
UI:swr.cn-south-1.myhuaweicloud.com/vp-whdev/all-in-devops/traefik-service-discovery-dashboard-front:stage
安装部署说明
- 部署:
swr.cn-south-1.myhuaweicloud.com/vp-whdev/all-in-devops/traefik:20230516traefik
80,http端口
443,https端口
8080,traefik自带的dashboard端口,可以不开放
80,http端口443,https端口8080,traefik自带d dashboard部署traefik-service-discovery
# 服务名必须为 traefik-service-discovery
# 端口开发8080,非必须
# 环境变量
spring.profiles.active = mysqlProd
# mysqlProd,使用mysql数据库,prod,使用sqlite数据库
app.datasource.host =
app.datasource.nam e=
app.datasource.password =
app.datasource.username =
- 数据库初始化脚本
CREATE TABLE `traefik_gateway_config` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键id',
`route_name` varchar(255) DEFAULT NULL COMMENT '路由名称',
`access_path` varchar(255) DEFAULT NULL COMMENT '访问路径',
`service_type` int(2) DEFAULT NULL COMMENT '后端服务类型: 1:http 2:tcp 3:udp',
`service_address` varchar(255) DEFAULT NULL COMMENT '后端服务地址',
`middleware` text COMMENT '中间件',
`status` int(255) DEFAULT NULL COMMENT '启用/禁用状态: 0:禁用 1:启用',
`deleted` int(255) DEFAULT '0' COMMENT '删除状态: 0:不删除 1:删除',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='网关配置';
CREATE TABLE `global_middleware` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键id',
`global_middleware` longtext COMMENT '全局中间件',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='全局中间件';
- traefik-service-discovery-dashboard-fron
# 端口开放:80
# 访问路径/front/