From 80462ecdad63b851d5cd00ec623f55e64cd26728 Mon Sep 17 00:00:00 2001 From: Manuel Alejandro de Brito Fontes Date: Mon, 12 Feb 2018 15:14:11 -0800 Subject: [PATCH] Remove initContainer from default deployment (#2077) --- deploy/with-rbac.yaml | 10 ---------- deploy/without-rbac.yaml | 10 ---------- docs/examples/customization/sysctl/README.md | 9 +++++++++ docs/examples/customization/sysctl/patch.json | 16 ++++++++++++++++ 4 files changed, 25 insertions(+), 20 deletions(-) create mode 100644 docs/examples/customization/sysctl/README.md create mode 100644 docs/examples/customization/sysctl/patch.json diff --git a/deploy/with-rbac.yaml b/deploy/with-rbac.yaml index a70a7fa63..00611d01a 100644 --- a/deploy/with-rbac.yaml +++ b/deploy/with-rbac.yaml @@ -17,16 +17,6 @@ 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.2 diff --git a/deploy/without-rbac.yaml b/deploy/without-rbac.yaml index 1de84195b..2e91708ef 100644 --- a/deploy/without-rbac.yaml +++ b/deploy/without-rbac.yaml @@ -16,16 +16,6 @@ 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.2 diff --git a/docs/examples/customization/sysctl/README.md b/docs/examples/customization/sysctl/README.md new file mode 100644 index 000000000..909e12989 --- /dev/null +++ b/docs/examples/customization/sysctl/README.md @@ -0,0 +1,9 @@ +# Sysctl tuning + +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)" +``` + diff --git a/docs/examples/customization/sysctl/patch.json b/docs/examples/customization/sysctl/patch.json new file mode 100644 index 000000000..56482f511 --- /dev/null +++ b/docs/examples/customization/sysctl/patch.json @@ -0,0 +1,16 @@ +{ + "spec": { + "template": { + "spec": { + "initContainers": [{ + "name": "sysctl", + "image": "alpine:3.6", + "securityContext": { + "privileged": true + }, + "command": ["sh", "-c", "sysctl -w net.core.somaxconn=32768; sysctl -w net.ipv4.ip_local_port_range=1024 65535"] + }] + } + } + } +} \ No newline at end of file