用户在Cloud Foundry中提供的服务 [英] User provided service in cloud foundry

查看:87
本文介绍了用户在Cloud Foundry中提供的服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我阅读了有关用户提供的服务的Cloud Foundry文档,但不确定是否获得了它以及如何真正使用它。

I read cloud foundry docs about user provided service but not sure that I got it and how really to use it.

> 1. my question is what is the use case for it?

(我了解该服务在市场上不可用...)

(I understand that the service is not available in the market place...)

> 2.when it recommended to use it and when not ?
>  
> 3. There is some real world example for it which I can use to create, I mean some  E2E guide ?


推荐答案



  1. 我的问题是用例是什么?


这基本上是一个陷阱,所有。它旨在处理您环境中服务代理无法涵盖的所有问题。

It's basically a catch-all. It's meant to handle anything that's not covered by a service broker in your environment. Plus it gives you the additional flexibility for passing info to your apps.


2。何时建议使用它以及何时不使用它?

2.when it recommended to use it and when not ?

如果您有服务经纪人,请使用它。服务代理对于CF开发人员来说更易于使用,它们还可以提供其他元数据,例如标签和标签,您无法使用用户提供的服务进行设置。额外的元数据使应用程序可以更容易地检测和处理服务。

If you have a service broker available use it. Service brokers are easier for CF developers to use, and they can also provide additional metadata like labels and tags that you cannot set with a user provided service. This additional metadata makes it easier for applications to detect and handle the services.

例如:如果您的应用程序正在寻找绑定的MySQL服务(例如,搜索所有绑定的服务以获取特定类型的服务),则通常需要查看&标签以通用方式找到它。如果绑定用户提供的服务,则不会获得此信息,因此您必须查看服务数据(即是否有URL,它的外观等)或与名称匹配的模式才能进行区分。

Ex: If your application is looking for a bound MySQL service (i.e. searching through all bound services for a particular type of service), you would typically look at the label & tags to find it in a generic way. If you bind a user provided service, you don't get this information so you have to look at the service data (i.e. is there a URL, what does it look like, etc.) or pattern match the name to make the distinction.



  1. 有一些我可以用来创建的真实示例,我意味着一些E2E指南?


使用用户提供的服务最简单,最常见的情况是绑定没有可用服务代理的服务。这可能是您创建的自定义服务,也可能只是CF安装/提供程序不支持的服务。

The simplest and most common case for using a user provided service is to bind a service for which there is no available service broker. This might be a custom service you created or maybe just something not supported by the CF installation / provider.

因为用户提供的服务是将数据绑定到应用的通用机制您也可以将其用于其他用途。

Because user provided services are a generic mechanism to bind data to an app you can use it for other things too.

例如:


  1. Service instances are scoped to an org & space. If you want to share a service from one org & space to a different org & space, you can create a user provided service in the second org & space passing in the credentials from the first org & space.

将应用程序转换为服务。也许您已经在PCF上将微服务部署为应用程序。如果您希望其他应用程序使用您的微服务,则可以创建用户提供的服务,并将您的微服务的URL传递给使用中的应用。当然,您也可以使用其他方法,但这是在CF上实现它的一种非常简单的方法。

Turning an application into a service. Perhaps you have a micro service deployed as an app on PCF. If you want another app to use your micro service, you can create a user provided service and pass the URL for your micro service to the consuming app. Sure, you can do this other ways too, but this is a really simple way to implement it on CF.

将任何数据传递到多个应用程序。假设您有一个关键或通用设置要传递给已在CF上部署的10个应用。您可以通过为所有10个应用程序设置相同的env变量来执行此操作,或者可以将数据放入服务并将该服务绑定到所有10个应用程序。这样可以更轻松地更改数据(更新一项服务与10个应用程序),并且扩展性更好(可以考虑更新100个应用程序的环境变量)。

Passing any data to multiple apps. Let's say you have a key or common setting that you want to pass to 10 apps you have deployed on CF. You could do this by setting the same env variable for all 10 of your apps, or instead you could put the data into a service and bind the service to all 10 of your apps. This makes changing the data easier (update one service vs 10 apps) and it scales better (think of updating env variables for 100 apps).

我敢肯定还有其他用例。关键是它们是CF的灵活组成部分,可用于跨应用共享数据。

I'm sure there are other use cases too. The point is that they are a flexible part of CF that you can use to share data across your apps.

这篇关于用户在Cloud Foundry中提供的服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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