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>
相关推荐
2301_7703737336 分钟前
Java集合
java·开发语言
哈喽姥爷44 分钟前
Spring Boot---自动配置原理和自定义Starter
java·spring boot·后端·自定义starter·自动配置原理
老华带你飞3 小时前
考研论坛平台|考研论坛小程序系统|基于java和微信小程序的考研论坛平台小程序设计与实现(源码+数据库+文档)
java·vue.js·spring boot·考研·小程序·毕设·考研论坛平台小程序
_Walli_3 小时前
k8s集群搭建(三)-------- Dashboard UI
云原生·容器·kubernetes
CHEN5_023 小时前
leetcode-hot100 11.盛水最多容器
java·算法·leetcode
songx_993 小时前
leetcode18(无重复字符的最长子串)
java·算法·leetcode
在路上`4 小时前
前端学习之后端java小白(三)-sql外键约束一对多
java·前端·学习
dazhong20124 小时前
Spring Boot 项目新增 Module 完整指南
java·spring boot·后端
xrkhy4 小时前
SpringBoot之日志处理(logback和AOP记录操作日志)
java·spring boot·logback
搬山境KL攻城狮4 小时前
MacBook logback日志输出到绝对路径
java·intellij-idea·logback