diff --git a/.github/filters.yml b/.github/filters.yml index 1d246226d..b1272882f 100644 --- a/.github/filters.yml +++ b/.github/filters.yml @@ -4,6 +4,7 @@ src: kubeadm: - templates/flavors/kubeadm/default/* + - e2e/capl-cluster-flavors/kubeadm-capl-cluster/* kubeadm_cluster-autoscaler: - templates/flavors/kubeadm/cluster-autoscaler/* kubeadm_dual-stack: @@ -23,6 +24,7 @@ kubeadm_vpcless: k3s: - templates/flavors/k3s/default/* + - e2e/capl-cluster-flavors/k3s-capl-cluster/* k3s_cluster-autoscaler: - templates/flavors/k3s/cluster-autoscaler/* k3s_dual-stack: @@ -40,6 +42,7 @@ k3s_vpcless: rke2: - templates/flavors/rke2/default/* + - e2e/capl-cluster-flavors/rke2-capl-cluster/* rke2_cluster-autoscaler: - templates/flavors/rke2/cluster-autoscaler/* rke2_etcd-backup-restore: diff --git a/docs/src/developers/development.md b/docs/src/developers/development.md index 0f5e21d5d..07a281dbc 100644 --- a/docs/src/developers/development.md +++ b/docs/src/developers/development.md @@ -164,13 +164,12 @@ infrastructure-local-linode/v0.0.0 └── metadata.yaml ``` -This can then be used with `clusterctl` by adding the following to `~/.clusterctl/cluster-api.yaml` -(assuming the repo exists in the `$HOME` directory): +This can then be used with `clusterctl` by adding the following to `~/.cluster-api/clusterctl.yaml`: ``` providers: - name: local-linode - url: ${HOME}/cluster-api-provider-linode/infrastructure-local-linode/v0.0.0/infrastructure-components.yaml + url: ${PWD}/infrastructure-local-linode/v0.0.0/infrastructure-components.yaml type: InfrastructureProvider ``` @@ -273,10 +272,6 @@ export LINODE_REGION=us-sea export LINODE_CONTROL_PLANE_MACHINE_TYPE=g6-standard-2 export LINODE_MACHINE_TYPE=g6-standard-2 -# IMPORTANT: Set linode, k3s, and rke2 providers in this config file. -# Find an example at e2e/gha-clusterctl-config.yaml -export CLUSTERCTL_CONFIG=~/.cluster-api/clusterctl.yaml - make e2etest ``` diff --git a/docs/src/developers/testing.md b/docs/src/developers/testing.md index d920e39bb..998b5f58b 100644 --- a/docs/src/developers/testing.md +++ b/docs/src/developers/testing.md @@ -189,6 +189,16 @@ For e2e tests CAPL uses the [Chainsaw project](https://kyverno.github.io/chainsa spin up a cluster with the CAPL controllers installed and then uses `chainsaw-test.yaml` files to drive e2e testing. All test live in the e2e folder with a directory structure of `e2e/${COMPONENT}/${TEST_NAME}` + +### Environment Setup +The e2e tests use the `local-linode` infrastructure provider, this is registered by adding the following to `~/.cluster-api/clusterctl.yaml`: +``` +providers: + - name: local-linode + url: ${PWD}/infrastructure-local-linode/v0.0.0/infrastructure-components.yaml + type: InfrastructureProvider +``` + ### Running Tests In order to run e2e tests run the following commands: ```bash @@ -199,10 +209,6 @@ export LINODE_REGION=us-sea export LINODE_CONTROL_PLANE_MACHINE_TYPE=g6-standard-2 export LINODE_MACHINE_TYPE=g6-standard-2 -# IMPORTANT: Set linode, k3s, and rke2 providers in this config file. -# Find an example at e2e/gha-clusterctl-config.yaml -export CLUSTERCTL_CONFIG=~/.cluster-api/clusterctl.yaml - make e2etest ``` *Note: By default `make e2etest` runs all the e2e tests defined under `/e2e` dir* @@ -219,18 +225,18 @@ make e2etest E2E_SELECTOR='flavors' E2E_FLAGS='--assert-timeout 10m0s' There are other selectors you can use to invoke specfic tests. Please look at the table below for all the selectors available: -| Tests | Selector | -|----------------------------------|-------------------| -| All Tests | `all` | -| All Controllers | `quick` | -| All Flavors (default, k3s, rke2) | `flavors` | -| K3S Cluster | `k3s` | -| RKE2 Cluster | `rke2` | -| Default (kubeadm) Cluster | `default-cluster` | -| Linode Cluster Controller | `linodecluster` | -| Linode Machine Controller | `linodemachine` | -| Linode Obj Controller | `linodeobj` | -| Linode VPC Controller | `linodevpc` | +| Tests | Selector | +|----------------------------------|-----------------| +| All Tests | `all` | +| All Controllers | `quick` | +| All Flavors (default, k3s, rke2) | `flavors` | +| K3S Cluster | `k3s` | +| RKE2 Cluster | `rke2` | +| Default (kubeadm) Cluster | `kubeadm` | +| Linode Cluster Controller | `linodecluster` | +| Linode Machine Controller | `linodemachine` | +| Linode Obj Controller | `linodeobj` | +| Linode VPC Controller | `linodevpc` | *Note: For any flavor e2e tests, please set the required env variables* diff --git a/docs/src/topics/getting-started.md b/docs/src/topics/getting-started.md index 3106db3a8..e1c1be9da 100644 --- a/docs/src/topics/getting-started.md +++ b/docs/src/topics/getting-started.md @@ -36,16 +36,10 @@ to provision the node. If you are using a custom image ensure the [cloud_init](h By default, clusters are provisioned within VPC. For Regions which do not have [VPC support](https://www.linode.com/docs/products/networking/vpc/#availability) yet, use the [VPCLess](./flavors/vpcless.md) flavor to have clusters provisioned. ``` -## Register linode as an infrastructure provider -1. Add `linode` as an infrastructure provider in `~/.cluster-api/clusterctl.yaml` - ```yaml - providers: - - name: linode-linode - url: https://github.com/linode/cluster-api-provider-linode/releases/latest/infrastructure-components.yaml - type: InfrastructureProvider - ``` - ## Install CAPL on your management cluster +```admonish warning +The `linode-linode` infrastructure provider requires clusterctl version 1.7.2 or higher +``` Install CAPL and enable the helm addon provider which is used by the majority of the CAPL flavors ```bash clusterctl init --infrastructure linode-linode --addon helm diff --git a/e2e/capl-cluster-flavors/rke2-capl-cluster/chainsaw-test.yaml b/e2e/capl-cluster-flavors/rke2-capl-cluster/chainsaw-test.yaml index 5fa77f047..8fb136d95 100755 --- a/e2e/capl-cluster-flavors/rke2-capl-cluster/chainsaw-test.yaml +++ b/e2e/capl-cluster-flavors/rke2-capl-cluster/chainsaw-test.yaml @@ -2,7 +2,6 @@ apiVersion: chainsaw.kyverno.io/v1alpha1 kind: Test metadata: - creationTimestamp: null name: rke2-capl-cluster # Labels to allow the test to be triggered based on selector flag labels: diff --git a/e2e/gha-clusterctl-config.yaml b/e2e/gha-clusterctl-config.yaml index 460e1b6fb..b67fcc0e3 100644 --- a/e2e/gha-clusterctl-config.yaml +++ b/e2e/gha-clusterctl-config.yaml @@ -1,6 +1,6 @@ providers: - name: local-linode - url: /home/runner/work/cluster-api-provider-linode/cluster-api-provider-linode/infrastructure-local-linode/v0.0.0/infrastructure-components.yaml + url: ${PWD}/infrastructure-local-linode/v0.0.0/infrastructure-components.yaml type: InfrastructureProvider - name: "k3s" url: https://github.com/k3s-io/cluster-api-k3s/releases/latest/bootstrap-components.yaml @@ -8,9 +8,3 @@ providers: - name: "k3s" url: https://github.com/k3s-io/cluster-api-k3s/releases/latest/control-plane-components.yaml type: "ControlPlaneProvider" - - name: "rke2" - url: "https://github.com/rancher-sandbox/cluster-api-provider-rke2/releases/latest/bootstrap-components.yaml" - type: "BootstrapProvider" - - name: "rke2" - url: "https://github.com/rancher-sandbox/cluster-api-provider-rke2/releases/latest/control-plane-components.yaml" - type: "ControlPlaneProvider"