Skip to content

Commit f2ec516

Browse files
Andrew Farriesroboquat
Andrew Farries
authored andcommitted
[installer] Add liveness probe for server
Add a liveness probe for server that fails if the nodejs event loop lag exceeds a given threshold.
1 parent 86d80e6 commit f2ec516

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

install/installer/pkg/components/server/deployment.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import (
2626
"k8s.io/apimachinery/pkg/api/resource"
2727
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2828
"k8s.io/apimachinery/pkg/runtime"
29+
"k8s.io/apimachinery/pkg/util/intstr"
2930
"k8s.io/utils/pointer"
3031
)
3132

@@ -387,6 +388,20 @@ func deployment(ctx *common.RenderContext) ([]runtime.Object, error) {
387388
"memory": resource.MustParse("200Mi"),
388389
},
389390
}),
391+
LivenessProbe: &corev1.Probe{
392+
ProbeHandler: corev1.ProbeHandler{
393+
HTTPGet: &corev1.HTTPGetAction{
394+
Path: "/live",
395+
Port: intstr.IntOrString{
396+
Type: intstr.Int,
397+
IntVal: ContainerPort,
398+
},
399+
},
400+
},
401+
InitialDelaySeconds: 120,
402+
PeriodSeconds: 10,
403+
FailureThreshold: 6,
404+
},
390405
SecurityContext: &corev1.SecurityContext{
391406
Privileged: pointer.Bool(false),
392407
RunAsUser: pointer.Int64(31001),

0 commit comments

Comments
 (0)