跨api端点的路由名称 [英] Route name across api end points

查看:76
本文介绍了跨api端点的路由名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有两个端点,分别具有各自的组织和空间

We have below two end points, having their respective Organization and Space

1)开发环境:
abcorg.cloud

2)概念证明环境(POC): abcpoc.io

2) Proof of Concept environment(POC): a.b.c.poc.io

有一个应用程序( my-cool-app )路径名称 my-cool-app.abcpoc.io 在POC环境中运行。

There is an app(my-cool-app) with route name my-cool-app.a.b.c.poc.io running in POC environment.

由于代码异味在此应用中,路由名称由应用源代码(硬编码)决定,但不是通过 cf push manifest.yml 确定的>。这导致在Dev中为 my-cool-app 使用相同的路由名称 my-cool-app.abcpoc.io

Due to code smell issue in this app, route name is decided by app source code(hard coded) but not through manifest.yml of cf push. This lead to same route name my-cool-app.a.b.c.poc.io for my-cool-app in Dev environment.

1)应用能否具有相同的路由名称 my-cool-app.abcpoc .io 在开发环境中( abcorg.cloud )?因为我们看到此错误 org.cloudfoundry.client.v2.ClientV2Exception:CF-InvalidRelation(1002):无法将应用程序映射到此路由,因为该路由不在此空间中。应用程序必须映射到相同空间中的路由。 cf推送

1) Can app have same route name my-cool-app.a.b.c.poc.io in dev environment(a.b.c.org.cloud)? Because we see this error org.cloudfoundry.client.v2.ClientV2Exception: CF-InvalidRelation(1002): The app cannot be mapped to this route because the route is not in this space. Apps must be mapped to routes in the same space. after cf push

2之后)
Dev和POC环境是否具有相同的云控制器数据库(CCDB)?因为CCDB维护应用名称与路由名称的绑定

2) Does Dev and POC environment have same cloud controller database(CCDB)? Because CCDB maintains binding of app name with routename

推荐答案


1)应用可以具有相同的路由名称吗开发环境(abcorg.cloud)中的-cool-app.abcpoc.io?

1) Can app have same route name my-cool-app.a.b.c.poc.io in dev environment(a.b.c.org.cloud)?

这取决于您所说的 dev和 poc环境。如果它们是完全独立的基础,那么可以。它应该工作。您只需使用DNS即可控制实际流量的路由位置。

It depends on what you mean by "dev" and "poc" environments. If they are totally separate foundations, then yes. It should work. You just use DNS to control where actual traffic is routed.

如果他们共享同一个云控制器,例如您拥有一个 dev和 poc组织,则它可以工作,但有限制。您可以将同一条路线映射到两个不同的应用程序,但它们必须位于同一空间中。这就是这个错误的意思。

If they are sharing the same cloud controller, like you have a "dev" and "poc" org, then it works but with restrictions. You can map the same route to two different apps, but they have to be in the same space. That's what this error is saying.


该应用程序无法映射到此路线,因为该路线不在此空间中。应用程序必须映射到同一空间中的路由。

The app cannot be mapped to this route because the route is not in this space. Apps must be mapped to routes in the same space.

如果将同一条路由映射到两个不同的应用程序,那么有效这样做是在两个应用50/50之间分配流量。如果Cloud Controller允许跨组织&空格,那么您可以在不同的组织&中找到某人能够将流量从您的应用转移到另一个应用(可能是恶意应用)的空间,这将是一个很大的安全问题。鉴于此,Cloud Controller禁止这样做。

If you map the same route to two different apps, what you're effectively doing is splitting traffic across the two apps 50/50. If Cloud Controller were to allow this across orgs & spaces then you could have someone in a different org & space that is able to divert traffic from your app to another app, potentially malicious app, which would be a big security problem. Given this, Cloud Controller prevents that from being allowed.


2)Dev和POC环境是否具有相同的云控制器数据库(CCDB)?因为CCDB维护应用程序名称与路由名称的绑定

2) Does Dev and POC environment have same cloud controller database(CCDB)? Because CCDB maintains binding of app name with routename

这听起来像您的环境,但这不是严格的要求。您可以有两个完全独立的基础,一个用于Dev,一个用于POC,它们不共享任何东西。

It sounds like your environments do, but that's not a strict requirement. You could have two totally separate foundations, one for Dev and one for POC, which do not share anything.

这篇关于跨api端点的路由名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆