From e864fc7198a5c302c390153a04aa9621c1f69d54 Mon Sep 17 00:00:00 2001 From: Manuel Alejandro de Brito Fontes Date: Sun, 1 Dec 2019 21:48:00 -0300 Subject: [PATCH] Update sysctl example (#4800) --- docs/examples/customization/sysctl/README.md | 11 ++++++++--- docs/examples/customization/sysctl/patch.json | 4 ++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/docs/examples/customization/sysctl/README.md b/docs/examples/customization/sysctl/README.md index 909e12989..4d3f12764 100644 --- a/docs/examples/customization/sysctl/README.md +++ b/docs/examples/customization/sysctl/README.md @@ -1,9 +1,14 @@ # Sysctl tuning -This example aims to demonstrate the use of an Init Container to adjust sysctl default values -using `kubectl patch` +This example aims to demonstrate the use of an Init Container to adjust sysctl default values using `kubectl patch` ```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 diff --git a/docs/examples/customization/sysctl/patch.json b/docs/examples/customization/sysctl/patch.json index 56482f511..e74b3828a 100644 --- a/docs/examples/customization/sysctl/patch.json +++ b/docs/examples/customization/sysctl/patch.json @@ -4,11 +4,11 @@ "spec": { "initContainers": [{ "name": "sysctl", - "image": "alpine:3.6", + "image": "alpine:3.10", "securityContext": { "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'"] }] } }