1

I am setting up a Kong ingress controller, however, the default ingress controller listening ports are 80/443. I need to add an additional HTTPS port (8080). I can change the default HTTPS port using the servicePort in the values file, however this replaces the default HTTPS port 443 with 8080. Is there a way to add an additional HTTPS port? In the API Gateway we used to be able to define it in the proxy_listen config, however, this doesn't seem to work in the Kong Ingress controller.

lion_bash
  • 1,309
  • 3
  • 15
  • 27

1 Answers1

0

You will need customize the chart,

  {{- if .tls.enabled }}
  - name: kong-{{ .serviceName }}-tls
    port: {{ .tls.servicePort }}
    targetPort: {{ .tls.overrideServiceTargetPort | default .tls.containerPort }}
    appProtocol: https
  - name: kong-{{ .serviceName }}-tls-customize
    port: {{ .tls.servicePort_custom }}
    targetPort: {{ .tls.overrideServiceTargetPort | default .tls.containerPort }}
    appProtocol: https

_helpers.tpl#L176

and it will produce something like this

  - name: kong-proxy-tls
    port: 443
    targetPort: 8443
    appProtocol: https
  - name: kong-proxy-custom-tls
    port: 8080
    targetPort: 8443

But i see something in the ENV, which seems like some binding so i do not belive it will work

        - name: KONG_PORT_MAPS
          value: "80:8000, 443:8443"

so seems like multiple change is involve or might be some limitations but this how you can play with chart, download it and customize it.

you can also try proxy_listen that was suppose to working with you before.

proxy_helpers.tpl#L209

  {{- if .tls -}}
    {{- if .tls.enabled -}}
      {{/*
      This is a bit of a hack to support always including "ssl" in the parameter
      list for TLS listens. It's not possible to set a variable to an object from
      .Values and then modify one of the objects values locally, although
      https://github.com/helm/helm/issues/4987 indicates it should be. Instead,
      this creates a new object and new parameters list built from the original.
      */}}
      {{- $listenConfig := dict -}}
      {{- $listenConfig := merge $listenConfig .tls -}}
      {{- $parameters := append .tls.parameters "ssl" -}}
      {{- $_ := set $listenConfig "parameters" $parameters -}}
      {{- $_ := set $listenConfig "address" (default "0.0.0.0" .address) -}}
      {{- $tlsListen := (include "kong.singleListen" $listenConfig) -}}
      {{- $unifiedListen = append $unifiedListen $tlsListen -}}
    {{- end -}}
  {{- end -}}

listen-values.yaml#L145

listen_helpers.tpl#L238

Adiii
  • 54,482
  • 7
  • 145
  • 148