Skip to content

Commit 1729fb3

Browse files
committed
remove horizontalscale
Signed-off-by: vkathole <[email protected]>
1 parent 7b18e34 commit 1729fb3

File tree

2 files changed

+8
-44
lines changed

2 files changed

+8
-44
lines changed

tests/conftest.py

+1-7
Original file line numberDiff line numberDiff line change
@@ -1509,7 +1509,6 @@ def factory(
15091509
custom_data=None,
15101510
node_name=None,
15111511
node_selector=None,
1512-
project=None,
15131512
replica_count=1,
15141513
raw_block_pv=False,
15151514
sa_obj=None,
@@ -1532,8 +1531,6 @@ def factory(
15321531
node_name (str): The name of specific node to schedule the pod
15331532
node_selector (dict): dict of key-value pair to be used for nodeSelector field
15341533
eg: {'nodetype': 'app-pod'}
1535-
project (object): ocs_ci.ocs.resources.ocs.OCS instance
1536-
of 'Project' kind.
15371534
replica_count (int): Replica count for deployment config
15381535
raw_block_pv (str): True if pod with raw block pvc
15391536
sa_obj (object) : If specific service account is needed
@@ -1543,10 +1540,7 @@ def factory(
15431540
dc_pod_obj = helpers.create_resource(**custom_data)
15441541
else:
15451542
pvc = pvc or pvc_factory(
1546-
interface=interface,
1547-
size=size,
1548-
access_mode=access_mode,
1549-
project=project,
1543+
interface=interface, size=size, access_mode=access_mode
15501544
)
15511545
sa_obj = sa_obj or service_account_factory(
15521546
project=pvc.project, service_account=service_account

tests/functional/monitoring/prometheus/alerts/test_alert_mds_cpu_high_usage.py

+7-37
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,8 @@
66
from ocs_ci.framework.testlib import E2ETest, tier2
77
from ocs_ci.helpers import helpers
88
from ocs_ci.ocs import cluster, constants
9-
from ocs_ci.ocs.monitoring import get_prometheus_response
109
from ocs_ci.utility import prometheus
1110
from ocs_ci.utility.utils import ceph_health_check_base
12-
from ocs_ci.framework import config
13-
from ocs_ci.ocs.ocp import OCP
1411

1512
log = logging.getLogger(__name__)
1613

@@ -30,18 +27,12 @@ def run_file_creator_io_with_cephfs(dc_pod_factory):
3027
interface = constants.CEPHFILESYSTEM
3128
log.info("Checking for Ceph Health OK")
3229
ceph_health_check_base()
33-
ocp_project = OCP(
34-
kind=constants.NAMESPACE, namespace=config.ENV_DATA["cluster_namespace"]
35-
)
3630

3731
for dc_pod in range(10):
3832
log.info(f"Creating {interface} based PVC")
3933
log.info("Creating fedora dc pod")
4034
pod_obj = dc_pod_factory(
41-
size="15",
42-
access_mode=access_mode,
43-
interface=interface,
44-
project=ocp_project,
35+
size="15", access_mode=access_mode, interface=interface
4536
)
4637
log.info("Copying file_creator_io.py to fedora pod ")
4738
cmd = f"oc cp {file} {pod_obj.namespace}/{pod_obj.name}:/"
@@ -54,19 +45,6 @@ def run_file_creator_io_with_cephfs(dc_pod_factory):
5445
)
5546

5647

57-
def get_scaling_type(threading_lock):
58-
api = prometheus.PrometheusAPI(threading_lock=threading_lock)
59-
ceph_mds_request = get_prometheus_response(api, query="rate(ceph_mds_request[6h])")
60-
result = ceph_mds_request["data"]["result"]
61-
for item in result:
62-
rate_ceph_mds_request = item["value"]
63-
rate_ceph_mds_request = float(rate_ceph_mds_request[1])
64-
if rate_ceph_mds_request >= 1000:
65-
return "Horizontal"
66-
else:
67-
return "Vertical"
68-
69-
7048
def active_mds_alert_values(threading_lock):
7149
"""
7250
This function validates the mds alerts using prometheus api
@@ -78,22 +56,15 @@ def active_mds_alert_values(threading_lock):
7856
api = prometheus.PrometheusAPI(threading_lock=threading_lock)
7957
alert_list = api.wait_for_alert(name=cpu_alert, state="pending")
8058
message = f"Ceph metadata server pod ({active_mds_pod}) has high cpu usage"
81-
82-
scaling_type = get_scaling_type(threading_lock)
83-
if scaling_type == "Horizontal":
84-
description_part = (
85-
" and cannot cope up with the current rate of mds requests."
86-
"\nPlease consider Horizontal scaling, by adding another MDS pod"
87-
)
88-
else:
89-
description_part = ". Please consider Vertical scaling, by adding more resources to the existing MDS pod"
9059
description = (
91-
f"Ceph metadata server pod ({active_mds_pod}) has high cpu usage {description_part}."
92-
"\nPlease see 'runbook_url' for more details."
60+
f"Ceph metadata server pod ({active_mds_pod}) has high cpu usage"
61+
f"\n. Please consider Vertical "
62+
f"\nscaling, by adding more resources to the existing MDS pod."
63+
f"\nPlease see 'runbook_url' for more details."
9364
)
9465
runbook = (
95-
"https://github.com/openshift/runbooks/blob/master/alerts/openshift-container-storage-operator"
96-
f"/CephMdsCPUUsageHighNeeds{scaling_type}Scaling.md"
66+
"https://github.com/openshift/runbooks/blob/master/alerts/"
67+
"openshift-container-storage-operator/CephMdsCPUUsageHighNeedsVerticalScaling.md"
9768
)
9869
severity = "warning"
9970
state = ["pending"]
@@ -139,5 +110,4 @@ def test_alert_triggered(self, run_file_creator_io_with_cephfs, threading_lock):
139110
"File creation IO started in the background."
140111
" Script will look for MDSCPUUsageHigh alert"
141112
)
142-
143113
assert active_mds_alert_values(threading_lock)

0 commit comments

Comments
 (0)