From 9dfc32a8d7414f1552d2034dcfca7ff94691a086 Mon Sep 17 00:00:00 2001 From: Kevin Lefevre Date: Tue, 1 Oct 2019 18:13:34 +0200 Subject: [PATCH] [stable/kong] allow ot override TLS target port (#17182) * [stable/kong] allow ot override TLS target port This will allow to use AWS ELB with both 80 and 443 and with TLS termination on the ELB. fixes Kong/kubernetes-ingress-controller#292 Signed-off-by: Kevin Lefevre * fix new line Signed-off-by: Kevin Lefevre * fix lint Signed-off-by: Kevin Lefevre --- stable/kong/Chart.yaml | 2 +- stable/kong/README.md | 1 + stable/kong/templates/service-kong-proxy.yaml | 2 +- stable/kong/values.yaml | 3 +++ 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/stable/kong/Chart.yaml b/stable/kong/Chart.yaml index 9635d0ea94..65667e71a8 100644 --- a/stable/kong/Chart.yaml +++ b/stable/kong/Chart.yaml @@ -12,5 +12,5 @@ maintainers: name: kong sources: - https://github.com/Kong/kong -version: 0.18.5 +version: 0.19.0 appVersion: 1.3 diff --git a/stable/kong/README.md b/stable/kong/README.md index aaa2e90a58..732a0cda2c 100644 --- a/stable/kong/README.md +++ b/stable/kong/README.md @@ -88,6 +88,7 @@ and their default values. | proxy.tls.servicePort | Service port to use for TLS | 8443 | | proxy.tls.nodePort | Node port to use for TLS | 32443 | | proxy.tls.hostPort | Host port to use for TLS | | +| proxy.tls.overrideServiceTargetPort| Override service port to use for TLS without touching Kong containerPort | | | proxy.type | k8s service type. Options: NodePort, ClusterIP, LoadBalancer | `NodePort` | | proxy.loadBalancerSourceRanges | Limit proxy access to CIDRs if set and service type is `LoadBalancer` | `[]` | | proxy.loadBalancerIP | To reuse an existing ingress static IP for the admin service | | diff --git a/stable/kong/templates/service-kong-proxy.yaml b/stable/kong/templates/service-kong-proxy.yaml index ff3454a717..4f32bc34fd 100644 --- a/stable/kong/templates/service-kong-proxy.yaml +++ b/stable/kong/templates/service-kong-proxy.yaml @@ -41,7 +41,7 @@ spec: {{- if or .Values.proxy.tls.enabled }} - name: kong-proxy-tls port: {{ .Values.proxy.tls.servicePort }} - targetPort: {{ .Values.proxy.tls.containerPort }} + targetPort: {{ .Values.proxy.tls.overrideServiceTargetPort | default .Values.proxy.tls.containerPort }} {{- if (and (eq .Values.proxy.type "NodePort") (not (empty .Values.proxy.tls.nodePort))) }} nodePort: {{ .Values.proxy.tls.nodePort }} {{- end }} diff --git a/stable/kong/values.yaml b/stable/kong/values.yaml index b5c0ace1bb..37b7799943 100644 --- a/stable/kong/values.yaml +++ b/stable/kong/values.yaml @@ -65,6 +65,9 @@ proxy: enabled: true servicePort: 443 containerPort: 8443 + # Set a target port for the TLS port in proxy service, useful when using TLS + # termination on an ELB. + # overrideServiceTargetPort: 8000 # Set a nodePort which is available if service type is NodePort # nodePort: 32443