Skip to content

Commit

Permalink
scheme
Browse files Browse the repository at this point in the history
Signed-off-by: Prashanth Dintyala <[email protected]>
  • Loading branch information
saiprashanth173 committed Sep 29, 2023
1 parent 2df5cd3 commit fa966e5
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions operator/pkg/resources/target/statefulset.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ func NewTargetSS(ais *aisv1.AIStore) *apiv1.StatefulSet {
VolumeMounts: volumeMounts(ais),
Lifecycle: cmn.NewAISNodeLifecycle(),
LivenessProbe: cmn.NewAISLivenessProbe(),
ReadinessProbe: readinessProbe(ais.Spec.TargetSpec.ServicePort),
ReadinessProbe: readinessProbe(ais.Spec.TargetSpec.ServicePort, ais.Spec.TLSSecretName != nil),
},
},
ServiceAccountName: cmn.ServiceAccountName(ais),
Expand All @@ -157,12 +157,18 @@ func volumeMounts(ais *aisv1.AIStore) []corev1.VolumeMount {
return vols
}

func readinessProbe(port intstr.IntOrString) *corev1.Probe {
func readinessProbe(port intstr.IntOrString, useHTTPS bool) *corev1.Probe {
scheme := corev1.URISchemeHTTP
if useHTTPS {
scheme = corev1.URISchemeHTTPS
}

return &corev1.Probe{
ProbeHandler: corev1.ProbeHandler{
HTTPGet: &corev1.HTTPGetAction{
Path: "/v1/health?readiness=true",
Port: port,
Path: "/v1/health?readiness=true",
Port: port,
Scheme: scheme,
},
},
InitialDelaySeconds: 15,
Expand Down

0 comments on commit fa966e5

Please sign in to comment.