diff --git a/assets/terraform-modules/aws/flatcar-linux/kubernetes/cl/controller.yaml.tmpl b/assets/terraform-modules/aws/flatcar-linux/kubernetes/cl/controller.yaml.tmpl index a4d706090..284ffc9e9 100644 --- a/assets/terraform-modules/aws/flatcar-linux/kubernetes/cl/controller.yaml.tmpl +++ b/assets/terraform-modules/aws/flatcar-linux/kubernetes/cl/controller.yaml.tmpl @@ -12,16 +12,24 @@ systemd: [Service] Type=simple Restart=always - RestartSec=10s + RestartSec=5s TimeoutStartSec=0 LimitNOFILE=40000 EnvironmentFile=/etc/kubernetes/etcd.env - ExecStart=sh -c "docker run --network=host \ + ExecStartPre=-docker rm -f etcd + ExecStartPre=sh -c "docker run -d \ + --name=etcd \ + --restart=unless-stopped \ + --log-driver=journald \ + --network=host \ -u $(id -u \"$${ETCD_USER}\"):$(id -u \"$${ETCD_USER}\") \ -v $${ETCD_DATA_DIR}:$${ETCD_DATA_DIR}:rw \ -v $${ETCD_SSL_DIR}:$${ETCD_SSL_DIR}:ro \ --env-file /etc/kubernetes/etcd.env \ $${ETCD_IMAGE_URL}:$${ETCD_IMAGE_TAG}" + ExecStart=docker logs -f etcd + ExecStop=docker stop etcd + ExecStopPost=docker rm etcd ExecStopPost=-/opt/etcd-rejoin [Install] WantedBy=multi-user.target