Add liveness and readiness probes to jumphost

Adds TCP liveness and readiness probes for the jumphost
container's sshd service.

Closes: #6
Change-Id: Ifa2e63bbea7773aa5c9154d03df32e4da3b57994
This commit is contained in:
Matthew Fuller 2021-05-21 22:20:43 +00:00
parent f9226befbd
commit 606bffec8b

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{