Skip to content

Commit d242beb

Browse files
https://issues.redhat.com/browse/RHSTOR-7189
Signed-off-by: Timothy Asir <[email protected]>
1 parent 9584920 commit d242beb

File tree

6 files changed

+193
-37
lines changed

6 files changed

+193
-37
lines changed

locales/en/plugin__odf-console.json

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1041,7 +1041,18 @@
10411041
"Encrypts all Ceph traffic including data, using Ceph msgrv2": "Encrypts all Ceph traffic including data, using Ceph msgrv2",
10421042
"Verify your RHCS cluster has the necessary in-transit encryption settings configured to enable in-transit encryption on your external cluster. Refer to the documentation for detailed configuration steps.": "Verify your RHCS cluster has the necessary in-transit encryption settings configured to enable in-transit encryption on your external cluster. Refer to the documentation for detailed configuration steps.",
10431043
"Documentation link": "Documentation link",
1044+
"Data Foundation will use the default pod network": "Data Foundation will use the default pod network",
1045+
"If you require a custom network configuration, you can modify the network settings after deployment.": "If you require a custom network configuration, you can modify the network settings after deployment.",
1046+
"Isolate Network": "Isolate Network",
10441047
"Isolate network using Multus": "Isolate network using Multus",
1048+
"Multus allows a network separation between the data operations and the control plane operations.": "Multus allows a network separation between the data operations and the control plane operations.",
1049+
"Network Isolation Requirements": "Network Isolation Requirements",
1050+
"This will isolate network to attach additional clusters as external clients. Run Validation test before to proceed further.": "This will isolate network to attach additional clusters as external clients. Run Validation test before to proceed further.",
1051+
"Set up Multus by following relevant steps in KCS. Incorrectly setting up Multus might lead to:": "Set up Multus by following relevant steps in KCS. Incorrectly setting up Multus might lead to:",
1052+
"Data unavailability or loss due to broken internal communication": "Data unavailability or loss due to broken internal communication",
1053+
"Cluster health issues if network attachments are misconfigured": "Cluster health issues if network attachments are misconfigured",
1054+
"PVC mounting failures for ODF-dependent workloads": "PVC mounting failures for ODF-dependent workloads",
1055+
"By checking this box, you acknowledge running the validation test": "By checking this box, you acknowledge running the validation test",
10451056
"Public Network Interface": "Public Network Interface",
10461057
"Select NetworkAttachmentDefinition": "Select NetworkAttachmentDefinition",
10471058
"Cluster Network Interface": "Cluster Network Interface",
@@ -1755,6 +1766,7 @@
17551766
"Only lowercase letters, numbers, non-consecutive periods, or hyphens": "Only lowercase letters, numbers, non-consecutive periods, or hyphens",
17561767
"Cannot be used before": "Cannot be used before",
17571768
"Cannot be used before within the same namespace": "Cannot be used before within the same namespace",
1769+
"Cannot be empty": "Cannot be empty",
17581770
"Not enough usage data": "Not enough usage data",
17591771
"Total requests: ": "Total requests: ",
17601772
"used": "used",
@@ -1803,6 +1815,9 @@
18031815
"No resources available": "No resources available",
18041816
"Select {{resourceLabel}}": "Select {{resourceLabel}}",
18051817
"Error Loading": "Error Loading",
1818+
"no results": "no results",
1819+
"No results found for {{ filterValue }}": "No results found for {{ filterValue }}",
1820+
"Clear selected value": "Clear selected value",
18061821
"Loading empty page": "Loading empty page",
18071822
"You are not authorized to complete this action. See your cluster administrator for role-based access control information.": "You are not authorized to complete this action. See your cluster administrator for role-based access control information.",
18081823
"Not Authorized": "Not Authorized",
@@ -1866,6 +1881,7 @@
18661881
"Infrastructures": "Infrastructures",
18671882
"Subscriptions": "Subscriptions",
18681883
"Project": "Project",
1884+
"Suspended": "Suspended",
18691885
"Composable table": "Composable table",
18701886
"Selectable table": "Selectable table",
18711887
"Select all": "Select all",
@@ -1920,10 +1936,5 @@
19201936
"Cannot change resource name (original: \"{{name}}\", updated: \"{{newName}}\").": "Cannot change resource name (original: \"{{name}}\", updated: \"{{newName}}\").",
19211937
"Cannot change resource namespace (original: \"{{namespace}}\", updated: \"{{newNamespace}}\").": "Cannot change resource namespace (original: \"{{namespace}}\", updated: \"{{newNamespace}}\").",
19221938
"Cannot change resource kind (original: \"{{original}}\", updated: \"{{updated}}\").": "Cannot change resource kind (original: \"{{original}}\", updated: \"{{updated}}\").",
1923-
"Cannot change API group (original: \"{{apiGroup}}\", updated: \"{{newAPIGroup}}\").": "Cannot change API group (original: \"{{apiGroup}}\", updated: \"{{newAPIGroup}}\").",
1924-
"Cannot be empty": "Cannot be empty",
1925-
"no results": "no results",
1926-
"No results found for {{ filterValue }}": "No results found for {{ filterValue }}",
1927-
"Clear selected value": "Clear selected value",
1928-
"Suspended": "Suspended"
1939+
"Cannot change API group (original: \"{{apiGroup}}\", updated: \"{{newAPIGroup}}\").": "Cannot change API group (original: \"{{apiGroup}}\", updated: \"{{newAPIGroup}}\")."
19291940
}

packages/odf/components/create-storage-system/create-storage-system-steps/security-and-network-step/configure.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ export const NetworkFormGroup: React.FC<NetworkFormGroupProps> = ({
1919
clusterNetwork,
2020
publicNetwork,
2121
systemNamespace,
22+
isMultusAcknowledged,
23+
setIsMultusAcknowledged,
2224
}) => {
2325
const { t } = useCustomTranslation();
2426
const isFDF = useFlag(FDF_FLAG);
@@ -79,6 +81,8 @@ export const NetworkFormGroup: React.FC<NetworkFormGroupProps> = ({
7981
systemNamespace={systemNamespace}
8082
setNetworkType={(type: NetworkType) => setNetworkType(type)}
8183
networkType={networkType}
84+
isMultusAcknowledged={isMultusAcknowledged}
85+
setIsMultusAcknowledged={setIsMultusAcknowledged}
8286
/>
8387
)}
8488
</>
@@ -98,4 +102,6 @@ type NetworkFormGroupProps = {
98102
cephClusterCIDR: string;
99103
cephPublicCIDR: string;
100104
systemNamespace: WizardState['backingStorage']['systemNamespace'];
105+
isMultusAcknowledged: boolean;
106+
setIsMultusAcknowledged: (val: boolean) => void;
101107
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
.odf-default-network-alert {
2+
--pf-v5-c-alert--m-custom--BackgroundColor: var(--pf-v5-global--palette--blue-50);
3+
--pf-v5-c-alert--m-custom__icon--Color: var(--pf-v5-global--info-color--100);
4+
border-left: var(--pf-v5-global--BorderWidth--md) solid var(--pf-v5-global--palette--purple-400);
5+
}
6+
7+
.pf-v5-c-alert.pf-m-warning {
8+
--pf-v5-c-alert--BackgroundColor: var(--pf-v5-global--warning-color--100);
9+
border-left: var(--pf-v5-global--BorderWidth--md) solid var(--pf-v5-global--warning-color--200);
10+
}
11+
12+
.pf-v5-u-ml-md {
13+
margin-left: var(--pf-v5-global--spacer--md);
14+
}
15+
16+
.pf-v5-u-mb-sm {
17+
margin-bottom: var(--pf-v5-global--spacer--sm);
18+
}
19+
20+
.pf-v5-u-mb-md {
21+
margin-bottom: var(--pf-v5-global--spacer--md);
22+
}
23+
24+
.pf-v5-u-mt-md {
25+
margin-top: var(--pf-v5-global--spacer--md);
26+
}

packages/odf/components/create-storage-system/create-storage-system-steps/security-and-network-step/multus.tsx

Lines changed: 114 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,16 @@ import {
1616
useK8sWatchResources,
1717
WatchK8sResults,
1818
} from '@openshift-console/dynamic-plugin-sdk';
19-
import * as _ from 'lodash-es';
20-
import { Checkbox, FormGroup, SelectOption } from '@patternfly/react-core';
19+
import { flatMap } from 'lodash-es';
20+
import {
21+
Alert,
22+
AlertVariant,
23+
Checkbox,
24+
FormGroup,
25+
SelectOption,
26+
} from '@patternfly/react-core';
2127
import { WizardState } from '../../reducer';
28+
import './multus.scss';
2229

2330
type MultusWatchResourcesObject = {
2431
multus: NetworkAttachmentDefinitionKind[];
@@ -51,6 +58,8 @@ type MultusNetworkConfigurationComponentProps = {
5158
clusterNetwork: NetworkAttachmentDefinitionKind;
5259
publicNetwork: NetworkAttachmentDefinitionKind;
5360
systemNamespace: WizardState['backingStorage']['systemNamespace'];
61+
isMultusAcknowledged: boolean;
62+
setIsMultusAcknowledged: (val: boolean) => void;
5463
};
5564

5665
const reduceResourceLoadAndErrorStatus = <
@@ -79,35 +88,114 @@ export const MultusNetworkConfigurationComponent: React.FC<
7988
publicNetwork,
8089
networkType,
8190
systemNamespace,
91+
isMultusAcknowledged,
92+
setIsMultusAcknowledged,
8293
}) => {
8394
const { t } = useCustomTranslation();
95+
const handleMultusToggle = (_, checked) => {
96+
setNetworkType(checked ? NetworkType.MULTUS : NetworkType.DEFAULT);
97+
if (!checked) {
98+
setIsMultusAcknowledged(false);
99+
}
100+
};
101+
102+
const handleAcknowledgementChange = (_, checked) => {
103+
setIsMultusAcknowledged(checked);
104+
};
84105

85106
return (
86-
<>
87-
<Checkbox
88-
isChecked={networkType === NetworkType.MULTUS}
89-
onChange={() =>
90-
setNetworkType(
91-
networkType === NetworkType.DEFAULT
92-
? NetworkType.MULTUS
93-
: NetworkType.DEFAULT
94-
)
95-
}
96-
label={t('Isolate network using Multus')}
97-
description={t(
98-
'Multus allows a network seperation between the data operations and the control plane operations.'
107+
<div className="odf-multus-configuration">
108+
{/* Network Section */}
109+
<h2 className="odf-section-header">{t('Network')}</h2>
110+
<Alert
111+
data-test="odf-default-network-alert"
112+
className="odf-alert odf-mb-md"
113+
title={t('Data Foundation will use the default pod network')}
114+
variant={AlertVariant.info}
115+
isInline
116+
>
117+
{t(
118+
'If you require a custom network configuration, you can modify the network settings after deployment.'
99119
)}
100-
id="multus-checkbox"
101-
/>
102-
{networkType === NetworkType.MULTUS && (
103-
<MultusDropdown
104-
setNetwork={setNetwork}
105-
clusterNetwork={clusterNetwork}
106-
publicNetwork={publicNetwork}
107-
systemNamespace={systemNamespace}
120+
</Alert>
121+
122+
{/* Isolate Network Section */}
123+
<h2 className="odf-section-header odf-mt-lg">{t('Isolate Network')}</h2>
124+
<div className="odf-indented-section">
125+
<Checkbox
126+
isChecked={networkType === NetworkType.MULTUS}
127+
onChange={handleMultusToggle}
128+
label={t('Isolate network using Multus')}
129+
description={t(
130+
'Multus allows a network separation between the data operations and the control plane operations.'
131+
)}
132+
id="multus-checkbox"
133+
className="odf-mb-md"
108134
/>
109-
)}
110-
</>
135+
136+
{networkType === NetworkType.MULTUS && (
137+
<>
138+
<Alert
139+
variant={AlertVariant.warning}
140+
isInline
141+
title={t('Network Isolation Requirements')}
142+
className="odf-alert odf-mb-md"
143+
>
144+
<div className="odf-alert-content">
145+
<p className="odf-mb-sm">
146+
{t(
147+
'This will isolate network to attach additional clusters as external clients. Run Validation test before to proceed further.'
148+
)}
149+
</p>
150+
<p className="odf-mb-sm">
151+
{t(
152+
'Set up Multus by following relevant steps in KCS. Incorrectly setting up Multus might lead to:'
153+
)}
154+
</p>
155+
<ul className="odf-bullet-list">
156+
<li>
157+
{t(
158+
'Data unavailability or loss due to broken internal communication'
159+
)}
160+
</li>
161+
<li>
162+
{t(
163+
'Cluster health issues if network attachments are misconfigured'
164+
)}
165+
</li>
166+
<li>
167+
{t('PVC mounting failures for ODF-dependent workloads')}
168+
</li>
169+
</ul>
170+
</div>
171+
</Alert>
172+
173+
<div className="odf-indented-section">
174+
<Checkbox
175+
isChecked={isMultusAcknowledged}
176+
label={t(
177+
'By checking this box, you acknowledge running the validation test'
178+
)}
179+
onChange={handleAcknowledgementChange}
180+
id="acknowledgment-checkbox"
181+
className="odf-mb-md"
182+
/>
183+
</div>
184+
185+
{isMultusAcknowledged && (
186+
<div className="odf-indented-section">
187+
<MultusDropdown
188+
setNetwork={setNetwork}
189+
clusterNetwork={clusterNetwork}
190+
publicNetwork={publicNetwork}
191+
systemNamespace={systemNamespace}
192+
/>
193+
</div>
194+
)}
195+
</>
196+
)}
197+
</div>
198+
</div>
111199
);
112200
};
113201

@@ -153,7 +241,7 @@ export const MultusDropdown: React.FC<MultusDropdownProps> = ({
153241
});
154242

155243
if (resourcesLoaded && !resourcesLoadError) {
156-
const devices = _.flatMap(
244+
const devices = flatMap(
157245
Object.values(networkResources),
158246
(res) => res.data
159247
);

packages/odf/components/create-storage-system/create-storage-system-steps/security-and-network-step/security-and-network-step.tsx

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ export const SecurityAndNetwork: React.FC<SecurityAndNetworkProps> = ({
2424
publicNetwork,
2525
encryption,
2626
kms,
27+
isMultusAcknowledged,
2728
addressRanges: {
2829
cluster: [cephClusterCIDR],
2930
public: [cephPublicCIDR],
@@ -35,10 +36,11 @@ export const SecurityAndNetwork: React.FC<SecurityAndNetworkProps> = ({
3536
type: 'securityAndNetwork/setNetworkType',
3637
payload: networkType,
3738
});
38-
if (
39-
networkType === NetworkType.DEFAULT ||
40-
networkType === NetworkType.HOST
41-
) {
39+
if (networkType !== NetworkType.MULTUS) {
40+
dispatch({
41+
type: 'securityAndNetwork/setMultusAcknowledged',
42+
payload: false,
43+
});
4244
dispatch({ type: 'securityAndNetwork/setClusterNetwork', payload: null });
4345
dispatch({ type: 'securityAndNetwork/setPublicNetwork', payload: null });
4446
}
@@ -70,6 +72,16 @@ export const SecurityAndNetwork: React.FC<SecurityAndNetworkProps> = ({
7072
[dispatch]
7173
);
7274

75+
const setIsMultusAcknowledged = React.useCallback(
76+
(val: boolean) => {
77+
dispatch({
78+
type: 'securityAndNetwork/setMultusAcknowledged',
79+
payload: val,
80+
});
81+
},
82+
[dispatch]
83+
);
84+
7385
return (
7486
<Form noValidate={false}>
7587
<Encryption
@@ -91,6 +103,8 @@ export const SecurityAndNetwork: React.FC<SecurityAndNetworkProps> = ({
91103
clusterNetwork={clusterNetwork}
92104
publicNetwork={publicNetwork}
93105
systemNamespace={systemNamespace}
106+
isMultusAcknowledged={isMultusAcknowledged}
107+
setIsMultusAcknowledged={setIsMultusAcknowledged}
94108
/>
95109
)}
96110
{isExternal && (
@@ -106,7 +120,9 @@ export const SecurityAndNetwork: React.FC<SecurityAndNetworkProps> = ({
106120
};
107121

108122
type SecurityAndNetworkProps = {
109-
securityAndNetworkState: WizardState['securityAndNetwork'];
123+
securityAndNetworkState: WizardState['securityAndNetwork'] & {
124+
isMultusAcknowledged?: boolean;
125+
};
110126
dispatch: WizardDispatch;
111127
infraType: string;
112128
isExternal?: boolean;

packages/odf/components/create-storage-system/reducer.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ export const initialState: CreateStorageSystemState = {
114114
cluster: [],
115115
},
116116
networkType: NetworkType.DEFAULT,
117+
isMultusAcknowledged: false,
117118
},
118119
};
119120

@@ -167,6 +168,7 @@ type CreateStorageSystemState = {
167168
publicNetwork: NetworkAttachmentDefinitionKind;
168169
clusterNetwork: NetworkAttachmentDefinitionKind;
169170
addressRanges: AddressRanges;
171+
isMultusAcknowledged: boolean;
170172
networkType: NetworkType;
171173
};
172174
createLocalVolumeSet: LocalVolumeSet;
@@ -400,6 +402,9 @@ export const reducer: WizardReducer = (prevState, action) => {
400402
case 'capacityAndNodes/setVolumeValidationType':
401403
newState.capacityAndNodes.volumeValidationType = action.payload;
402404
break;
405+
case 'securityAndNetwork/setMultusAcknowledged':
406+
newState.securityAndNetwork.isMultusAcknowledged = action.payload;
407+
break;
403408
case 'securityAndNetwork/setKms':
404409
newState.securityAndNetwork.kms = action.payload;
405410
break;
@@ -521,6 +526,10 @@ export type CreateStorageSystemAction =
521526
type: 'capacityAndNodes/enableTaint';
522527
payload: WizardState['capacityAndNodes']['enableTaint'];
523528
}
529+
| {
530+
type: 'securityAndNetwork/setMultusAcknowledged';
531+
payload: boolean;
532+
}
524533
| {
525534
type: 'securityAndNetwork/setKms';
526535
payload: WizardState['securityAndNetwork']['kms'];

0 commit comments

Comments
 (0)