Merge "Add liveness and readiness probes to jumphost"

This commit is contained in:
Zuul 2021-05-26 13:29:15 +00:00 committed by Gerrit Code Review
commit fbb81d1801

View File

@ -29,6 +29,7 @@ import (
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/types"
"k8s.io/apimachinery/pkg/util/intstr"
"sigs.k8s.io/controller-runtime/pkg/client"
airshipv1 "sipcluster/pkg/api/v1"
@ -202,6 +203,24 @@ func (jh jumpHost) generateDeployment(instance string, labels map[string]string,
SubPath: authorizedKeysFile,
},
},
LivenessProbe: &corev1.Probe{
Handler: corev1.Handler{
TCPSocket: &corev1.TCPSocketAction{
Port: intstr.FromString("ssh"),
},
},
InitialDelaySeconds: 15,
PeriodSeconds: 10,
},
ReadinessProbe: &corev1.Probe{
Handler: corev1.Handler{
TCPSocket: &corev1.TCPSocketAction{
Port: intstr.FromString("ssh"),
},
},
InitialDelaySeconds: 5,
PeriodSeconds: 20,
},
},
},
SecurityContext: &corev1.PodSecurityContext{