feat(kubeovn): add KubeOVN VPC, Subnet resources and IP data source (Phase 1)#176
Open
jniedergang wants to merge 3 commits intoharvester:masterfrom
Open
feat(kubeovn): add KubeOVN VPC, Subnet resources and IP data source (Phase 1)#176jniedergang wants to merge 3 commits intoharvester:masterfrom
jniedergang wants to merge 3 commits intoharvester:masterfrom
Conversation
added 3 commits
March 6, 2026 00:02
Add Terraform resource and data source for managing Harvester addons (pcidevices-controller, nvidia-driver-toolkit, vm-import-controller, harvester-seeder). Addons are pre-existing in Harvester and cannot be created or deleted via the API - Create enables/configures the addon, Delete disables it. Schema fields: - enabled (bool): enable/disable the addon - values_content (string): Helm values YAML configuration - repo, chart, version (computed): read-only addon metadata - state (computed): addon deployment status Includes unit tests for the importer with coverage for enabled, disabled, and nil labels/annotations cases. Signed-off-by: Terraform Provider Developer <terraform@harvester.local>
Add Phase 1 core networking support for KubeOVN SDN addon: - Add kube-ovn v1.13.0 typed client to pkg/client - harvester_kubeovn_vpc: resource + datasource for OVN virtual private clouds with static routes, policy routes, namespace binding - harvester_kubeovn_subnet: resource + datasource for OVN subnets with CIDR, gateway, DHCP, NAT, LB, private/allow controls - harvester_kubeovn_ip: datasource for reading pod IP assignments - Unit tests for all three importers - Terraform examples for all resources and datasources All resources are cluster-scoped (NonNamespacedSchemaWrap) matching KubeOVN CRD definitions. Requires kubeovn-operator addon to be enabled. Signed-off-by: Terraform Provider Developer <terraform@harvester.local>
- Rename subnet `provider` field to `network_provider` to avoid Terraform reserved field name conflict - Make VPC static_routes `policy` field Computed (KubeOVN server sets default `policyDst`), add `policyDst` to validation - Add retry loop to VPC delete to handle subnet cleanup race condition (KubeOVN webhook rejects VPC deletion while subnets still exist) Tested on Harvester v1.6.1 with KubeOVN v1.13.13: - Create VPC + Subnet: OK - Idempotence (0 changes): OK - Update in-place: OK - Destroy (subnet before VPC): OK - Datasources read: OK Signed-off-by: Terraform Provider Developer <terraform@harvester.local>
This was referenced Mar 6, 2026
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
harvester_kubeovn_vpcresource and data source (VPC lifecycle, static/policy routes, enable_external, enable_bfd)harvester_kubeovn_subnetresource and data source (subnet with all KubeOVN options)harvester_kubeovn_ipdata source (read-only, IPs auto-managed by KubeOVN)github.com/kubeovn/kube-ovn v1.13.0)Depends on: #175 (
harvester_addonresource)Related issue: harvester/harvester#10144
Test plan
Tested on Harvester v1.6.1 with KubeOVN v1.13.13:
kubeovn-operatoraddon viaharvester_addon→ 21 KubeOVN CRDs deployedkubectl get vpc,subnetterraform plan→ 0 changes (idempotent, no drift on server-side defaults likepolicyDst)enable_bfdtoggle) → applied cleanlyterraform destroy→ subnet deleted before VPC (retry handles race), all resources cleaned updefault_subnet,v4_available_ips, etc.)