Skip to content

StoragePool creation changes for new 2 Nodes + 1 Arbiter cluster #2154

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

aruniiird
Copy link
Contributor

When we detect a 2 Nodes + 1 Arbiter cluster, we should only show, '2-way Replication' in 'Data protection policy' list

How is '2 Nodes + 1 Arbiter' cluster detected?
There is an entry in 'Infrastructure' CR's controlPlaneTopology status, value should be HighlyAvailableArbiter.

Comment on lines +256 to +257
if (state.isTwoNodeOneArbiterCluster) {
return replica === '2';
} else if (state.isArbiterCluster) {
return replica === '4';
} else {
return replica !== '4';
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The other way of writting the same looks like below,

(state.isTwoNodeOneArbiterCluster && replica === '2') ||
(state.isArbiterCluster && !state.isTwoNodeOneArbiterCluster && replica === '4') ||
(!state.isArbiterCluster && !state.isTwoNodeOneArbiterCluster && replica !== '4')

A simple if condition seemed to be much readable and understandable code.
Please let me know your thoughts

@aruniiird aruniiird force-pushed the storage-pool-creation-ui-changes-for-2node-1arb-cluster-setup branch from 7970644 to 259e6c7 Compare July 20, 2025 14:30
Copy link
Contributor

openshift-ci bot commented Jul 20, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: aruniiird
Once this PR has been reviewed and has the lgtm label, please assign alfonsomthd for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@aruniiird aruniiird force-pushed the storage-pool-creation-ui-changes-for-2node-1arb-cluster-setup branch from 259e6c7 to cd0d893 Compare July 22, 2025 08:35
Comment on lines +141 to +142
<p className="pf-v5-u-pt-sm">
<strong>{t('Note:')} </strong>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<p className="pf-v5-u-pt-sm">
<strong>{t('Note:')} </strong>
<p className="pf-v5-u-pt-sm pf-v5-u-font-weight-bold">
{t('Note:')}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not my change, I just enclosed it under a condition.
We don't have to show this Note/Text if it is a TNA cluster.
I think <strong> tag is only for the Note: section (of the message), rest of the message should come in normal way.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better to use a PF class.

};
};

export type PoolSpecType = {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of creating a new type, please complete the missing spec in https://github.com/alfonsomthd/odf-console/blob/master/packages/ocs/types.ts#L13

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BTW the Type siffix for types is redundant (not necessary).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ack

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not yet addressed

@aruniiird aruniiird force-pushed the storage-pool-creation-ui-changes-for-2node-1arb-cluster-setup branch from cd0d893 to 72d3d9b Compare July 22, 2025 12:02
@aruniiird aruniiird force-pushed the storage-pool-creation-ui-changes-for-2node-1arb-cluster-setup branch 3 times, most recently from 2ada5c3 to c1f916f Compare July 23, 2025 10:59
When we detect a 2 Nodes + 1 Arbiter cluster, we should only show,
'2-way Replication' in 'Data protection policy' list

How is '2 Nodes + 1 Arbiter' cluster detected?
There is an entry in 'Infrastructure' CR's `controlPlaneTopology` status,
value should be `HighlyAvailableArbiter`.

Added changes for 'StorageSystem' creation steps.

Signed-off-by: Arun Kumar Mohan <[email protected]>
@aruniiird aruniiird force-pushed the storage-pool-creation-ui-changes-for-2node-1arb-cluster-setup branch from c1f916f to d6f2525 Compare July 23, 2025 11:10
@aruniiird
Copy link
Contributor Author

Currently I have TWO issues,
a. The green arbiter label does not have the expected color and not aligned according to the UX design

UX design

image

Actual UI

image

b. Second issue is when you click on the Sortable arrow alonge the Name label (see the above actual UI screenshot), it is going in to a rotating state with a message PersistentVolumes are being provisioned on the selected nodes.

image

@@ -83,6 +87,12 @@ export const StoragePoolStatus: React.FC<StoragePoolStatusProps> = ({
);
};

export const isTwoNodePlusArbiterTopology = (
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Either move it to packages/shared/src/utils/common.ts (preferred) or remove the export as it is used in the same file.

{isTwoNodesOneArbiterClusterEnabled && (
<GridItem span={10}>
<Alert
title="2-Nodes and 1-Arbiter setup detected"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
title="2-Nodes and 1-Arbiter setup detected"
title={t('2-Nodes and 1-Arbiter setup detected')}

<GridItem span={10}>
<Alert
title="2-Nodes and 1-Arbiter setup detected"
variant="warning"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
variant="warning"
variant={AlertVariant.warning}

Comment on lines +60 to +61
const rolesArr = roles as string[];
const isArbiter = rolesArr.some((r) => r === 'arbiter');
Copy link
Collaborator

@alfonsomthd alfonsomthd Jul 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const rolesArr = roles as string[];
const isArbiter = rolesArr.some((r) => r === 'arbiter');
const isArbiter = (roles as WizardNodeState['roles']).some((r) => r === 'arbiter');

@@ -63,6 +67,11 @@ const SelectedNodesTableRow = ({ obj, activeColumnIDs }) => {
resourceModel={NodeModel}
resourceName={name}
/>
{isArbiter && (
<Label color="green" variant="filled">
Arbiter
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Arbiter
{t('Arbiter')}

@@ -95,6 +96,7 @@ const ConfirmationModal: React.FC<ConfirmationModalProps> = ({
stepIdReached,
ns,
nodes,
isThisTwoNodesOneArbiterCluster,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
isThisTwoNodesOneArbiterCluster,
isTwoNodesOneArbiterCluster,

@@ -346,6 +361,7 @@ export const CreateLocalVolumeSet: React.FC<CreateLocalVolumeSetProps> = ({
setErrorMessage={setLvsError}
storageClassName={storageClass.name}
stepIdReached={stepIdReached}
isThisTwoNodesOneArbiterCluster={isTwoNodesOneArbiterCluster}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
isThisTwoNodesOneArbiterCluster={isTwoNodesOneArbiterCluster}
isTwoNodesOneArbiterCluster={isTwoNodesOneArbiterCluster}

Comment on lines +168 to +170
const minNodes = isTwoNodesOneArbiterClusterDetected
? MINIMUM_NODES_FOR_TNA_CLUSTER
: MINIMUM_NODES;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see this logic repeated several times: you can create a shared util (DRY principle).

Comment on lines +542 to +545
// if it is a TNA cluster, set replica count to 2
const deviceSetReplica: number = isTwoNodesOneArbiterClusterEnabled
? 2
: getDeviceSetReplica(stretchClusterChecked, flexibleScaling, nodes);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMHO this logic should be inside getDeviceSetReplica to avoid potential errors when this function is called in other places.

Copy link
Collaborator

@alfonsomthd alfonsomthd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left some comments.

Copy link
Contributor

openshift-ci bot commented Jul 23, 2025

@aruniiird: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/odf-console-e2e-aws d6f2525 link true /test odf-console-e2e-aws

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@SanjalKatiyar
Copy link
Collaborator

Couple of things:

  1. On "Create local volume set" step we should display two-node-arbiter detected alert as well (this flow was missed by UX team entirely).
  2. On "Capacity and nodes" step, message u r showing under "Selected nodes" is wrong. Arbiter shouldn't be included as part of CPU/Memory calculation, also arbiter node won't be labelled as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants