From 558faadcac26fa47a438349f6f7048fcd9c56c3b Mon Sep 17 00:00:00 2001 From: Jari Kolehmainen Date: Thu, 29 Mar 2018 11:38:26 +0300 Subject: [PATCH] agent cloudinit improvements (#50) --- lib/kontena/machine/aws/cloudinit.yml | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/lib/kontena/machine/aws/cloudinit.yml b/lib/kontena/machine/aws/cloudinit.yml index ea57bd7..69ad605 100644 --- a/lib/kontena/machine/aws/cloudinit.yml +++ b/lib/kontena/machine/aws/cloudinit.yml @@ -12,13 +12,18 @@ write_files: - path: /etc/systemd/system/docker.service.d/50-kontena.conf content: | [Service] - Environment='DOCKER_OPTS=--insecure-registry="10.81.0.0/16" --bip="172.17.43.1/16"' + Environment='DOCKER_OPTS=--log-driver=json-file --log-opt=max-size=20m --insecure-registry="10.81.0.0/16" --bip="172.17.43.1/16"' Environment='DOCKER_CGROUPS=--exec-opt native.cgroupdriver=cgroupfs' - - path: /etc/sysctl.d/99-inotify.conf + - path: /etc/sysctl.d/99-kontena.conf owner: root permissions: 0644 content: | fs.inotify.max_user_instances = 8192 + fs.inotify.max_user_watches = 524288 + vm.max_map_count = 262144 + kernel.softlockup_panic = 1 + kernel.softlockup_all_cpu_backtrace = 1 + kernel.panic = 60 coreos: units: - name: zz-default.network @@ -55,10 +60,9 @@ coreos: content: | [Unit] Description=kontena-agent + Documentation=https://www.kontena.io/ After=network-online.target After=docker.service - Description=Kontena Agent - Documentation=http://www.kontena.io/ Requires=network-online.target Requires=docker.service @@ -76,5 +80,8 @@ coreos: -e KONTENA_PEER_INTERFACE=${KONTENA_PEER_INTERFACE} \ -v=/var/run/docker.sock:/var/run/docker.sock \ -v=/etc/kontena-agent.env:/etc/kontena.env \ - --net=host \ + --net=host --memory 384m \ kontena/agent:${KONTENA_VERSION} + + [Install] + WantedBy=docker.service \ No newline at end of file