From 89e14848844b55cf415d6d29c99f2e206a8e0f10 Mon Sep 17 00:00:00 2001 From: Andy Lee Date: Tue, 26 May 2026 12:13:59 +0800 Subject: [PATCH] feat: add natOutgoing option for custom subnet with corresponding tooltip (#878) * feat: add external connectivity option for subnets with corresponding tooltip Signed-off-by: Andy Lee * fix: remove gatewayType from subnet spec when not needed Signed-off-by: Andy Lee * refactor: update external connectivity feature to use NAT outgoing and improve tooltip descriptions Signed-off-by: Andy Lee * fix: update subnet creation to correctly handle natOutgoing and improve comment clarity Signed-off-by: Andy Lee * refactor: improve tooltip clarity for external connectivity NAT option Signed-off-by: Andy Lee --------- Signed-off-by: Andy Lee --- .../edit/kubeovn.io.subnet/index.vue | 34 +++++++++++++++---- pkg/harvester/l10n/en-us.yaml | 3 ++ 2 files changed, 30 insertions(+), 7 deletions(-) diff --git a/pkg/harvester/edit/kubeovn.io.subnet/index.vue b/pkg/harvester/edit/kubeovn.io.subnet/index.vue index d648e8e3..3ad6246c 100644 --- a/pkg/harvester/edit/kubeovn.io.subnet/index.vue +++ b/pkg/harvester/edit/kubeovn.io.subnet/index.vue @@ -43,18 +43,20 @@ export default { created() { const vpc = this.$route.query.vpc || ''; const enableDHCP = this.value?.spec?.enableDHCP || false; + const natOutgoing = this.value?.spec?.natOutgoing || false; set(this.value.spec, 'enableDHCP', enableDHCP); set(this.value, 'spec', this.value.spec || { - cidrBlock: '', - protocol: NETWORK_PROTOCOL.IPv4, - provider: '', + cidrBlock: '', + protocol: NETWORK_PROTOCOL.IPv4, + provider: '', vpc, - gatewayIP: '', - excludeIps: [], - private: false, + gateway: '', + excludeIps: [], + private: false, enableDHCP, - acls: [] + natOutgoing, + acls: [] }); }, @@ -129,6 +131,10 @@ export default { label: n.id, value: n.id, })); + }, + natOutgoingDisabled() { + // Disable the NAT Outgoing option when the subnet belongs to the ovn-cluster VPC and its name is join or ovn-default. + return this.value?.spec?.vpc === 'ovn-cluster' && ['join', 'ovn-default'].includes(this.value?.metadata?.name); } }, @@ -304,6 +310,20 @@ export default { +
+
+ +
+
KubOVN document tooltip: Enable DHCP server for this subnet. When enabled, VMs can automatically obtain IP addresses from this subnet. + externalConnectivity: + label: NAT Outgoing + tooltip: Enable NAT for VMs using this subnet to access external networks. private: label: Private Subnet tooltip: Enable network isolation for this Subnet. When enabled, VMs can only communicate within this subnet, even if other subnets exist under the same VPC.