From f6d53ffbe75df8c2ae0bfe084031c7ac62eb2a33 Mon Sep 17 00:00:00 2001 From: Hilda Stastna Date: Wed, 20 Sep 2023 14:46:24 +0200 Subject: [PATCH] CNV-33063: Add KSM to Cluster settings Add KSM (Kernel Samepage Merging) configuration to Cluster settings, under "Resource management" expandable section. Fixes https://issues.redhat.com/browse/CNV-33063 --- locales/en/plugin__kubevirt-plugin.json | 4 ++ .../SettingsTab/ClusterTab/ClusterTab.tsx | 3 ++ .../ResourceManagementSection.tsx | 19 ++++++++++ .../KernelSamepageMerging.scss | 15 ++++++++ .../KernelSamepageMerging.tsx | 37 +++++++++++++++++++ .../components/NodeSelectorConfiguration.scss | 5 +++ .../components/NodeSelectorConfiguration.tsx | 25 +++++++++++++ 7 files changed, 108 insertions(+) create mode 100644 src/views/clusteroverview/SettingsTab/ClusterTab/components/ResourceManagementSection/ResourceManagementSection.tsx create mode 100644 src/views/clusteroverview/SettingsTab/ClusterTab/components/ResourceManagementSection/components/KernelSamepageMerging/KernelSamepageMerging.scss create mode 100644 src/views/clusteroverview/SettingsTab/ClusterTab/components/ResourceManagementSection/components/KernelSamepageMerging/KernelSamepageMerging.tsx create mode 100644 src/views/clusteroverview/SettingsTab/ClusterTab/components/ResourceManagementSection/components/KernelSamepageMerging/components/NodeSelectorConfiguration.scss create mode 100644 src/views/clusteroverview/SettingsTab/ClusterTab/components/ResourceManagementSection/components/KernelSamepageMerging/components/NodeSelectorConfiguration.tsx diff --git a/locales/en/plugin__kubevirt-plugin.json b/locales/en/plugin__kubevirt-plugin.json index 74bd540ecc..fec6ec2ce4 100644 --- a/locales/en/plugin__kubevirt-plugin.json +++ b/locales/en/plugin__kubevirt-plugin.json @@ -544,8 +544,10 @@ "IP addresses": "IP addresses", "It may take several minutes until the clone is done and the VirtualMachine is ready.": "It may take several minutes until the clone is done and the VirtualMachine is ready.", "It seems that your browser does not trust the certificate of the upload proxy. {uploadProxyURL && (\n <>\n Please{' '}\n \n approve this certificate\n {' '}\n and try again\n \n )}": "It seems that your browser does not trust the certificate of the upload proxy. {uploadProxyURL && (\n <>\n Please{' '}\n \n approve this certificate\n {' '}\n and try again\n \n )}", + "Kernel Samepage Merging (KSM)": "Kernel Samepage Merging (KSM)", "key": "key", "Key": "Key", + "KSM is a memory-saving de-duplication feature designed to fit more VirtualMachines into physical memory by sharing the data common between them.": "KSM is a memory-saving de-duplication feature designed to fit more VirtualMachines into physical memory by sharing the data common between them.", "Kubernetes NMState Operator": "Kubernetes NMState Operator", "KV data transfer rate": "KV data transfer rate", "Label selectors let you select Nodes based on the value of one or more labels.": "Label selectors let you select Nodes based on the value of one or more labels.", @@ -741,6 +743,7 @@ "Node labels": "Node labels", "Node port": "Node port", "Node selector": "Node selector", + "Node selector configuration": "Node selector configuration", "Nodes": "Nodes", "None": "None", "Not available": "Not available", @@ -871,6 +874,7 @@ "Reset": "Reset", "Resource": "Resource", "Resource already selected": "Resource already selected", + "Resource management": "Resource management", "Resource name": "Resource name", "Resources": "Resources", "Resources are being removed, please wait.": "Resources are being removed, please wait.", diff --git a/src/views/clusteroverview/SettingsTab/ClusterTab/ClusterTab.tsx b/src/views/clusteroverview/SettingsTab/ClusterTab/ClusterTab.tsx index 18b7299711..60300a7827 100644 --- a/src/views/clusteroverview/SettingsTab/ClusterTab/ClusterTab.tsx +++ b/src/views/clusteroverview/SettingsTab/ClusterTab/ClusterTab.tsx @@ -7,6 +7,7 @@ import EnableLoadBalancerSection from './components/EnableLoadBalancerSection/En import EnablePreviewFeaturesSection from './components/EnablePreviewFeaturesSection/EnablePreviewFeaturesSection'; import GeneralInformation from './components/GeneralInformation/GeneralInformation'; import LiveMigrationSection from './components/LiveMigrationSection/LiveMigrationSection'; +import ResourceManagementSection from './components/ResourceManagementSection/ResourceManagementSection'; import TemplatesProjectSection from './components/TemplatesProjectSection/TemplatesProjectSection'; const ClusterTab: FC = () => { @@ -22,6 +23,8 @@ const ClusterTab: FC = () => { + + ); }; diff --git a/src/views/clusteroverview/SettingsTab/ClusterTab/components/ResourceManagementSection/ResourceManagementSection.tsx b/src/views/clusteroverview/SettingsTab/ClusterTab/components/ResourceManagementSection/ResourceManagementSection.tsx new file mode 100644 index 0000000000..e1a2031f2e --- /dev/null +++ b/src/views/clusteroverview/SettingsTab/ClusterTab/components/ResourceManagementSection/ResourceManagementSection.tsx @@ -0,0 +1,19 @@ +import React, { FC } from 'react'; + +import { useKubevirtTranslation } from '@kubevirt-utils/hooks/useKubevirtTranslation'; + +import ExpandSection from '../../../ExpandSection/ExpandSection'; + +import KernelSamepageMerging from './components/KernelSamepageMerging/KernelSamepageMerging'; + +const ResourceManagementSection: FC = () => { + const { t } = useKubevirtTranslation(); + + return ( + + + + ); +}; + +export default ResourceManagementSection; diff --git a/src/views/clusteroverview/SettingsTab/ClusterTab/components/ResourceManagementSection/components/KernelSamepageMerging/KernelSamepageMerging.scss b/src/views/clusteroverview/SettingsTab/ClusterTab/components/ResourceManagementSection/components/KernelSamepageMerging/KernelSamepageMerging.scss new file mode 100644 index 0000000000..d9a1cdf9de --- /dev/null +++ b/src/views/clusteroverview/SettingsTab/ClusterTab/components/ResourceManagementSection/components/KernelSamepageMerging/KernelSamepageMerging.scss @@ -0,0 +1,15 @@ +.KernelSamepageMerging { + &__ExpandSection { + padding-left: var(--pf-global--spacer--lg); + } + + &__HelpIcon { + color: var(--pf-global--Color--100); + } + + &__HelpTextIcon { + .pf-c-popover__content { + width: 400px; + } + } +} diff --git a/src/views/clusteroverview/SettingsTab/ClusterTab/components/ResourceManagementSection/components/KernelSamepageMerging/KernelSamepageMerging.tsx b/src/views/clusteroverview/SettingsTab/ClusterTab/components/ResourceManagementSection/components/KernelSamepageMerging/KernelSamepageMerging.tsx new file mode 100644 index 0000000000..ff1c49116c --- /dev/null +++ b/src/views/clusteroverview/SettingsTab/ClusterTab/components/ResourceManagementSection/components/KernelSamepageMerging/KernelSamepageMerging.tsx @@ -0,0 +1,37 @@ +import React, { FC } from 'react'; +import ExpandSection from 'src/views/clusteroverview/SettingsTab/ExpandSection/ExpandSection'; + +import HelpTextIcon from '@kubevirt-utils/components/HelpTextIcon/HelpTextIcon'; +import { useKubevirtTranslation } from '@kubevirt-utils/hooks/useKubevirtTranslation'; +import { PopoverPosition } from '@patternfly/react-core'; + +import NodeSelectorConfiguration from './components/NodeSelectorConfiguration'; + +import './KernelSamepageMerging.scss'; + +const KernelSamepageMerging: FC = () => { + const { t } = useKubevirtTranslation(); + + return ( + + {t('Kernel Samepage Merging (KSM)')}{' '} + + + } + className="KernelSamepageMerging__ExpandSection" + > + + + ); +}; + +export default KernelSamepageMerging; diff --git a/src/views/clusteroverview/SettingsTab/ClusterTab/components/ResourceManagementSection/components/KernelSamepageMerging/components/NodeSelectorConfiguration.scss b/src/views/clusteroverview/SettingsTab/ClusterTab/components/ResourceManagementSection/components/KernelSamepageMerging/components/NodeSelectorConfiguration.scss new file mode 100644 index 0000000000..5c8b3a3026 --- /dev/null +++ b/src/views/clusteroverview/SettingsTab/ClusterTab/components/ResourceManagementSection/components/KernelSamepageMerging/components/NodeSelectorConfiguration.scss @@ -0,0 +1,5 @@ +.KernelSamepageMerging { + &__ExpandSection > * { + padding-left: var(--pf-global--spacer--lg); + } +} diff --git a/src/views/clusteroverview/SettingsTab/ClusterTab/components/ResourceManagementSection/components/KernelSamepageMerging/components/NodeSelectorConfiguration.tsx b/src/views/clusteroverview/SettingsTab/ClusterTab/components/ResourceManagementSection/components/KernelSamepageMerging/components/NodeSelectorConfiguration.tsx new file mode 100644 index 0000000000..bebe18101b --- /dev/null +++ b/src/views/clusteroverview/SettingsTab/ClusterTab/components/ResourceManagementSection/components/KernelSamepageMerging/components/NodeSelectorConfiguration.tsx @@ -0,0 +1,25 @@ +import React, { FC } from 'react'; + +import { useKubevirtTranslation } from '@kubevirt-utils/hooks/useKubevirtTranslation'; +import { Button } from '@patternfly/react-core'; +import { PencilAltIcon } from '@patternfly/react-icons'; + +import './NodeSelectorConfiguration.scss'; + +const NodeSelectorConfiguration: FC = () => { + const { t } = useKubevirtTranslation(); + + return ( + + ); +}; + +export default NodeSelectorConfiguration;