usb物理端点和逻辑端点_kubernetes端点反对您通往外部服务的桥梁

usb物理端点和逻辑端点

Being an active kubernetes user for the last 3 years, I practically learned an old concept in a new way. It's very likely that being a k8s user you haven’t paid attention to or never know what an endpoint object is, however under the covers, you have been using it, full guarantee :)

作为过去三年的活跃kubernetes用户,我几乎以一种新的方式学习了一个旧概念。 作为k8s用户,您很可能没有注意过或永远不知道端点对象是什么,但是在幕后,您一直在使用它,完全可以保证:)

One liner explanation to 2 key concepts of kubernetes

一种对kubernetes的2个关键概念的线性解释

What is a Service in k8sA service is a k8s object that exposes an application running in one or many pods as a “network service”

什么是k8s中的服务服务是k8s对象,它将在一个或多个Pod中运行的应用程序公开为“网络服务”

What is an Endpoint in k8sAn Endpoint is a k8s object that lists all the addresses (IP addresses and Ports) that are used by a service

什么是k8s中的端点端点是k8s对象,列出了服务使用的所有地址(IP地址和端口)

Summary: For every Service Object, there is a corresponding Endpoint object, and its created automagically by the Service object.

简介:对于每个服务对象,都有一个对应的端点对象,该对象由服务对象自动创建。

Image for post

K8s端点对象的独特用例 (A unique use-case for K8s Endpoint Object)

If you are using k8s in production, then most likely it's not “The Only” infrastructure/application layer on which your business run. For example :

如果您在生产中使用k8,则很可能不是业务运行所在的“唯一”基础架构/应用程序层。 例如 :

  • If your business runs on public cloud, then very likely you will be using a combination of k8s and non-k8s services. Example k8s for cloud-native apps and externally managed DB services such as RDS, Cloud SQL, etc

    如果您的企业在公共云上运行,那么很有可能您将同时使用k8s和非k8s服务。 适用于云原生应用程序和外部管理的数据库服务(例如RDS,Cloud SQL等)的示例k8
  • If your business runs on-premise, then you might have k8s for modern applications, while VMware, OpenStack, HyperV, RHEV, etc for other traditional applications.

    如果您的企业在内部运行,那么您可能需要k8来安装现代应用程序,而使用VMware,OpenStack,HyperV,RHEV等来安装其他传统应用程序。

So how can you connect your cloud-native apps running in k8s to external services

那么如何将运行在k8s中的云原生应用程序连接到外部服务

Image for post

端点方式 (The Endpoint Way)

Simple answer, you can create a kubernetes Endpoint object by providing the IP addresses and port number of your external (non-k8s) services. And later create a kubernetes service using that endpoint.

简单的答案是,您可以通过提供外部(非k8s)服务的IP地址和端口号来创建kubernetes端点对象。 然后使用该端点创建一个kubernetes服务。

Image for post

实际用例和实现 (Practical use-case and Implementation)

In my setup, I have been running Red Hat Ceph Object Storage (Ceph) with 12 RadosGateway services, which means I had a total of 12 RGW endpoints (for performance and high availability reasons). Ceph was running external to kubernetes.

在我的设置中,我一直在运行具有12个RadosGateway服务的Red Hat Ceph对象存储(Ceph),这意味着我总共有12个RGW端点(出于性能和高可用性的原因)。 Ceph在kubernetes外部运行。

In order for my apps (Presto, Spark, and Juypter) (running inside kubernetes) to access the Ceph Object Storage service, there has to be a single, reliable endpoint which the apps should connect to and access storage over the network.

为了使我的应用程序(Presto,Spark和Juypter)(在kubernetes中运行)访问Ceph对象存储服务,必须有一个可靠的端点,应用程序应连接到该端点并通过网络访问存储。

So I created a k8s Endpoint object with all 12 Ceph RadosGW endpoints and later created a k8s service using that k8s endpoint. This allowed me to have a k8s native single, reliable, and auto load-balanced endpoint for my Ceph object storage service.

因此,我创建了具有所有12个Ceph RadosGW端点的k8s端点对象,然后使用该k8s端点创建了k8s服务。 这使我能够为我的Ceph对象存储服务提供一个k8s本机单一,可靠且自动负载平衡的端点。

Image for post

For the sake of argument, I can definitely throw an SW or HW load balancer outside k8s and terminate all my 12 Ceph RGWs there. This approach should have worked as well but comes with some limitations such as 1) the LB would have been a SPOF, 2) delivers a limited performance 3) 1 extra hop to access storage.

为了论证,我绝对可以在k8s之外放置一个SW或HW负载均衡器,并在那里终止所有12个Ceph RGW。 这种方法本来应该也行得通,但存在一些局限性,例如1)LB本来是SPOF; 2)性能有限; 3)额外一跳访问存储。

摘要 (Summary)

I found the k8s Endpoint object approach to be very useful, simple, and k8s native. I am definitely gonna use this for accessing other external services, maybe DB running outside k8s.

我发现k8s端点对象方法非常有用,简单并且是k8s本机的。 我绝对会用它来访问其他外部服务,也许是在k8s外部运行的DB。

翻译自: https://medium.com/@karansingh010/kubernetes-endpoint-object-your-bridge-to-external-services-3fc48263b776

usb物理端点和逻辑端点

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值