-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add UI for setting inventory memory limits
There are currently knobs that can be used to adjust the memory limit for the `main` container, but not for the `inventory` container. This can cause the inventory container to go into a crash loop on a large deployment. Add the ability to bump the inventory memory limit to avoid this. Fixes: https://issues.redhat.com/browse/MTV-1504 Signed-off-by: Jonathon Jongsma <[email protected]>
- Loading branch information
Showing
3 changed files
with
74 additions
and
0 deletions.
There are no files selected for viewing
50 changes: 50 additions & 0 deletions
50
...ages/forklift-console-plugin/src/modules/Overview/modal/EditInventoryMemoryLimitModal.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import React from 'react'; | ||
import { EditModal, ModalInputComponentType } from 'src/modules/Providers/modals'; | ||
import { useForkliftTranslation } from 'src/utils/i18n'; | ||
|
||
import { ForkliftControllerModel } from '@kubev2v/types'; | ||
import { ModalVariant } from '@patternfly/react-core'; | ||
|
||
import { EditSettingsModalProps } from './EditSettingsModalProps'; | ||
import SettingsSelectInput from './SettingsSelectInput'; | ||
|
||
// Define the options | ||
const options = [ | ||
{ key: '400Mi', name: '400Mi', description: 'Low memory limit' }, | ||
{ key: '1000Mi', name: '1000Mi', description: 'Moderate memory limit' }, | ||
{ key: '2000Mi', name: '2000Mi', description: 'High memory limit' }, | ||
{ key: '8000Mi', name: '8000Mi', description: 'Very high memory limit' }, | ||
]; | ||
|
||
/** | ||
* InventoryMemoryLimitSelect component. | ||
* Wraps the SettingsSelectInput component with pre-defined options. | ||
* | ||
* @param {ModalInputComponentProps} props - Properties passed to the component | ||
* @returns {JSX.Element} | ||
*/ | ||
const InventoryMemoryLimitSelect: ModalInputComponentType = (props) => { | ||
return <SettingsSelectInput {...props} options={options} />; | ||
}; | ||
|
||
export const EditInventoryMemoryLimitModal: React.FC<EditSettingsModalProps> = (props) => { | ||
const { t } = useForkliftTranslation(); | ||
|
||
return ( | ||
<EditModal | ||
{...props} | ||
jsonPath={'spec.inventory_container_limits_memory'} | ||
title={props?.title || t('Edit Inventory Container Memory limit')} | ||
label={props?.label || t('Inventory Container Memory limit')} | ||
model={ForkliftControllerModel} | ||
variant={ModalVariant.small} | ||
body={t( | ||
'The limit for memory usage by the inventory container, specified in Megabytes (Mi). Default value is 1000Mi.', | ||
)} | ||
helperText={t( | ||
'Please enter the limit for memory usage by the inventory container in Mi, if empty default value will be used.', | ||
)} | ||
InputComponent={InventoryMemoryLimitSelect} | ||
/> | ||
); | ||
}; |
1 change: 1 addition & 0 deletions
1
packages/forklift-console-plugin/src/modules/Overview/modal/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters