# 04-Gateway 部署 ## 说明 部署 Gateway 网关服务,作为系统的统一入口。 ## 部署流程 1. **复制 jar 文件** - 复制编译好的 jar 到 docker 目录 2. **构建镜像** - 使用 docker-compose 构建 Gateway 镜像 3. **导入镜像** - 如果是 Minikube 环境,自动导入镜像 4. **部署到 K8s** - 部署 Service 和 Deployment 5. **等待启动** - 等待 Pod 就绪 ## 配置说明 - **Service 名称**: ruoyi-gateway - **端口**: 8080 - **NodePort**: 30080(外部访问端口) - **镜像**: gateway-runtime ## 文件说明 - `service.yaml` - Gateway Service 配置(NodePort) - `deployment.yaml` - Gateway Deployment 配置 - `deploy.sh` - 一键部署脚本 ## 部署步骤 ```bash # 进入目录 cd 04-gateway # 执行部署脚本 ./deploy.sh ``` ## 访问 ```bash # 通过 NodePort 访问 http://localhost:30080 ```