From 31d8bb9b6b1d6b70893072a720edab87d13485e1 Mon Sep 17 00:00:00 2001 From: Manuel de Brito Fontes Date: Tue, 23 Jan 2018 17:58:15 -0300 Subject: [PATCH] Adjust sysctl values to improve nginx performance --- deploy/with-rbac.yaml | 10 ++++++++++ deploy/without-rbac.yaml | 10 ++++++++++ 2 files changed, 20 insertions(+) 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