24 lines
		
	
	
		
			629 B
		
	
	
	
		
			Go
		
	
	
	
			
		
		
	
	
			24 lines
		
	
	
		
			629 B
		
	
	
	
		
			Go
		
	
	
	
| package resources
 | |
| 
 | |
| import (
 | |
| 	corev1 "k8s.io/api/core/v1"
 | |
| 	"k8s.io/apimachinery/pkg/util/intstr"
 | |
| )
 | |
| 
 | |
| func NewProbe(uri string, port string, scheme corev1.URIScheme, initialDelaySeconds, timeoutSeconds, failureThreshold int32) *corev1.Probe {
 | |
| 	return &corev1.Probe{
 | |
| 		ProbeHandler: corev1.ProbeHandler{
 | |
| 			HTTPGet: &corev1.HTTPGetAction{
 | |
| 				Path:   uri,
 | |
| 				Port:   intstr.FromString(port),
 | |
| 				Scheme: corev1.URISchemeHTTP,
 | |
| 			},
 | |
| 		},
 | |
| 		InitialDelaySeconds: initialDelaySeconds,
 | |
| 		TimeoutSeconds:      timeoutSeconds,
 | |
| 		FailureThreshold:    failureThreshold,
 | |
| 		SuccessThreshold:    int32(1),
 | |
| 		PeriodSeconds:       int32(1),
 | |
| 	}
 | |
| }
 |