Kong关键概念 - Upstreams

Upstream是指Kong Gateway转发请求到的API、应用程序或微服务。在Kong Gateway中,Upstream 对象代表了一个虚拟主机名,并可以用于对多个服务进行健康检查、断路器和负载均衡。

Upstream 和 service 交互

您可以将服务配置为指向一个Upstream,而不是一个主机。例如,如果您有一个名为example_service的服务和一个名为example_upstream的Upstream,您可以将example_service指向example_upstream,而不是指定一个主机。example_upstream Upstream可以指向两个不同的目标:httpbin.org和httpbun.com。在实际环境中,Upstream指向在多个系统上运行的相同服务。

通过这种设置,您可以在Upstream目标之间进行负载均衡。例如,如果应用程序部署在两个不同的服务器或Upstream目标上,Kong Gateway需要在这两个服务器之间进行负载均衡。这样,如果其中一个服务器(如前面示例中的httpbin.org)不可用,它会自动检测到问题,并将所有流量路由到正常工作的服务器(httpbun.com)。

Upstream 配置

您可以使用以下方法将Upstream添加到Kong Gateway的服务中:

  • 使用Kong Manager
  • 使用Admin API
  • 使用decK(YAML)
相关推荐
0***K8921 天前
后端服务网格配置,Istio Gateway
云原生·gateway·istio
n***26561 天前
Nginx反向代理出现502 Bad Gateway问题的解决方案
运维·nginx·gateway
q***31892 天前
当遇到 502 错误(Bad Gateway)怎么办
gateway
脸大是真的好~2 天前
尚硅谷 SpringCloud05 Gateway-断言-过滤器-跨域CORS
gateway
袁洛施2 天前
Claude Code API Gateway 配置指南
gateway
百***24132 天前
Nginx反向代理出现502 Bad Gateway问题的解决方案
运维·nginx·gateway
小坏讲微服务2 天前
整合Spring Cloud Alibaba与Gateway实现跨域的解决方案
java·开发语言·后端·spring cloud·云原生·gateway
angushine3 天前
SpringCloud Gateway缓存body参数引发的问题
spring cloud·缓存·gateway
没有bug.的程序员4 天前
Spring Cloud Gateway 性能优化与限流设计
java·spring boot·spring·nacos·性能优化·gateway·springcloud
小坏讲微服务4 天前
Spring Cloud Alibaba Gateway 集成 Redis 限流的完整配置
数据库·redis·分布式·后端·spring cloud·架构·gateway