入口服务类型 [英] Ingress service type

查看:95
本文介绍了入口服务类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我了解Ingress的原理,以及如何通过将Ingress资源提供给Ingress控制器将其路由到服务.

I understand the principle of Ingress, how it routes to services by feeding an Ingress resource to the Ingress controller.

我将Docker for mac与以下Ingress控制器一起使用:

I use Docker for mac with the following Ingress controller: https://github.com/kubernetes/ingress-nginx/blob/master/docs/deploy/index.md#docker-for-mac

我只不太了解一件事,那就是您应该使用哪种类型的服务.

There is just one thing I don't quite understand, and that is what type of service you are supposed to use.

是否可以像使用常规负载均衡器服务那样使用副本集,是否应该在完全忽略服务资源中的"spec/type"属性的同时提供种类""service"的资源?

Is it ok to use replica sets as you would do with regular load balancer services, and should you provide a resource of 'Kind' 'service' while omitting the 'spec/type' attribute in the service resource altogether?

推荐答案

对于您的应用程序,请使用ClusterIP类型的服务,就像使用群集内部服务一样.这是因为它们现在是内部的,只有入口控制器是外部的.请参见 https://kubernetes.io/docs/concepts/services-networking/入口/

For your apps use a Service of type ClusterIP as you would for a cluster-internal Service. This is because they are now internal and it is only the ingress controller which is external. See examples in https://kubernetes.io/docs/concepts/services-networking/ingress/

对于Ingress控制器本身,您通常使用LoadBalancer,但是您可以选择如何在外部公开自己的Ingress控制器.您可以使用适合您群集的NodePort(例如,本地).在Mac的docker示例中,入口控制器为LoadBalancer类型-适用于Mac(Edge)的Docker-Kubernetes-LoadBalancer

For the Ingress controller itself you typically use LoadBalancer but it is your choice how you expose themselves ingress controller externally. You can use NodePort if that suits your cluster (e.g. it is on-prem). In that docker for Mac example the ingress controller is LoadBalancer type - https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/provider/cloud-generic.yaml This is typically used for cloud providers but docker for Mac supports it - Docker for Mac(Edge) - Kubernetes - LoadBalancer

这篇关于入口服务类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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