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:
parent
8ee694164f
commit
2853ba564d
3 changed files with 21 additions and 1 deletions
|
@ -17,6 +17,16 @@ spec:
|
||||||
prometheus.io/scrape: 'true'
|
prometheus.io/scrape: 'true'
|
||||||
spec:
|
spec:
|
||||||
serviceAccountName: nginx-ingress-serviceaccount
|
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:
|
containers:
|
||||||
- name: nginx-ingress-controller
|
- name: nginx-ingress-controller
|
||||||
image: quay.io/kubernetes-ingress-controller/nginx-ingress-controller:0.10.0
|
image: quay.io/kubernetes-ingress-controller/nginx-ingress-controller:0.10.0
|
||||||
|
|
|
@ -16,6 +16,16 @@ spec:
|
||||||
prometheus.io/port: '10254'
|
prometheus.io/port: '10254'
|
||||||
prometheus.io/scrape: 'true'
|
prometheus.io/scrape: 'true'
|
||||||
spec:
|
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:
|
containers:
|
||||||
- name: nginx-ingress-controller
|
- name: nginx-ingress-controller
|
||||||
image: quay.io/kubernetes-ingress-controller/nginx-ingress-controller:0.10.0
|
image: quay.io/kubernetes-ingress-controller/nginx-ingress-controller:0.10.0
|
||||||
|
|
|
@ -45,7 +45,7 @@ function waitForPod() {
|
||||||
|
|
||||||
export -f 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";
|
if kubectl get pods -n ingress-nginx -l app=ingress-nginx -o jsonpath="$JSONPATH" 2>&1 | grep -q "Ready=True";
|
||||||
then
|
then
|
||||||
|
|
Loading…
Reference in a new issue