From 2853ba564dc7d2515c6eb7f234273a0cd471a2ea Mon Sep 17 00:00:00 2001 From: Manuel Alejandro de Brito Fontes Date: Tue, 23 Jan 2018 19:19:32 -0300 Subject: [PATCH] Adjust sysctl values to improve nginx performance (#1960) * Adjust sysctl values to improve nginx performance * Increase wait timeout for nginx controller pod --- deploy/with-rbac.yaml | 10 ++++++++++ deploy/without-rbac.yaml | 10 ++++++++++ test/e2e/wait-for-nginx.sh | 2 +- 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/deploy/with-rbac.yaml b/deploy/with-rbac.yaml index 537939499..57aac0b6a 100644 --- a/deploy/with-rbac.yaml +++ b/deploy/with-rbac.yaml @@ -17,6 +17,16 @@ spec: prometheus.io/scrape: 'true' spec: serviceAccountName: nginx-ingress-serviceaccount + initContainers: + - command: + - sh + - -c + - sysctl -w net.core.somaxconn=32768; sysctl -w net.ipv4.ip_local_port_range="1024 65535" + image: alpine:3.6 + imagePullPolicy: IfNotPresent + name: sysctl + securityContext: + privileged: true containers: - name: nginx-ingress-controller image: quay.io/kubernetes-ingress-controller/nginx-ingress-controller:0.10.0 diff --git a/deploy/without-rbac.yaml b/deploy/without-rbac.yaml index a6741d768..4871359ad 100644 --- a/deploy/without-rbac.yaml +++ b/deploy/without-rbac.yaml @@ -16,6 +16,16 @@ spec: prometheus.io/port: '10254' prometheus.io/scrape: 'true' spec: + initContainers: + - command: + - sh + - -c + - sysctl -w net.core.somaxconn=32768; sysctl -w net.ipv4.ip_local_port_range="1024 65535" + image: alpine:3.6 + imagePullPolicy: IfNotPresent + name: sysctl + securityContext: + privileged: true containers: - name: nginx-ingress-controller image: quay.io/kubernetes-ingress-controller/nginx-ingress-controller:0.10.0 diff --git a/test/e2e/wait-for-nginx.sh b/test/e2e/wait-for-nginx.sh index 19e4d5ebb..fc309c159 100755 --- a/test/e2e/wait-for-nginx.sh +++ b/test/e2e/wait-for-nginx.sh @@ -45,7 +45,7 @@ function waitForPod() { export -f waitForPod -timeout 10s bash -c waitForPod +timeout 30s bash -c waitForPod if kubectl get pods -n ingress-nginx -l app=ingress-nginx -o jsonpath="$JSONPATH" 2>&1 | grep -q "Ready=True"; then