|
|
|
@ -7,6 +7,7 @@ import ( |
|
|
|
|
monitoringv1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1" |
|
|
|
|
corev1 "k8s.io/api/core/v1" |
|
|
|
|
"k8s.io/apimachinery/pkg/labels" |
|
|
|
|
"k8s.io/apimachinery/pkg/util/intstr" |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
const ( |
|
|
|
@ -19,6 +20,9 @@ const ( |
|
|
|
|
lokiGRPCPortName = "grpclb" |
|
|
|
|
lokiGossipPortName = "gossip-ring" |
|
|
|
|
|
|
|
|
|
lokiLivenessPath = "/loki/api/v1/status/buildinfo" |
|
|
|
|
lokiReadinessPath = "/ready" |
|
|
|
|
|
|
|
|
|
gatewayContainerName = "gateway" |
|
|
|
|
gatewayHTTPPort = 8080 |
|
|
|
|
gatewayInternalPort = 8081 |
|
|
|
@ -235,3 +239,36 @@ func serviceMonitorEndpoint(portName, serviceName, namespace string, enableTLS b |
|
|
|
|
Scheme: "http", |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
func lokiLivenessProbe() *corev1.Probe { |
|
|
|
|
return &corev1.Probe{ |
|
|
|
|
Handler: corev1.Handler{ |
|
|
|
|
HTTPGet: &corev1.HTTPGetAction{ |
|
|
|
|
Path: lokiLivenessPath, |
|
|
|
|
Port: intstr.FromInt(httpPort), |
|
|
|
|
Scheme: corev1.URISchemeHTTP, |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
TimeoutSeconds: 2, |
|
|
|
|
PeriodSeconds: 30, |
|
|
|
|
FailureThreshold: 10, |
|
|
|
|
SuccessThreshold: 1, |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
func lokiReadinessProbe() *corev1.Probe { |
|
|
|
|
return &corev1.Probe{ |
|
|
|
|
Handler: corev1.Handler{ |
|
|
|
|
HTTPGet: &corev1.HTTPGetAction{ |
|
|
|
|
Path: lokiReadinessPath, |
|
|
|
|
Port: intstr.FromInt(httpPort), |
|
|
|
|
Scheme: corev1.URISchemeHTTP, |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
PeriodSeconds: 10, |
|
|
|
|
InitialDelaySeconds: 15, |
|
|
|
|
TimeoutSeconds: 1, |
|
|
|
|
SuccessThreshold: 1, |
|
|
|
|
FailureThreshold: 3, |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|