From 810e81195e67b0e67f18f8d59b310f5da08c8396 Mon Sep 17 00:00:00 2001 From: Theodoros Tsioutsias Date: Tue, 23 Jul 2019 14:22:25 +0000 Subject: [PATCH] Fix kubernetes systemd service templates There are cases where systemd fails to restart kubernetes services. This change fixes that by inceasing the restart interval in the service templates. Change-Id: I305644a78cee80db43b561e71a532feb414d8322 story: 2006265 task: 35956 --- dockerfiles/heat-container-agent/service.template | 6 ++++-- dockerfiles/kubernetes-apiserver/service.template | 4 +++- dockerfiles/kubernetes-controller-manager/service.template | 4 +++- dockerfiles/kubernetes-kubelet/service.template | 4 +++- dockerfiles/kubernetes-proxy/service.template | 4 +++- dockerfiles/kubernetes-scheduler/service.template | 4 +++- 6 files changed, 19 insertions(+), 7 deletions(-) diff --git a/dockerfiles/heat-container-agent/service.template b/dockerfiles/heat-container-agent/service.template index 23c7bc226f..f86316b895 100644 --- a/dockerfiles/heat-container-agent/service.template +++ b/dockerfiles/heat-container-agent/service.template @@ -4,8 +4,10 @@ Description=Heat Container Agent system image [Service] ExecStart=$EXEC_START ExecStop=$EXEC_STOP -Restart=on-failure WorkingDirectory=$DESTDIR +Restart=always +StartLimitInterval=0 +RestartSec=10 [Install] -WantedBy=multi-user.target \ No newline at end of file +WantedBy=multi-user.target diff --git a/dockerfiles/kubernetes-apiserver/service.template b/dockerfiles/kubernetes-apiserver/service.template index 7aaa5d3081..3f5afd9f38 100644 --- a/dockerfiles/kubernetes-apiserver/service.template +++ b/dockerfiles/kubernetes-apiserver/service.template @@ -5,8 +5,10 @@ After=network-online.target [Service] ExecStart=$EXEC_START ExecStop=$EXEC_STOP -Restart=on-failure WorkingDirectory=$DESTDIR +Restart=always +StartLimitInterval=0 +RestartSec=10 [Install] WantedBy=multi-user.target diff --git a/dockerfiles/kubernetes-controller-manager/service.template b/dockerfiles/kubernetes-controller-manager/service.template index d73b0b35c8..eb8cd15ce7 100644 --- a/dockerfiles/kubernetes-controller-manager/service.template +++ b/dockerfiles/kubernetes-controller-manager/service.template @@ -4,8 +4,10 @@ Description=kubernetes-controller-manager [Service] ExecStart=$EXEC_START ExecStop=$EXEC_STOP -Restart=on-failure WorkingDirectory=$DESTDIR +Restart=always +StartLimitInterval=0 +RestartSec=10 [Install] WantedBy=multi-user.target diff --git a/dockerfiles/kubernetes-kubelet/service.template b/dockerfiles/kubernetes-kubelet/service.template index 54d70b0c0d..fb74df27af 100644 --- a/dockerfiles/kubernetes-kubelet/service.template +++ b/dockerfiles/kubernetes-kubelet/service.template @@ -5,8 +5,10 @@ After=docker.service [Service] ExecStart=$EXEC_START ExecStop=$EXEC_STOP -Restart=on-failure WorkingDirectory=$DESTDIR +Restart=always +StartLimitInterval=0 +RestartSec=10 [Install] WantedBy=multi-user.target diff --git a/dockerfiles/kubernetes-proxy/service.template b/dockerfiles/kubernetes-proxy/service.template index 3abf07a4ff..2ba34e9f7e 100644 --- a/dockerfiles/kubernetes-proxy/service.template +++ b/dockerfiles/kubernetes-proxy/service.template @@ -4,8 +4,10 @@ Description=kubernetes-proxy [Service] ExecStart=$EXEC_START ExecStop=$EXEC_STOP -Restart=on-failure WorkingDirectory=$DESTDIR +Restart=always +StartLimitInterval=0 +RestartSec=10 [Install] WantedBy=multi-user.target diff --git a/dockerfiles/kubernetes-scheduler/service.template b/dockerfiles/kubernetes-scheduler/service.template index d5a7e5e1e5..56211e7e89 100644 --- a/dockerfiles/kubernetes-scheduler/service.template +++ b/dockerfiles/kubernetes-scheduler/service.template @@ -4,8 +4,10 @@ Description=kubernetes-scheduler [Service] ExecStart=$EXEC_START ExecStop=$EXEC_STOP -Restart=on-failure WorkingDirectory=$DESTDIR +Restart=always +StartLimitInterval=0 +RestartSec=10 [Install] WantedBy=multi-user.target