SCG K8S(Spring Cloud Gateway Kubernetes)一直报503错误

项目需要在Kubernetes上使用SCG,参照网上的教程 spring-cloud-kubernetes与SpringCloud Gateway 做了网关应用,可以正常工作。但我们项目是基于Springboot3.x 的,而原来的教程是基于Springboot 2.x的,升级后发现一直没法发现服务,报503 Service Not Available的异常。查阅了Spring官方文档,估计是原来的依赖不对,改了一下依赖,终于正常了。

正常的依赖如下:

xml 复制代码
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-gateway</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-actuator</artifactId>
        </dependency>
        <dependency>
            <groupId>com.alibaba.cloud</groupId>
            <artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-kubernetes-fabric8</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-loadbalancer</artifactId>
        </dependency>
相关推荐
漫随流水1 天前
IDEA快速生成构造方法(空参、带参)
java·intellij-idea
spencer_tseng1 天前
Spring Boot 3.0+ jakarta.*
java·spring boot
Bat U1 天前
JavaEE|文件操作和IO
java·开发语言
DavidSoCool1 天前
Spring AI Alibaba ReactAgent 调用Tool 实现多轮对话
java·人工智能·spring·多轮对话·reactagent
江湖有缘1 天前
从零开始:基于Docker Compose的Kener监控面板部署全记录
运维·docker·容器
月光技术杂谈1 天前
国内环境下安装 docker-ce 的完整步骤
运维·docker·容器
神所夸赞的夏天1 天前
如何获取多层json数据,存成dictionary,并取最大最小值
java·前端·json
9号达人1 天前
为什么你应该在 MQ 里用多个消费者,而不是一个
java·后端·架构
焦糖玛奇朵婷1 天前
健身房预约小程序开发、设计
java·大数据·服务器·前端·小程序
小新同学^O^1 天前
简单学习 --> TCP协议
java·网络·tcp