Merge pull request #7914 from dokku/k3s-cleanup-ingress-nginx

Fix nginx configuration building in k3s scheduler
This commit is contained in:
Jose Diaz-Gonzalez
2025-09-04 00:02:09 -04:00
committed by GitHub
2 changed files with 20 additions and 28 deletions

View File

@@ -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,
@@ -977,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 {

View File

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