#cloud-config write_files: - path: /etc/krates-worker.env permissions: 0600 owner: root content: | KONTENA_URI=<%= master_uri %> KONTENA_TOKEN=<%= grid_token %> KONTENA_PEER_INTERFACE=eth1 KONTENA_VERSION=<%= version %> - path: /etc/systemd/system/docker.service.d/50-krates.conf content: | [Service] Environment='DOCKER_OPTS=--insecure-registry="10.81.0.0/16" --bip="172.17.43.1/16" -s overlay2' Environment='DOCKER_CGROUPS=--exec-opt native.cgroupdriver=cgroupfs' - path: /etc/sysctl.d/99-inotify.conf owner: root permissions: 0644 content: | fs.inotify.max_user_instances = 8192 coreos: update: reboot-strategy: off units: - name: 00-eth.network runtime: true content: | [Match] Name=eth* [Network] DHCP=yes DNS=172.17.43.1 DNS=172.28.128.1 DNS=8.8.8.8 DOMAINS=kontena.local [DHCP] UseDNS=false - name: etcd2.service command: start enable: true content: | Description=etcd 2.0 After=docker.service [Service] Restart=always RestartSec=5 ExecStart=/usr/bin/docker logs --tail=10 -f krates-etcd - name: 50-docker.network mask: true - name: 50-docker-veth.network mask: true - name: zz-default.network runtime: false content: | # default should only match real network interfaces [Match] Name=eth* [Network] DHCP=yes [DHCP] UseMTU=true UseDomains=true - name: krates-worker.service command: start enable: true content: | [Unit] Description=krates-worker After=network-online.target After=docker.service Description=Krates Worker Documentation=http://krates.appsters.io Requires=network-online.target Requires=docker.service [Service] Restart=always RestartSec=5 TimeoutStartSec=0 EnvironmentFile=/etc/krates-worker.env ExecStartPre=-/usr/bin/docker stop krates-worker ExecStartPre=-/usr/bin/docker rm krates-worker ExecStartPre=/usr/bin/docker pull krates/worker ExecStart=/usr/bin/docker run --name krates-worker \ --env-file /etc/krates-worker.env \ -v=/var/run/docker.sock:/var/run/docker.sock \ -v=/etc/krates-worker.env:/etc/kontena.env \ --net=host \ krates/worker ExecStop=/usr/bin/docker stop krates-worker