Skip to content

feat(kubeovn): add KubeOVN VPC, Subnet resources and IP data source (Phase 1)#176

Open
jniedergang wants to merge 3 commits intoharvester:masterfrom
jniedergang:upstream-kubeovn-core
Open

feat(kubeovn): add KubeOVN VPC, Subnet resources and IP data source (Phase 1)#176
jniedergang wants to merge 3 commits intoharvester:masterfrom
jniedergang:upstream-kubeovn-core

Conversation

@jniedergang
Copy link

Summary

  • Add harvester_kubeovn_vpc resource and data source (VPC lifecycle, static/policy routes, enable_external, enable_bfd)
  • Add harvester_kubeovn_subnet resource and data source (subnet with all KubeOVN options)
  • Add harvester_kubeovn_ip data source (read-only, IPs auto-managed by KubeOVN)
  • Add KubeOVN typed Go client (github.com/kubeovn/kube-ovn v1.13.0)
  • VPC delete includes retry loop for subnet cleanup race condition
  • Unit tests for all 3 importers

Depends on: #175 (harvester_addon resource)

Related issue: harvester/harvester#10144

Test plan

Tested on Harvester v1.6.1 with KubeOVN v1.13.13:

  1. Enable kubeovn-operator addon via harvester_addon → 21 KubeOVN CRDs deployed
  2. Create VPC + Subnet → verified with kubectl get vpc,subnet
  3. terraform plan → 0 changes (idempotent, no drift on server-side defaults like policyDst)
  4. Update in-place (enable_bfd toggle) → applied cleanly
  5. terraform destroy → subnet deleted before VPC (retry handles race), all resources cleaned up
  6. Data sources correctly read VPC/Subnet attributes (default_subnet, v4_available_ips, etc.)

Terraform Provider Developer 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>
@jniedergang jniedergang changed the title feat(kubeovn): add KubeOVN VPC, Subnet resources and IP data source feat(kubeovn): add KubeOVN VPC, Subnet resources and IP data source (Phase 1) Mar 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant