From 55d38d0e2526853230d4939036f3e343ee54bc9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Miguel=20Olmo=20Mart=C3=ADnez?= Date: Wed, 15 Sep 2021 13:38:21 +0200 Subject: [PATCH] ceph: do not use http for mgr liveness probe MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When private/public network have been defined in the Ceph rook cluster it is not possible to configure properly the ip address of the liveness probe for the manager. Changes in the manager in Pacific introduced this regression. This change replaces the http probe by a command probe, avoiding thus to determine what is going to be the ip address of the manager before launching the pod. fixes: https://github.com/rook/rook/issues/8510 Signed-off-by: Juan Miguel Olmo Martínez (cherry picked from commit 7fbd9f2225afa9e87a8e608cf54e06edfb70a3fb) --- pkg/operator/ceph/cluster/mgr/spec.go | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/pkg/operator/ceph/cluster/mgr/spec.go b/pkg/operator/ceph/cluster/mgr/spec.go index 9e211402652e..352f61ab3ced 100644 --- a/pkg/operator/ceph/cluster/mgr/spec.go +++ b/pkg/operator/ceph/cluster/mgr/spec.go @@ -33,7 +33,6 @@ import ( apps "k8s.io/api/apps/v1" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/util/intstr" ) const ( @@ -186,7 +185,7 @@ func (c *Cluster) makeMgrDaemonContainer(mgrConfig *mgrConfig) v1.Container { ), Resources: cephv1.GetMgrResources(c.spec.Resources), SecurityContext: controller.PodSecurityContext(), - LivenessProbe: getDefaultMgrLivenessProbe(), + LivenessProbe: controller.GenerateLivenessProbeExecDaemon(config.MgrType, mgrConfig.DaemonID), WorkingDir: config.VarLogCephDir, } @@ -254,18 +253,6 @@ func (c *Cluster) makeCmdProxySidecarContainer(mgrConfig *mgrConfig) v1.Containe return container } -func getDefaultMgrLivenessProbe() *v1.Probe { - return &v1.Probe{ - Handler: v1.Handler{ - HTTPGet: &v1.HTTPGetAction{ - Path: "/", - Port: intstr.FromInt(int(DefaultMetricsPort)), - }, - }, - InitialDelaySeconds: 60, - } -} - // MakeMetricsService generates the Kubernetes service object for the monitoring service func (c *Cluster) MakeMetricsService(name, activeDaemon, servicePortMetricName string) (*v1.Service, error) { labels := c.selectorLabels(activeDaemon)