rancher / elemental

Elemental is an immutable Linux distribution built to run Rancher and its corresponding Kubernetes distributions RKE2 and k3s. It is built using the Elemental-toolkit
https://elemental.docs.rancher.com/
Apache License 2.0
295 stars 39 forks source link

Add Declarative Networking e2e test #1523

Open anmazzotti opened 1 month ago

anmazzotti commented 1 month ago

Docs:

This feature could use e2e testing. As bare minimum, we can:

  1. Provision a new Machine using Declarative Networking
  2. Verify it got the desired IP assigned
  3. Reset the Machine (by deleting the MachineInventory for example)
  4. Verify it got the desired IP assigned (after reset)

There is no need to test k8s provisioning, as we expect nothing to change during or due to provisioning.

The test environment will require 2 IPAM CRDs and the InCluster IPAM provider:

kubectl apply -f https://raw.githubusercontent.com/kubernetes-sigs/cluster-api/main/config/crd/bases/ipam.cluster.x-k8s.io_ipaddressclaims.yaml
kubectl apply -f https://raw.githubusercontent.com/kubernetes-sigs/cluster-api/main/config/crd/bases/ipam.cluster.x-k8s.io_ipaddresses.yaml
kubectl apply -f https://github.com/kubernetes-sigs/cluster-api-ipam-provider-in-cluster/releases/download/v0.1.0/ipam-components.yaml

Also note the OS image used need to have nmstatectl installed, so possibly this issue is a pre-requisite: https://github.com/rancher/elemental/issues/1519 Alternatively the nmstatectl can be simply installed from the released binaries: https://github.com/nmstate/nmstate/releases

anmazzotti commented 1 month ago

This could also be another pre-requisite: https://github.com/rancher/rancher/issues/46385

We should not be installing these CRDs manually, as we expect them to be included in Rancher. On that regard, we also don't know in which versions they will be included, 2.9.x only? 2.8.x too? 2.7.x maybe?

This could also influence the test.