-
Notifications
You must be signed in to change notification settings - Fork 371
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
希望higress-https中的全局https证书配置可以用于ingress中secret不存在时的兜底 #978
Comments
cc @2456868764 |
在ingress tls 下不要配置 secretName, 如果配置 secretName 会在当前 namespace 查找,如果没有配置 secretName, 会在 higress-https configmap 查找。 |
@2456868764 但是我理解不应该导致443访问不通? |
这个地方是不是应该找不到去全局再查一次?只有本地没有+全局没有才会当作不存在
场景,全局ns下是一个wildcard的cert,本地ns可以用户用一个单域名的cert覆盖全局的cert(时间.cn等) |
@zzjin 目前的实现机制是如果ingress里有申明secret,就会直接用这个secret,只有当ingress里没有申明的时候才会用全局配置里的。这样提供用户灵活性,可以通过ingress配置强制指定走特定的secret。 |
如果ingress里指定的secret实际不存在,这个行为我们视作是用户自己的配置错误,我们觉得程序不应该为用户的配置错误兜底,应该让配置错误尽早暴露,以避免未来可能的其他未预期行为。 |
是指Ingress的CR里面,只配置tls.hosts,不配置secretName吗? |
测试Ingress-nginx的话是会查找默认证书,还是希望能与这块逻辑对齐,或者通过参数开关 |
@zzjin 是的只配tls.hosts不配置secretName,您是说ingress-nginx在发现secret不存在时会用默认证书来兜底是吗 |
我想了下。其实tls是域名级的,看单个ingress的tls spec也并不能判断这个域名是否开启HTTPS,依赖tls spec才开启HTTPS,管理起来反而麻烦。 不如就在这个higress-https里整体管理哪些域名要开启https(就配置secret)。 |
对的,ingress-nginx会在configmap里面做全局的兜底(如果ingress的cr配了tls,但是对应的ns下面的tls的secret找不到,就会用这个兜底) https://kubernetes.github.io/ingress-nginx/user-guide/tls/#default-ssl-certificate |
你指的是这一句吗?
|
这个需求在你们的场景下是必须的吗,是不是希望在切换到全局域名配置的时候,不用逐个修改ingress,直接批量删除secret是吗 |
逻辑上是合理的,不过在我们场景下应用会分散到很多不同的ns下,由不同的用户去管理,教导/引导实际用户在使用不同的域名的时候去理解, A域名是全局兜底的,不要配置tls,B域名是需要自己配置证书的,这件事情比较麻烦. 从系统层面来说这个应该是对用户无感知的 |
The secret referred to by this flag contains the default certificate to be used when accessing the catch-all server. 这一句 |
可以这么理解,新老系统兼容也是需要考虑的 |
但如果配置了单独的路由,就不属于“accessing the catch-all server”了吧?这部分你实测下来是什么行为呢? |
这个到还好,我的意思是tls不是强制配置,如果配置了也没问题,就是secret要配对。你的意思是说用户可能会配不存在的secret,这个时候需要用全局配置的secret来兜底是吗。 |
对的 |
实际效果其实还是有点偏差的: 从实现来说,我认可higress-https的方案确实可以更灵活的支持多域名的兜底,就是兜底的逻辑希望能和ingress-nginx尽量匹配下 |
ok 我这边考虑下 @zzjin |
Ⅰ. Issue Description
When update to 1.4.0-rc1, and setting #854 (without auto cert, just self-signed cert), users cannot access https ingress.
Ⅱ. Describe what happened
Users can only access one https route.
Ⅲ. Describe what you expected to happen
All ingress route over https can access normally.
Ⅳ. How to reproduce it (as minimally and precisely as possible)
Apply higress version 1.4.0-rc1, apply CRs below:
There are 3 ns and one secret higress-system/wildcard-cert exists, no other secrets exists.
Ⅴ. Anything else we need to know?
Ⅵ. Environment:
The text was updated successfully, but these errors were encountered: