简体   繁体   English

Kubernetes 云提供商

[英]Kubernetes cloud provider

I'm new to Kubernetes and their is a concept I'm not sure to fully understand: Cloud Providers.我是 Kubernetes 的新手,他们是一个我不确定完全理解的概念:云提供商。

  • I have installed my Kubernetes cluster using RKE (Rancher engine).我已经使用 RKE(Rancher 引擎)安装了我的 Kubernetes 集群。
  • My cluster is set on top of rancher2.我的集群设置在rancher2之上。
  • My nodes are Virtual Machines hosted an OVH server.我的节点是托管 OVH 服务器的虚拟机。

I manage to have running applications with L7 ingresses and ClusterIP services but everytime I try to have a L4 LoadBalancer, the LoadBalancer is stuck in pending state.我设法运行具有 L7 入口和 ClusterIP 服务的应用程序,但每次我尝试使用 L4 LoadBalancer 时,LoadBalancer 都卡在挂起状态。 According to https://github.com/rancher/rancher/issues/14424 this is because I doesn't have any CloudProvider.根据https://github.com/rancher/rancher/issues/14424,这是因为我没有任何 CloudProvider。

But what is exactly the purpose of a CloudProvider?但是 CloudProvider 的目的究竟是什么? Isn't it to run Kubernetes nodes, pods, ... on the cloud?不是要在云上运行 Kubernetes 节点、pods 吗? If yes, why should I bother getting a CloudProvider if my applications are pods are already on the cloud and accessible from the outside thanks to my configuration.如果是的话,如果我的应用程序是 pods 并且由于我的配置已经在云上并且可以从外部访问,我为什么要费心去获取 CloudProvider。

So my following questions are:所以我的以下问题是:

  • What is exactly the role of a CloudProvider? CloudProvider 的角色究竟是什么?
  • Is it useful in my environment ?它在我的环境中有用吗?
  • Is it mandatory to have a CloudProvider in order to run L4 Load Balancer ?是否必须拥有 CloudProvider 才能运行 L4 Load Balancer?
  • What is the alternative to a L4 LoadBalancer ? L4 LoadBalancer 的替代品是什么?
  • Can't I have custom CloudProvider not relying on one of those listed here: https://kubernetes.io/docs/concepts/cluster-administration/cloud-providers/ ?我不能让自定义 CloudProvider 不依赖此处列出的其中之一: https ://kubernetes.io/docs/concepts/cluster-administration/cloud-providers/ 吗? Like a self-hosted CloudProvider running NGINX or something ?像运行 NGINX 的自托管 CloudProvider 之类的?

Thanks for any clarification/recommandation on this subject.感谢您对此主题的任何澄清/建议。 - ——

In case of Rancher牧场主的情况下

An external cloud provider is a kubernetes controller that runs cloud provider-specific loops required for the functioning of kubernetes.外部云提供商是一个 kubernetes 控制器,它运行 kubernetes 运行所需的特定于云提供商的循环。 These loops were originally a part of the kube-controller-manager, but they were tightly coupling the kube-controller-manager to cloud-provider specific code.这些循环最初是 kube-controller-manager 的一部分,但它们将 kube-controller-manager 与云提供商特定代码紧密耦合。 In order to free the kubernetes project of this dependency, the cloud-controller-manager was introduced.为了释放kubernetes项目的这种依赖,引入了cloud-controller-manager。

This brings us to the topic of Kubernetes Cloud Controller Manager这将我们带到了Kubernetes Cloud Controller Manager的主题

Kubernetes v1.6 introduced a new binary called cloud-controller-manager. Kubernetes v1.6 引入了一个名为 cloud-controller-manager 的新二进制文件。 cloud-controller-manager is a daemon that embeds cloud-specific control loops. cloud-controller-manager 是一个嵌入云特定控制循环的守护进程。 These cloud-specific control loops were originally in the kube-controller-manager.这些特定于云的控制循环最初位于 kube-controller-manager 中。 Since cloud providers develop and release at a different pace compared to the Kubernetes project, abstracting the provider-specific code to the cloud-controller-manager binary allows cloud vendors to evolve independently from the core Kubernetes code.由于与 Kubernetes 项目相比,云供应商以不同的速度开发和发布,将供应商特定代码抽象为云控制器管理器二进制文件允许云供应商独立于核心 Kubernetes 代码发展。

Regarding the LoadBalancer part:关于 LoadBalancer 部分:

  • There is a guide showing how to create an External Load Balancer.有一个指南显示了如何创建外部负载均衡器。 It says:它说:

You need to have a Kubernetes cluster, and the kubectl command-line tool must be configured to communicate with your cluster.您需要有一个 Kubernetes 集群,并且必须配置 kubectl 命令行工具才能与您的集群通信。

  • If you need an alternative however, you may want to use Ingress但是,如果您需要替代方案,则可能需要使用Ingress

An API object that manages external access to the services in a cluster, typically HTTP.管理对集群中服务的外部访问的 API 对象,通常是 HTTP。 Ingress can provide load balancing, SSL termination and name-based virtual hosting. Ingress 可以提供负载平衡、SSL 终止和基于名称的虚拟主机。

If you want to get a better idea of this concept than check out this SO thread .如果你想更好地了解这个概念,而不是查看这个 SO 线程

And lastly regarding the custom Cloud Provider .最后关于自定义Cloud Provider It is possible to enable a different cloud provider for RKE:可以为 RKE 启用不同的云提供商:

If you want to enable a different cloud provider, RKE allows for custom cloud provider options.如果您想启用不同的云提供商,RKE 允许自定义云提供商选项。 A name must be provided and the custom Cloud Provider options can be passed in as a multiline string in customCloudProvider .必须提供名称,并且自定义云提供商选项可以作为customCloudProvider的多行字符串customCloudProvider

I hope it helps.我希望它有帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM