Update sysctl example (#4800)

This commit is contained in:
Manuel Alejandro de Brito Fontes 2019-12-01 21:48:00 -03:00 committed by GitHub
parent 3d5165bca3
commit 9deed184f6
2 changed files with 10 additions and 5 deletions

View file

@ -1,9 +1,14 @@
# Sysctl tuning # Sysctl tuning
This example aims to demonstrate the use of an Init Container to adjust sysctl default values This example aims to demonstrate the use of an Init Container to adjust sysctl default values using `kubectl patch`
using `kubectl patch`
```console ```console
kubectl patch deployment -n ingress-nginx nginx-ingress-controller --patch="$(cat patch.json)" kubectl patch deployment -n ingress-nginx nginx-ingress-controller \
--patch="$(curl https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/docs/examples/customization/sysctl/patch.json)"
``` ```
**Changes:**
- Backlog Queue setting `net.core.somaxconn` from `128` to `32768`
- Ephemeral Ports setting `net.ipv4.ip_local_port_range` from `32768 60999` to `1024 65000`
In a [post from the NGINX blog](https://www.nginx.com/blog/tuning-nginx/) it is possible to see an explanation for these changes

View file

@ -4,11 +4,11 @@
"spec": { "spec": {
"initContainers": [{ "initContainers": [{
"name": "sysctl", "name": "sysctl",
"image": "alpine:3.6", "image": "alpine:3.10",
"securityContext": { "securityContext": {
"privileged": true "privileged": true
}, },
"command": ["sh", "-c", "sysctl -w net.core.somaxconn=32768; sysctl -w net.ipv4.ip_local_port_range=1024 65535"] "command": ["sh", "-c", "sysctl -w net.core.somaxconn=32768; sysctl -w net.ipv4.ip_local_port_range='1024 65000'"]
}] }]
} }
} }