From 865063300fa666d15ce53a68474de3c44ceebe69 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Wed, 3 Sep 2025 20:35:44 -0400 Subject: [PATCH 1/3] feat: allow Critical annotations to be injected into ingresses Dokku needs this in order to construct certain rules that aren't supported by ingress-nginx annotations. --- plugins/scheduler-k3s/templates/helm-config/ingress-nginx.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/scheduler-k3s/templates/helm-config/ingress-nginx.yaml b/plugins/scheduler-k3s/templates/helm-config/ingress-nginx.yaml index fd60488cd..5b0ba9b19 100644 --- a/plugins/scheduler-k3s/templates/helm-config/ingress-nginx.yaml +++ b/plugins/scheduler-k3s/templates/helm-config/ingress-nginx.yaml @@ -4,6 +4,7 @@ controller: enabled: true config: access-log-path: /var/log/nginx/access.log + annotations-risk-level: Critical error-log-path: /var/log/nginx/error.log log-format-escape-json: "true" extraVolumeMounts: From 9182b272f42512ef04e3c84cdf103b72851154d2 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Wed, 3 Sep 2025 20:36:33 -0400 Subject: [PATCH 2/3] fix: split up proxy-buffers into annotation properties The values derive from the same nginx source, so they also need a modifier in order to fit into the ingress-nginx scheme. --- plugins/scheduler-k3s/functions.go | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/plugins/scheduler-k3s/functions.go b/plugins/scheduler-k3s/functions.go index afcc79117..9710ca090 100644 --- a/plugins/scheduler-k3s/functions.go +++ b/plugins/scheduler-k3s/functions.go @@ -925,9 +925,27 @@ func getIngressAnnotations(appName string, processType string) (map[string]strin annotation: "nginx.ingress.kubernetes.io/proxy-buffering", getter: nginxvhosts.ComputedProxyBuffering, }, - "proxy-buffers": { + "proxy-buffers-number": { annotation: "nginx.ingress.kubernetes.io/proxy-buffers-number", getter: nginxvhosts.ComputedProxyBuffers, + modifier: func(value string) string { + parts := strings.Split(value, " ") + if len(parts) != 2 { + return "8" + } + return parts[0] + }, + }, + "proxy-buffers-size": { + annotation: "nginx.ingress.kubernetes.io/proxy-buffers-size", + getter: nginxvhosts.ComputedProxyBuffers, + modifier: func(value string) string { + parts := strings.Split(value, " ") + if len(parts) != 2 { + return "4k" + } + return parts[1] + }, }, "proxy-busy-buffers-size": { getter: nginxvhosts.ComputedProxyBusyBuffersSize, From ae99f491fa0845199a3f9c159dcf37d01bd82860 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Wed, 3 Sep 2025 20:38:01 -0400 Subject: [PATCH 3/3] fix: drop x-forwarded- properties from k3s scheduler These shadow existing values managed by k3s itself, causing issues where the same header is injected with multiple values, which some frameworks do not support as they use the header directly without parsing to construct urls. --- plugins/scheduler-k3s/functions.go | 27 --------------------------- 1 file changed, 27 deletions(-) diff --git a/plugins/scheduler-k3s/functions.go b/plugins/scheduler-k3s/functions.go index 9710ca090..e163ee002 100644 --- a/plugins/scheduler-k3s/functions.go +++ b/plugins/scheduler-k3s/functions.go @@ -995,33 +995,6 @@ func getIngressAnnotations(appName string, processType string) (map[string]strin return fmt.Sprintf("underscores_in_headers %s;", value) }, }, - "x-forwarded-for-value": { - getter: nginxvhosts.ComputedXForwardedForValue, - locationSnippet: func(value string) string { - if value == "" { - return "" - } - return fmt.Sprintf("proxy_set_header X-Forwarded-For %s;", value) - }, - }, - "x-forwarded-port-value": { - getter: nginxvhosts.ComputedXForwardedPortValue, - locationSnippet: func(value string) string { - if value == "" { - return "" - } - return fmt.Sprintf("proxy_set_header X-Forwarded-Port %s;", value) - }, - }, - "x-forwarded-proto-value": { - getter: nginxvhosts.ComputedXForwardedProtoValue, - locationSnippet: func(value string) string { - if value == "" { - return "" - } - return fmt.Sprintf("proxy_set_header X-Forwarded-Proto %s;", value) - }, - }, "x-forwarded-ssl": { getter: nginxvhosts.ComputedXForwardedSSL, locationSnippet: func(value string) string {