From 5d32b43f3616a1e434335aa096dd2f9d2632720b Mon Sep 17 00:00:00 2001 From: Roman Sokolkov Date: Mon, 11 Dec 2017 16:47:46 +0100 Subject: [PATCH] Adds liveness probe for node-controller We need one to restart node-controller if it's stuck with broken tcp connections. Depend: https://github.com/giantswarm/kvm-operator-node-controller/pull/10 --- .../deploymentv2/node_controller_deployment.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/service/resource/deploymentv2/node_controller_deployment.go b/service/resource/deploymentv2/node_controller_deployment.go index eef1faa90..bb655fd4b 100644 --- a/service/resource/deploymentv2/node_controller_deployment.go +++ b/service/resource/deploymentv2/node_controller_deployment.go @@ -5,6 +5,7 @@ import ( "github.com/giantswarm/apiextensions/pkg/apis/provider/v1alpha1" apismetav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/util/intstr" apiv1 "k8s.io/client-go/pkg/api/v1" extensionsv1 "k8s.io/client-go/pkg/apis/extensions/v1beta1" @@ -60,6 +61,19 @@ func newNodeControllerDeployment(customObject v1alpha1.KVMConfig) (*extensionsv1 Value: keyv2.ClusterID(customObject), }, }, + LivenessProbe: &apiv1.Probe{ + InitialDelaySeconds: 15, + TimeoutSeconds: 1, + PeriodSeconds: 10, + FailureThreshold: 3, + SuccessThreshold: 1, + Handler: apiv1.Handler{ + HTTPGet: &apiv1.HTTPGetAction{ + Path: keyv2.HealthEndpoint, + Port: intstr.IntOrString{IntVal: 8080}, + }, + }, + }, }, }, },