-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: nginx config for request size and timeouts (#129)
- Loading branch information
1 parent
1d3d48c
commit 6e6dfe4
Showing
5 changed files
with
43 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package local | ||
|
||
import ( | ||
"bytes" | ||
"fmt" | ||
"text/template" | ||
) | ||
|
||
var nginxValuesTpl = template.Must(template.New("nginx-values").Parse(` | ||
controller: | ||
hostPort: | ||
enabled: true | ||
service: | ||
type: NodePort | ||
ports: | ||
http: {{ .Port }} | ||
httpsPort: | ||
enable: false | ||
config: | ||
proxy-body-size: 10m | ||
proxy-read-timeout: "600" | ||
proxy-send-timeout: "600" | ||
`)) | ||
|
||
func getNginxValuesYaml(port int) (string, error) { | ||
var buf bytes.Buffer | ||
err := nginxValuesTpl.Execute(&buf, map[string]any{"Port": port}) | ||
if err != nil { | ||
return "", fmt.Errorf("failed to build nginx values yaml: %w", err) | ||
} | ||
return buf.String(), nil | ||
} |