Update ingress.yaml to accomodate kong service ports #10086
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This template built an ingress that incorrectly set
$servicePort
based onapp.ingress.tls.enabled
.This fixes that by using the
kong.proxy.tls.enabled
for the check instead, thereby selecting the correct service port.It also adjusts the default annotations to check for
app.ingress.tls.enabled
so unnecessary annotations are avoided.Finally, it properly sets the backend protocol based on
kong.proxy.tls.enabled
.I see a few different scenarios:
SSL Passthrough
app.ingress.tls.enabled
==false
kong.proxy.tls.enabled
==true
Ingress terminated TLS
app.ingress.tls.enabled
==true
kong.proxy.tls.enabled
==false
Ingress TLS to Kong TLS, though not sure this works because the default ingress annotation
nginx.ingress.kubernetes.io/ssl-redirect: "true"
app.ingress.tls.enabled
==true
kong.proxy.tls.enabled
==true
I don't think HTTP to HTTPS proxying is a good idea, so I won't talk more about it.
To fix TLS to TLS, there might be a need to add an additional parameter enabling
ssl-passthrough
behavior. In this implementation, ifkong.proxy.tls.enabled=true
then it assumes you want to perform SSL-passthrough. I haven't verified as I'm using Ingress terminated TLS and can't test the needful.I suspect this has been the culprit of many threads regarding
Error 400 HTTP request to HTTPS
, though I think that might also have something to do with http2 requirements on the proxy -- at least on my deployment.