diff --git a/ingress/templates/bin/_ingress-controller.sh.tpl b/ingress/templates/bin/_ingress-controller.sh.tpl index 3ba28d6c8..ba809c93a 100644 --- a/ingress/templates/bin/_ingress-controller.sh.tpl +++ b/ingress/templates/bin/_ingress-controller.sh.tpl @@ -21,6 +21,20 @@ COMMAND="${@:-start}" function start () { find /tmp/ -maxdepth 1 -writable | grep -v "^/tmp/$" | xargs -L1 -r rm -rfv + + declare -A desired_opts + desired_opts["--stream-port"]="${PORT_STREAM}" + desired_opts["--profiler-port"]="${PORT_PROFILER}" + + possible_opts=$(/nginx-ingress-controller --help 2>&1 | awk '/^ --/ { print $1 }') + + extra_opts=() + for k in "${!desired_opts[@]}"; do + if echo "$possible_opts" | grep -q -- ^${k}$; then + extra_opts+=($k=${desired_opts[$k]}) + fi + done + exec /usr/bin/dumb-init \ /nginx-ingress-controller \ {{- if eq .Values.deployment.mode "namespace" }} @@ -36,7 +50,8 @@ function start () { --default-backend-service=${POD_NAMESPACE}/${ERROR_PAGE_SERVICE} \ --configmap=${POD_NAMESPACE}/ingress-conf \ --tcp-services-configmap=${POD_NAMESPACE}/ingress-services-tcp \ - --udp-services-configmap=${POD_NAMESPACE}/ingress-services-udp + --udp-services-configmap=${POD_NAMESPACE}/ingress-services-udp \ + "${extra_opts[@]}" } function stop () { diff --git a/ingress/templates/deployment-ingress.yaml b/ingress/templates/deployment-ingress.yaml index 175b8ff67..ebad6d634 100644 --- a/ingress/templates/deployment-ingress.yaml +++ b/ingress/templates/deployment-ingress.yaml @@ -262,6 +262,10 @@ spec: value: {{ tuple "ingress" "internal" "https" . | include "helm-toolkit.endpoints.endpoint_port_lookup" | quote }} - name: PORT_STATUS value: {{ tuple "ingress" "internal" "status" . | include "helm-toolkit.endpoints.endpoint_port_lookup" | quote }} + - name: PORT_STREAM + value: {{ tuple "ingress" "internal" "stream" . | include "helm-toolkit.endpoints.endpoint_port_lookup" | quote }} + - name: PORT_PROFILER + value: {{ tuple "ingress" "internal" "profiler" . | include "helm-toolkit.endpoints.endpoint_port_lookup" | quote }} - name: PORT_HEALTHZ value: {{ tuple "ingress" "internal" "healthz" . | include "helm-toolkit.endpoints.endpoint_port_lookup" | quote }} - name: DEFAULT_SERVER_PORT diff --git a/ingress/values.yaml b/ingress/values.yaml index 987c7b834..668a5a066 100644 --- a/ingress/values.yaml +++ b/ingress/values.yaml @@ -209,7 +209,11 @@ endpoints: healthz: default: 10254 status: - default: 18080 + default: 10246 + stream: + default: 10247 + profiler: + default: 10245 server: default: 8181 ingress_exporter: