Skip to content

Commit

Permalink
Make kind create cluster --image X kustomizable (#169)
Browse files Browse the repository at this point in the history
* Make kind create cluster --image X kustomizable

Because the used version of kind created 1.25 kubernetes clusters
where PSPs are not supported anymore - the CRD is not present - and
this causes our older installations to fails.

* Make static checks happy

* Fix kind cluster creation

* Update CHANGELOG.md

* Update __main__.py
  • Loading branch information
uvegla authored Oct 20, 2022
1 parent 9d983aa commit e33aa1b
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ following [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

- Added
- Add `--kind-cluster-image` flag to configure the image used to create kind clusters, defaults to `kindest/node:v1.24.6` because that is the last version that supports PSPs that we still use in some places

## [0.2.7] - 2022-10-19

- Changed
Expand Down
6 changes: 6 additions & 0 deletions app_test_suite/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,12 @@ def configure_global_options(config_parser: configargparse.ArgParser) -> None:
required=False,
default=[],
)
config_parser.add_argument(
"--kind-cluster-image",
required=False,
default="kindest/node:v1.24.6",
help="The container image to use for booting a kind cluster",
)


def configure_test_specific_options(config_parser: configargparse.ArgParser) -> None:
Expand Down
12 changes: 11 additions & 1 deletion app_test_suite/cluster_providers/kind_cluster_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,17 @@ def get_cluster(
) -> cluster_provider.ClusterInfo:
cluster_name = str(uuid.uuid4())
kube_config_path = self.__get_kube_config_from_name(cluster_name)
kind_args = [self._kind_bin, "create", "cluster", "--name", cluster_name, "--kubeconfig", kube_config_path]
kind_args = [
self._kind_bin,
"create",
"cluster",
"--name",
cluster_name,
"--image",
config.kind_cluster_image,
"--kubeconfig",
kube_config_path,
]
logger.info(f"Creating KinD cluster with ID '{cluster_name}'...")
config_file = ""
if "config_file" in kwargs and kwargs["config_file"]:
Expand Down

0 comments on commit e33aa1b

Please sign in to comment.