Merge "Ingress: nginx-ingress-controller 0.26.1+ support"

This commit is contained in:
Zuul 2020-01-08 00:35:21 +00:00 committed by Gerrit Code Review
commit f6775eaae0
3 changed files with 25 additions and 2 deletions

View File

@ -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 () {

View File

@ -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

View File

@ -209,7 +209,11 @@ endpoints:
healthz:
default: 10254
status:
default: 18080
default: 10246
stream:
default: 10247
profiler:
default: 10245
server:
default: 8181
ingress_exporter: