简体   繁体   English

Ingress与Kubernetes服务负载平衡器有什么关系?

[英]What does Ingress have to do with Kubernetes service loadbalancer?

This is what I define in k8s.yml file: 这是我在k8s.yml文件中定义的:

apiVersion: v1
kind: Service
metadata:
  name: myservice
  namespace: mynamespace
  labels:
    app: myservice
  annotations:
    service.beta.kubernetes.io/aws-load-balancer-internal: 0.0.0.0/0
    service.beta.kubernetes.io/aws-load-balancer-cross-zone-load-balancing-enabled: "true"
    external-dns.alpha.kubernetes.io/hostname: "myservice."
spec:
  selector:
    app: myservice
  type: LoadBalancer
  ports:
  - name: http
    port: 8080
    targetPort: 8080
    protocol: TCP

Running this command: 运行此命令:

kubectl describe service myservice

gives me the "LoadBalancer Ingress" like this: 给我这样的“ LoadBalancer Ingress”:

Type: LoadBalancer IP: 类型:LoadBalancer IP:
25.0.162.225 LoadBalancer Ingress: internal-a9716e......us-west-2.elb.amazonaws.com 25.0.162.225 LoadBalancer入口:internal-a9716e ...... us-west-2.elb.amazonaws.com

As I understand, the publishing type I'm using is "LoadBalancer" which helps me expose my Service to external IP address (refer https://kubernetes.io/docs/concepts/services-networking/connect-applications-service/ ). 据我了解,我正在使用的发布类型是“ LoadBalancer”,它可以帮助我将我的服务公开到外部IP地址(请参阅https://kubernetes.io/docs/concepts/services-networking/connect-applications-service/ ) 。 And the Ingress is a different thing which sits in front of the Services and I didn't define it in my yml file. 而Ingress是位于Services前面的另一回事,我没有在yml文件中定义它。 (refer: https://medium.com/google-cloud/kubernetes-nodeport-vs-loadbalancer-vs-ingress-when-should-i-use-what-922f010849e0 ) With the "LoadBalancer Ingress" I'm able to access my Service from outside the cluster, but I don't understand why it's called "LoadBalancer Ingress"? (请参阅: https : //medium.com/google-cloud/kubernetes-nodeport-vs-loadbalancer-vs-ingress-when-should-i-use-what-922f010849e0 )通过“ LoadBalancer Ingress”,我能够从群集外部访问我的服务,但我不明白为什么将其称为“ LoadBalancer Ingress”? What does it have to do with Ingress? 它与Ingress有什么关系? Or is it true that every load balancer is equipped with an Ingress for the Service exposing purpose? 还是为每个负载均衡器都配备了一个用于服务公开目的的Ingress?

Ingress is an abstract definition of what to expose and how. 入口是公开内容和方式的抽象定义。 Usually refers to HTTP(S) traffic, but with some fiddling can also other modes/protocols.. 通常指的是HTTP(S)流量,但有些模式也可能使其他模式/协议陷入困境。

Ingress Controller is a particular implementation that will realize your Ingress defined expectations using a specific piece of software. Ingress Controller是一种特定的实现,它将使用特定的软件来实现您Ingress定义的期望。 Be it Nginx, Traefik or some other solution, potentially dedicated to particular cloud provider. 无论是Nginx,Traefik还是其他可能专用于特定云提供商的解决方案。

They will use Service objects as means of finding what are the endpoints to use for specific traffing that reached them. 他们将使用Service对象作为找到要用于到达它们的特定流量的终结点的手段。 It's of no consequence if this is headless , ClusterIP , NodePort or LoadBalancer type of service. 这是headlessClusterIPNodePortLoadBalancer类型的服务都没有关系。

That said, LoadBalancer type service exposes your service on a, surprise, loadbalancer. 就是说, LoadBalancer类型的服务在令人惊讶的负载均衡器上公开了您的服务。 Again, usually related to your cloud provider. 同样,通常与您的云提供商有关。 It's a completely different way of exposing your service, as is NodePort type. NodePort类型一样,这是一种完全不同的公开服务的方式。

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

相关问题 Kubernetes:我何时必须使用Ingress + ClusterIP选择上面类型的loadbalancer服务? - Kubernetes: When do I have to choose a service of type loadbalancer above using ingress + ClusterIP? Kubernetes入口服务应该是LoadBalancer或NodePort - Kubernetes ingress service should be LoadBalancer or NodePort kubernetes 负载均衡器服务 - 无法设置入口 ip - kubernetes loadbalancer service - unable to set ingress ip 将 kubernetes 服务从负载均衡器移动到入口 - Moving a kubernetes service from Loadbalancer to Ingress Kubernetes中的负载均衡器是什么,为什么像GKE这样不同的Kubernetes引擎有自己的负载均衡器 - What is a loadbalancer in Kubernetes, Why do different Kubernetes engines like GKE have their own loadbalancer Kubernetes Ingress 不适用于 LoadBalancer 类型的服务(HTTP 1.0 客户端不支持分块响应) - Kubernetes Ingress doesn't work with a Service of type LoadBalancer (HTTP 1.0 client does not support chunked response) Kubernetes:负载均衡器和入口 - Kubernetes: loadbalancer and ingress Kubernetes 入口负载均衡器 IP - Kubernetes Ingress Loadbalancer IP 入口规则不适用于LoadBalancer类型的服务 - Ingress rule does not work with Service of type LoadBalancer kubernetes(GKE)Nginx服务(具有类型loadbalancer)vs入口 - kubernetes(GKE) nginx service(with type loadbalancer) vs ingress
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM