Kubernetes Ingress Controller的Nginx多种实现(翻译)

 

原创 云计算技术栈  https://mp.weixin.qq.com/s/bOuZI6KC92NBC3SOgDFQDg

 

在使用K8S的Ingress的时候需要我们自己来选择一个或者多个要使用的Ingress Controller。最常用的就是基于Nginx的Ingress控制器。但是很多人不清楚基于Nginx的控制器不止一种,而且使用上也是有不一致的。这就有必要在使用和遇到问题查阅文档、资料的时候知道自己用的是哪一个。查找的资料是不是对应的自己使用的Ingress 控制器实现。这就有了本篇翻译,希望可以让大家少走弯路。

 


 

背景

 

常见的两种基于Nginx的Ingress Controller实现:

  1. kubernetes/ingress-nginx

  2. nginxinc/kubernetes-ingress

NOTE:1 为kubernetes社区维护的版本 NOTE:再次强调,在查阅资料的时候一定注意是否是自己使用的Ingress Controller对应的文档

 


判断自己使用的是哪个版本

 

可以通过检查自己的Ingress Controller使用的Docker镜像来区分。nginxinc/kubernetes-ingress Ingress控制器的Docker镜像在 DockerHub上就存在,名字是nginx/nginx-ingress.

 

不同Ingress 控制器的主要差别

 

下面的表格列举了不同版本的Ingress 控制器之间的差别。这里之所以出现了三种是因为基于Nginx商业版的nginx plus也有自己的一些特性。所以也一并列举了。

 

功能/特征kubernetes/ingress-nginxnginxinc/kubernetes-ingress with NGINXnginxinc/kubernetes-ingress with NGINX Plus
基本信息   

维护者

Kubernetes communityNGINX Inc and communityNGINX Inc and community
NGINX versionCustom NGINX build that includes several third-party modulesNGINX official mainline buildNGINX Plus
商业支持N/AN/AIncluded
Ingress实例的LB相关设置   
Merging Ingress rules with the same hostSupportedSupported via Mergeable IngressesSupported via Mergeable Ingresses
HTTP load balancing extensions - AnnotationsSee the supported annotationsSee the supported annotationsSee the supported annotations
HTTP load balancing extensions -- ConfigMapSee the supported ConfigMap keysSee the supported ConfigMap keysSee the supported ConfigMap keys
TCP/UDPSupported via a ConfigMapSupported via a ConfigMap with native NGINX configurationSupported via a ConfigMap with native NGINX configuration
WebsocketSupportedSupported via an annotationSupported via an annotation
TCP SSL PassthroughSupported via a ConfigMapNot supportedNot supported
JWT validationNot supportedNot supportedSupported
Session persistenceSupported via a third-party moduleNot supportedSupported
Canary testing (by header, cookie, weight)Supported via annotationsSupported via custom resourcesSupported via custom resources
Configuration templates *1See the templateSee the templatesSee the templates
基于CRD的扩展功能   
HTTP load balancingNot supportedSee VirtualServer and VirtualServerRoute resources.See VirtualServer and VirtualServerRoute resources.
部署方式   
Command-line arguments *2See the argumentsSee the argumentsSee the arguments
TLS certificate and key for the default serverRequired as a command-line argument/ auto-generatedRequired as a command-line argumentRequired as a command-line argument
Helm chartSupportedSupportedSupported
运维相关   
Reporting the IP address(es) of the Ingress controller into Ingress resourcesSupportedSupportedSupported
Extended StatusSupported via a third-party moduleNot supportedSupported
Prometheus IntegrationSupportedSupportedSupported
Dynamic reconfiguration of endpoints (no configuration reloading)Supported with a third-party Lua moduleNot supportedSupported

Notes:

*1 -- 不同的Ingress控制器使用的Configuration templates格式是不同的.

*2 -- 由于命令行参数存在差别,所以不同的Ingress控制器的部署配置文件(deployment manifest)也是各不相同的。

 

更换Ingress 控制器

 

需要根据上面章节描述的各个方面来处理差异。选择合适您场景的Ingress 控制器。

 

参考文献

 

https://github.com/nginxinc/kubernetes-ingress/blob/master/docs/nginx-ingress-controllers.md

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值