From a9eb04195e41a01f59bd060bf83d52f4bc483055 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Wed, 18 Mar 2026 17:21:28 +0800 Subject: [PATCH] feat: introduce instance-manager-resources setting (#744) (#745) (cherry picked from commit 2ba471907e6b869352fb78bbadb76eb3c1f26bb2) Signed-off-by: Andy Lee Co-authored-by: Andy Lee --- .../settings/instance-manager-resources.vue | 104 ++++++++++++++++++ pkg/harvester/config/feature-flags.js | 1 + pkg/harvester/config/settings.ts | 6 +- pkg/harvester/l10n/en-us.yaml | 5 + 4 files changed, 115 insertions(+), 1 deletion(-) create mode 100644 pkg/harvester/components/settings/instance-manager-resources.vue diff --git a/pkg/harvester/components/settings/instance-manager-resources.vue b/pkg/harvester/components/settings/instance-manager-resources.vue new file mode 100644 index 00000000..58f879d5 --- /dev/null +++ b/pkg/harvester/components/settings/instance-manager-resources.vue @@ -0,0 +1,104 @@ + + + diff --git a/pkg/harvester/config/feature-flags.js b/pkg/harvester/config/feature-flags.js index ed56b5f0..75a7e536 100644 --- a/pkg/harvester/config/feature-flags.js +++ b/pkg/harvester/config/feature-flags.js @@ -63,6 +63,7 @@ const FEATURE_FLAGS = { 'supportBundleFileNameSetting', 'clusterRegistrationTLSVerify', 'vGPUAsPCIDevice', + 'instanceManagerResourcesSetting', ], }; diff --git a/pkg/harvester/config/settings.ts b/pkg/harvester/config/settings.ts index f29dd1e2..ac73427e 100644 --- a/pkg/harvester/config/settings.ts +++ b/pkg/harvester/config/settings.ts @@ -39,7 +39,8 @@ export const HCI_SETTING = { VM_MIGRATION_NETWORK: 'vm-migration-network', RANCHER_CLUSTER: 'rancher-cluster', MAX_HOTPLUG_RATIO: 'max-hotplug-ratio', - KUBEVIRT_MIGRATION: 'kubevirt-migration' + KUBEVIRT_MIGRATION: 'kubevirt-migration', + INSTANCE_MANAGER_RESOURCES: 'instance-manager-resources' }; export const HCI_ALLOWED_SETTINGS = { @@ -122,6 +123,9 @@ export const HCI_ALLOWED_SETTINGS = { }, [HCI_SETTING.KUBEVIRT_MIGRATION]: { kind: 'json', from: 'import', canReset: true, featureFlag: 'kubevirtMigration', + }, + [HCI_SETTING.INSTANCE_MANAGER_RESOURCES]: { + kind: 'json', from: 'import', featureFlag: 'instanceManagerResourcesSetting' } }; diff --git a/pkg/harvester/l10n/en-us.yaml b/pkg/harvester/l10n/en-us.yaml index 3c4bb299..04f847b4 100644 --- a/pkg/harvester/l10n/en-us.yaml +++ b/pkg/harvester/l10n/en-us.yaml @@ -1364,6 +1364,10 @@ harvester: ntpServers: isNotIPV4: The address you entered is not IPv4 or host. Please enter a valid IPv4 address or a host address. isDuplicate: There are duplicate NTP server configurations. + instanceManagerResources: + parseError: "Failed to parse configuration: {error}" + v1: "V1 Data Engine" + v2: "V2 Data Engine" kubevirtMigration: parseError: "Failed to parse configuration: {error}" parallelMigrationsPerCluster: "Parallel Migrations Per Cluster" @@ -1998,6 +2002,7 @@ advancedSettings: 'harv-rancher-cluster': 'Configure Rancher cluster integration settings for guest cluster management.' 'harv-max-hotplug-ratio': 'The ratio for kubevirt to limit the maximum CPU and memory that can be hotplugged to a VM. The value could be an integer between 1 and 20, default to 4.' 'harv-kubevirt-migration': 'Configure cluster-wide KubeVirt live migration parameters.' + 'harv-instance-manager-resources': 'Configure resource percentage reservations for Longhorn instance manager V1 and V2. Valid instance manager CPU range between 0 - 40.' typeLabel: kubevirt.io.virtualmachine: |-