diff --git a/internal/manifests/gateway.go b/internal/manifests/gateway.go index fa98758be365..7117a02db000 100644 --- a/internal/manifests/gateway.go +++ b/internal/manifests/gateway.go @@ -290,6 +290,22 @@ func configureGatewayMetricsPKI(podSpec *corev1.PodSpec) error { fmt.Sprintf("--tls.healthchecks.server-ca-file=%s", path.Join(gateway.LokiGatewayTLSDir, "ca")), }, } + uriSchemeContainerSpec := corev1.Container{ + ReadinessProbe: &corev1.Probe{ + Handler: corev1.Handler{ + HTTPGet: &corev1.HTTPGetAction{ + Scheme: corev1.URISchemeHTTPS, + }, + }, + }, + LivenessProbe: &corev1.Probe{ + Handler: corev1.Handler{ + HTTPGet: &corev1.HTTPGetAction{ + Scheme: corev1.URISchemeHTTPS, + }, + }, + }, + } if err := mergo.Merge(podSpec, secretVolumeSpec, mergo.WithAppendSlice); err != nil { return kverrors.Wrap(err, "failed to merge volumes") @@ -299,5 +315,9 @@ func configureGatewayMetricsPKI(podSpec *corev1.PodSpec) error { return kverrors.Wrap(err, "failed to merge container") } + if err := mergo.Merge(&podSpec.Containers[0], uriSchemeContainerSpec, mergo.WithOverride); err != nil { + return kverrors.Wrap(err, "failed to merge container") + } + return nil } diff --git a/internal/manifests/service_monitor.go b/internal/manifests/service_monitor.go index 321e76b1b8d1..7edb92432a91 100644 --- a/internal/manifests/service_monitor.go +++ b/internal/manifests/service_monitor.go @@ -2,7 +2,6 @@ package manifests import ( "github.com/ViaQ/logerr/kverrors" - corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/labels" @@ -141,6 +140,22 @@ func configureServiceMonitorPKI(podSpec *corev1.PodSpec, serviceName string) err "-server.http-tls-key-path=/etc/proxy/secrets/tls.key", }, } + uriSchemeContainerSpec := corev1.Container{ + ReadinessProbe: &corev1.Probe{ + Handler: corev1.Handler{ + HTTPGet: &corev1.HTTPGetAction{ + Scheme: corev1.URISchemeHTTPS, + }, + }, + }, + LivenessProbe: &corev1.Probe{ + Handler: corev1.Handler{ + HTTPGet: &corev1.HTTPGetAction{ + Scheme: corev1.URISchemeHTTPS, + }, + }, + }, + } if err := mergo.Merge(podSpec, secretVolumeSpec, mergo.WithAppendSlice); err != nil { return kverrors.Wrap(err, "failed to merge volumes") @@ -150,5 +165,9 @@ func configureServiceMonitorPKI(podSpec *corev1.PodSpec, serviceName string) err return kverrors.Wrap(err, "failed to merge container") } + if err := mergo.Merge(&podSpec.Containers[0], uriSchemeContainerSpec, mergo.WithOverride); err != nil { + return kverrors.Wrap(err, "failed to merge container") + } + return nil }