Skip to content

Commit 5ff88b3

Browse files
committed
Update docs for beta ClusterResourceSet
1 parent 6daf4ac commit 5ff88b3

File tree

7 files changed

+21
-27
lines changed

7 files changed

+21
-27
lines changed

config/manager/manager.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ spec:
2323
- "--leader-elect"
2424
- "--diagnostics-address=${CAPI_DIAGNOSTICS_ADDRESS:=:8443}"
2525
- "--insecure-diagnostics=${CAPI_INSECURE_DIAGNOSTICS:=false}"
26-
- "--feature-gates=MachinePool=${EXP_MACHINE_POOL:=false},ClusterResourceSet=${EXP_CLUSTER_RESOURCE_SET:=false},ClusterTopology=${CLUSTER_TOPOLOGY:=false},RuntimeSDK=${EXP_RUNTIME_SDK:=false},MachineSetPreflightChecks=${EXP_MACHINE_SET_PREFLIGHT_CHECKS:=false}"
26+
- "--feature-gates=MachinePool=${EXP_MACHINE_POOL:=false},ClusterResourceSet=${EXP_CLUSTER_RESOURCE_SET:=true},ClusterTopology=${CLUSTER_TOPOLOGY:=false},RuntimeSDK=${EXP_RUNTIME_SDK:=false},MachineSetPreflightChecks=${EXP_MACHINE_SET_PREFLIGHT_CHECKS:=false}"
2727
image: controller:latest
2828
name: manager
2929
env:

docs/book/src/developer/testing.md

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ if this is not possible, a viable solution is to use mocks (e.g CAPA).
2727

2828
### Generic providers
2929
When writing tests core Cluster API contributors should ensure that the code works with any providers, and thus it is required
30-
to not use any specific provider implementation. Instead, the so-called generic providers e.g. "GenericInfrastructureCluster"
31-
should be used because they implement the plain Cluster API contract. This prevents tests from relying on assumptions that
30+
to not use any specific provider implementation. Instead, the so-called generic providers e.g. "GenericInfrastructureCluster"
31+
should be used because they implement the plain Cluster API contract. This prevents tests from relying on assumptions that
3232
may not hold true in all cases.
3333

3434
Please note that in the long term we would like to improve the implementation of generic providers, centralizing
@@ -46,11 +46,11 @@ the test cluster.
4646
With this approach it is possible to interact with Cluster API almost like in a real environment, by creating/updating
4747
Kubernetes objects and waiting for the controllers to take action. See the [quick reference](#quick-reference) below for more details.
4848

49-
Also in case of integration tests, considerations about [mocking external APIs](#mocking-external-apis) and usage of [generic providers](#generic-providers) apply.
49+
Also in case of integration tests, considerations about [mocking external APIs](#mocking-external-apis) and usage of [generic providers](#generic-providers) apply.
5050

5151
## Fuzzing tests
5252

53-
Fuzzing tests automatically inject randomly generated inputs, often invalid or with unexpected values, into functions to discover vulnerabilities.
53+
Fuzzing tests automatically inject randomly generated inputs, often invalid or with unexpected values, into functions to discover vulnerabilities.
5454

5555
Two different types of fuzzing are currently being used on the Cluster API repository:
5656

@@ -78,7 +78,7 @@ In light of continuing improving our practice around this ambitious goal, we are
7878

7979
Each contribution in growing this set of utilities or their adoption across the codebase is more than welcome!
8080

81-
Another consideration that can help in improving test maintainability is the idea of testing "by layers"; this idea could
81+
Another consideration that can help in improving test maintainability is the idea of testing "by layers"; this idea could
8282
apply whenever we are testing "higher-level" functions that internally uses one or more "lower-level" functions;
8383
in order to avoid writing/maintaining redundant tests, whenever possible contributors should take care of testing
8484
_only_ the logic that is implemented in the "higher-level" function, delegating the test function called internally
@@ -243,28 +243,27 @@ Execute the run configuration with `Debug`.
243243

244244
<h1>Tips</h1>
245245

246-
The e2e tests create a new management cluster with kind on each run. To avoid this and speed up the test execution the tests can
246+
The e2e tests create a new management cluster with kind on each run. To avoid this and speed up the test execution the tests can
247247
also be run against a management cluster created by [tilt](./tilt.md):
248248
```bash
249249
# Create a kind cluster
250250
./hack/kind-install-for-capd.sh
251251
# Set up the management cluster via tilt
252-
tilt up
252+
tilt up
253253
```
254254
Now you can start the e2e test via IDE as described above but with the additional `-e2e.use-existing-cluster=true` flag.
255255

256256
**Note**: This can also be used to debug controllers during e2e tests as described in [Developing Cluster API with Tilt](./tilt.md#wiring-up-debuggers).
257257

258-
The e2e tests also create a local clusterctl repository. After it has been created on a first test execution this step can also be
259-
skipped by setting `-e2e.clusterctl-config=<ARTIFACTS>/repository/clusterctl-config.yaml`. This also works with a clusterctl repository created
258+
The e2e tests also create a local clusterctl repository. After it has been created on a first test execution this step can also be
259+
skipped by setting `-e2e.clusterctl-config=<ARTIFACTS>/repository/clusterctl-config.yaml`. This also works with a clusterctl repository created
260260
via [Create the local repository](http://localhost:3000/clusterctl/developers.html#create-the-local-repository).
261261

262262
**Feature gates**: E2E tests often use features which need to be enabled first. Make sure to enable the feature gates in the tilt settings file:
263263
```yaml
264264
kustomize_substitutions:
265265
CLUSTER_TOPOLOGY: "true"
266266
EXP_MACHINE_POOL: "true"
267-
EXP_CLUSTER_RESOURCE_SET: "true"
268267
EXP_KUBEADM_BOOTSTRAP_FORMAT_IGNITION: "true"
269268
EXP_RUNTIME_SDK: "true"
270269
EXP_MACHINE_SET_PREFLIGHT_CHECKS: "true"
@@ -352,7 +351,7 @@ As alternative to loki, JSON logs can be visualized with a human readable timest
352351

353352
The `(. | tostring)` part could also be customized to only output parts of the JSON logline.
354353
E.g.:
355-
354+
356355
* `(.err)` to only output the error message part.
357356
* `(.msg)` to only output the message part.
358357
* `(.controller + " " + .msg)` to output the controller name and message part.
@@ -405,7 +404,7 @@ func TestMain(m *testing.M) {
405404
```
406405

407406
Most notably, [envtest] provides not only a real API server to use during testing, but it offers the opportunity
408-
to configure one or more controllers to run against the test cluster, as well as creating informers index.
407+
to configure one or more controllers to run against the test cluster, as well as creating informers index.
409408

410409
```golang
411410
func TestMain(m *testing.M) {
@@ -423,7 +422,7 @@ func TestMain(m *testing.M) {
423422
if err := index.AddDefaultIndexes(ctx, mgr); err != nil {
424423
panic(fmt.Sprintf("unable to setup index: %v", err))
425424
}
426-
425+
427426
// Run tests
428427
...
429428
}
@@ -440,8 +439,8 @@ should take care in ensuring each test runs in isolation from the others, by:
440439
- Avoiding object name conflict.
441440

442441
Developers should also be aware of the fact that the informers cache used to access the [envtest]
443-
depends on actual etcd watches/API calls for updates, and thus it could happen that after creating
444-
or deleting objects the cache takes a few milliseconds to get updated. This can lead to test flakes,
442+
depends on actual etcd watches/API calls for updates, and thus it could happen that after creating
443+
or deleting objects the cache takes a few milliseconds to get updated. This can lead to test flakes,
445444
and thus it always recommended to use patterns like create and wait or delete and wait; Cluster API env
446445
test provides a set of utils for this scope.
447446

@@ -530,7 +529,7 @@ comes with a set of limitations that could hamper the validity of a test, most n
530529
of the test objects.
531530
- the [fakeclient] does not use a cache based on informers/API calls/etcd watches, so the test written in this way
532531
can't help in surfacing race conditions related to how those components behave in real cluster.
533-
- there is no support for cache index/operations using cache indexes.
532+
- there is no support for cache index/operations using cache indexes.
534533

535534
Accordingly, using [fakeclient] is not suitable for all the use cases, so in some cases contributors will be required
536535
to use [envtest] instead. In case of doubts about which one to use when writing tests, don't hesitate to ask for

docs/book/src/developer/tilt.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ enable_providers:
4646
- kubeadm-control-plane
4747
```
4848
49-
To use tilt to launch a provider with its own repo, using Cluster API Provider AWS here, `tilt-settings.yaml` should look like:
49+
To use tilt to launch a provider with its own repo, using Cluster API Provider AWS here, `tilt-settings.yaml` should look like:
5050

5151
```yaml
5252
default_registry: gcr.io/your-project-name-here
@@ -109,7 +109,6 @@ provider's yaml. These substitutions are also used when deploying cluster templa
109109
kustomize_substitutions:
110110
CLUSTER_TOPOLOGY: "true"
111111
EXP_MACHINE_POOL: "true"
112-
EXP_CLUSTER_RESOURCE_SET: "true"
113112
EXP_KUBEADM_BOOTSTRAP_FORMAT_IGNITION: "true"
114113
EXP_RUNTIME_SDK: "true"
115114
EXP_MACHINE_SET_PREFLIGHT_CHECKS: "true"
@@ -409,7 +408,7 @@ build it.
409408
**live_reload_deps**: a list of files/directories to watch. If any of them changes, Tilt rebuilds the manager binary
410409
for the provider and performs a live update of the running container.
411410

412-
**version**: allows to define the version to be used for the Provider CR. If empty, a default version will
411+
**version**: allows to define the version to be used for the Provider CR. If empty, a default version will
413412
be used.
414413

415414
**additional_docker_helper_commands** (String, default=""): Additional commands to be run in the helper image

docs/book/src/tasks/experimental-features/cluster-resource-set.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Experimental Feature: ClusterResourceSet (alpha)
1+
# Experimental Feature: ClusterResourceSet (beta)
22

33
The `ClusterResourceSet` feature is introduced to provide a way to automatically apply a set of resources (such as CNI/CSI) defined by users to matching newly-created/existing clusters.
44

docs/book/src/tasks/experimental-features/experimental-features.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ temporary location for features which will be moved to their permanent locations
88
Users can enable/disable features by setting OS environment variables before running `clusterctl init`, e.g.:
99

1010
```yaml
11-
export EXP_CLUSTER_RESOURCE_SET=true
11+
export EXP_RUNTIME_SDK=true
1212

1313
clusterctl init --infrastructure vsphere
1414
```
1515

1616
As an alternative to environment variables, it is also possible to set variables in the clusterctl config file located at `$XDG_CONFIG_HOME/cluster-api/clusterctl.yaml`, e.g.:
1717
```yaml
1818
# Values for environment variable substitution
19-
EXP_CLUSTER_RESOURCE_SET: "true"
19+
EXP_RUNTIME_SDK: "true"
2020
```
2121
In case a variable is defined in both the config file and as an OS environment variable, the environment variable takes precedence.
2222
For more information on how to set variables for clusterctl, see [clusterctl Configuration File](../../clusterctl/configuration.md)
@@ -30,7 +30,6 @@ As an example, Cluster API Provider Azure (CAPZ) has support for MachinePool thr
3030
One way is to set experimental variables on the clusterctl config file. For CAPI, these configs are under ./test/e2e/config/... such as `docker.yaml`:
3131
```yaml
3232
variables:
33-
EXP_CLUSTER_RESOURCE_SET: "true"
3433
EXP_MACHINE_POOL: "true"
3534
CLUSTER_TOPOLOGY: "true"
3635
EXP_RUNTIME_SDK: "true"
@@ -45,7 +44,6 @@ On development environments started with `Tilt`, features can be enabled by sett
4544

4645
```yaml
4746
kustomize_substitutions:
48-
EXP_CLUSTER_RESOURCE_SET: 'true'
4947
EXP_MACHINE_POOL: 'true'
5048
CLUSTER_TOPOLOGY: 'true'
5149
EXP_RUNTIME_SDK: 'true'

docs/book/src/user/quick-start.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -746,7 +746,6 @@ project][Proxmox getting started guide].
746746
747747
Please follow the Cluster API Provider for [Cloud Director Getting Started Guide](https://github.com/vmware/cluster-api-provider-cloud-director/blob/main/README.md)
748748
749-
EXP_CLUSTER_RESOURCE_SET: "true"
750749
```bash
751750
# Initialize the management cluster
752751
clusterctl init --infrastructure vcd

test/e2e/config/docker.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,6 @@ variables:
332332
AUTOSCALER_WORKLOAD: "./data/autoscaler/autoscaler-to-workload-workload.yaml"
333333
NODE_DRAIN_TIMEOUT: "60s"
334334
# Enabling the feature flags by setting the env variables.
335-
EXP_CLUSTER_RESOURCE_SET: "true"
336335
EXP_KUBEADM_BOOTSTRAP_FORMAT_IGNITION: "true"
337336
EXP_MACHINE_POOL: "true"
338337
CLUSTER_TOPOLOGY: "true"

0 commit comments

Comments
 (0)