Skip to content

Commit c8c97e9

Browse files
committed
Rename multi cluster kep (kep-0008) so it has an .md extension, not yaml.
Add Proposals for changes to `TestSuite` to support configuring multiple kind clusters for multi-cluster tests.
1 parent 072f002 commit c8c97e9

File tree

1 file changed

+57
-2
lines changed

1 file changed

+57
-2
lines changed

keps/0008-multi-cluster.yaml renamed to keps/0008-multi-cluster.md

Lines changed: 57 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,12 @@ short-desc: This KEP describes how we will support more than one cluster under t
44
title: KUTTL Mult-Cluster Support
55
authors:
66
- "@jbarrick-mesosphere"
7+
- "miles-Garnsey"
78
owners:
89
- "@jbarrick-mesosphere"
10+
- "miles-Garnsey"
911
creation-date: 2021-01-08
10-
last-updated: 2021-01-08
12+
last-updated: 2022-03-09
1113
status: provisional
1214
---
1315

@@ -32,8 +34,61 @@ Currently, KUTTL only supports a single test cluster. This KEP describes how we
3234

3335
* Support applying resources across more than one test cluster.
3436
* Support asserting on resources across more than one test cluster.
37+
* Support configuring more than one cluster for testing (KinD initially).
3538

36-
## Proposal
39+
## Proposal - cluster configuration and TestSuite changes
40+
41+
We propose to add additional fields to the `TestSuite` API to configure the clusters that the tests will run on.
42+
43+
In the struct `TestSuite`:
44+
45+
```
46+
// Config for multiple clusters.
47+
MultiClusterConfig MultiClusterConfig `json:"multiClusterConfig"`
48+
```
49+
50+
The definition for `MultiClusterConfig` and associated supporting API elements:
51+
52+
```
53+
//KindConfig contains settings for a single kind cluster.
54+
type KindConfig struct {
55+
// Whether or not to start a local kind cluster for the tests.
56+
StartKIND bool `json:"startKIND"`
57+
// Path to the KIND configuration file to use.
58+
KINDConfig string `json:"kindConfig"`
59+
// KIND context to use.
60+
KINDContext string `json:"kindContext"`
61+
// If set, each node defined in the kind configuration will have a docker named volume mounted into it to persist
62+
// pulled container images across test runs.
63+
KINDNodeCache bool `json:"kindNodeCache"`
64+
// Containers to load to each KIND node prior to running the tests.
65+
KINDContainers []string `json:"kindContainers"`
66+
// If set, do not delete the resources after running the tests (implies SkipClusterDelete).
67+
SkipDelete bool `json:"skipDelete"`
68+
// If set, do not delete the mocked control plane or kind cluster.
69+
SkipClusterDelete bool `json:"skipClusterDelete"`
70+
}
71+
type MapKindConfig map[string]KindConfig
72+
type MultiClusterConfig struct {
73+
// Type of cluster, KinD, external, etc.
74+
ClusterType string `json:"globalKindConfig,omitempty"`
75+
// Number of clusters to create from a global cluster spec.
76+
NumClusters *int `json:"numClusters,omitempty"`
77+
// Global config for kind clusters
78+
GlobalKindConfig KindConfig `json:"globalKindConfig,omitempty"`
79+
// Map of configurations for individual kind clusters.
80+
MapKindConfig `json:",inline,omitempty"`
81+
}
82+
```
83+
84+
The objectives of the above structs are as follows:
85+
86+
1. Allow for different kinds of clusters to be used as specified by `ClusterType` (only KinD implemented initially).
87+
2. Allow these clusters to be configured either at a global level (via `GlobalKindConfig` and a `NumClusters` parameter), or individually via MapKindConfig.
88+
3. Leave latitude for the addition of other cluster types at a later time.
89+
4. Provide the interface already present in the API for configuring the kind clusters, but encapsulate it in `KindConfig`.
90+
91+
## Proposal - teststep
3792

3893
The proposal is to add a new setting to the `TestStep` object: `kubeconfig`. This setting would allow the user to specify an alternative kubeconfig path to use for a given test step.
3994

0 commit comments

Comments
 (0)