Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/add cluster stacks plugin #800

Open
wants to merge 12 commits into
base: 710-feature-request-enable-compliance-tests-to-use-plugins-for-cluster-provisioning
Choose a base branch
from

Conversation

michal-gubricky
Copy link
Contributor

@michal-gubricky michal-gubricky commented Nov 2, 2024

This PR implement plugin for cluster-stacks

Fixes #774

Tests/kaas/plugin/.pytest-kind/my-cluster/kind-v0.17.0 Outdated Show resolved Hide resolved

### Configuring clusterspec.yaml file

The `clusterspec.yaml` file is used to set parameters for creating a Kubernetes cluster with the `cluster-stacks` plugin. This file allows you to specify details related to the cluster-stack, Git integration, and cluster configurations.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The clusterspec.yaml only contains information that is not specific to the plugin. Information that is specific to the test subject (i.e., the cloud under test) should be defined somewhere else.

Copy link
Contributor Author

@michal-gubricky michal-gubricky Nov 6, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, okay. Then we need to think about some new config file where will be defined parameters/variables specific to the plugins (kind, cluster-stacks, etc.) or we can say that the user/tester needs to define some env variables before executing the plugin. What do you think?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The plugin's constructor will take the path of a config file, and that config file should contain everything that is specific to the plugin and the test subject (it could in turn refer to other files, if necessary). The path of the config file can be specified per subject in config.toml.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought clusterspec.yaml was the config file, as it was the only argument (called CLUSTERSPEC_PATH) you could pass to the plugin. However, it seems that it was changed in yesterday's commits. I will take a closer look into that.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It now take an additional configuration file specific to the plugin. I have also added an example file, see plugin-cluster-stacks-config.yaml.

And I have one question regarding this. How should the plugin configuration file look when you want to provision multiple clusters? Do you need a separate configuration file for each cluster, or is a single file sufficient, with the clusterspec_cluster variable determining the cluster?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my mind, the plugin will merge the plugin configuration with the clusterspec information.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So it should be merged based on the clusterspec_cluster. In my mind, the config file for the plugin would then look something like this:

current-k8s-release:
  clouds_yaml_path: "~/.config/openstack/clouds.yaml"   # Path to the OpenStack clouds.yaml file
  cs_name: "scs"                                        # Cluster Stack Name
  cs_version: "v1"                                      # Cluster Stack Version
  # Additional configurations
  ...
  ...
  ...

current-k8s-release-1:
  ...
  ...
  ...

Tests/kaas/plugin/README.md Outdated Show resolved Hide resolved

```yaml
cs_name: <cs_name> # Default: "scs"
cs_k8s_version: <cs_k8s_version> # Default: "1.29"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be taken from the branch (and the branch will be supplied to the plugin; the plugin need not read the clusterspec.yaml)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I agree that the cs_k8s_version should be taken from the branch parameter in the clusterspec.yaml file.

Tests/kaas/plugin/kubeconfig-cs-cluster Outdated Show resolved Hide resolved
Tests/kaas/plugin/cluster.yaml Outdated Show resolved Hide resolved
@@ -21,7 +21,7 @@ def _create_cluster(self):
if self.config is None:
self.cluster.create()
else:
self.cluster.create(self.config)
self.cluster.create()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this change? It has nothing to do with cluster stacks.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change is currently outdated, as the code in #753 has also been modified.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this needs to be rebased on the latest version of the target branch

Copy link
Contributor Author

@michal-gubricky michal-gubricky Nov 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rebased onto the latest version

@michal-gubricky michal-gubricky force-pushed the feat/add-cluster-stacks-plugin branch 3 times, most recently from f4bdba7 to e5952c0 Compare November 11, 2024 09:34
@michal-gubricky michal-gubricky marked this pull request as ready for review November 12, 2024 10:03
@mbuechse
Copy link
Contributor

If this has been rebased to the latest version, why then does it have merge conflicts?

@michal-gubricky
Copy link
Contributor Author

If this has been rebased to the latest version, why then does it have merge conflicts?

As you can see, I added that comment on 11.11.2024 at 10:37 a.m., and then, after rebasing, a new commit was added to the target branch later that afternoon.

@mbuechse
Copy link
Contributor

As you can see, I added that comment on 11.11.2024 at 10:37 a.m., and then, after rebasing, a new commit was added to the target branch later that afternoon.

Understood. Thanks for doing all the great work. Please work with Toni to get this merged asap.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature Request] Implement plugin for cluster-stacks
2 participants