Adjust sysctl values to improve nginx performance (#1960)

* Adjust sysctl values to improve nginx performance

* Increase wait timeout for nginx controller pod
This commit is contained in:
Manuel Alejandro de Brito Fontes 2018-01-23 19:19:32 -03:00 committed by GitHub
parent 8ee694164f
commit 2853ba564d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 21 additions and 1 deletions

View file

@ -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

View file

@ -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

View file

@ -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