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

Support for using Kubernetes-SIGs Kwok cluster simulator #214

Closed
vladimirvivien opened this issue Mar 4, 2023 · 8 comments · Fixed by #239
Closed

Support for using Kubernetes-SIGs Kwok cluster simulator #214

vladimirvivien opened this issue Mar 4, 2023 · 8 comments · Fixed by #239
Labels
kind/feature Categorizes issue or PR as related to a new feature.

Comments

@vladimirvivien
Copy link
Contributor

Proposal

kwok is a Kubernetes cluster simulator, from Kubernetes-SIGs, that can start fully Kubernetes API-compatible cluster. This project should investigate how e2e-framework can leverage Kwok for end-to-end testing. Currently, the project already has environment functions that can start/stop Kind. It would be useful to create environment functions to start/configure/stop kwok clusters at test time for quickstart end-to-end tests.

The following is an illustrative mock up of what that support could look like. This example would create a simulated cluster, run the tests, then teardown that cluster.

func TestMain(m *testing.M) {
	testenv = env.New()
	clusterName := envconf.RandomName("some-cluster", 16)
	namespace := envconf.RandomName("kind-ns", 16)

	testenv.Setup(
		envfuncs.CreateKwokCluster(kindClusterName),
		envfuncs.CreateNamespace(namespace),
	)

	testenv.Finish(
		envfuncs.DeleteNamespace(namespace),
		envfuncs.DestroyKwokCluster(kindClusterName),
	)
	os.Exit(testenv.Run(m))
}

References

@vladimirvivien vladimirvivien added the kind/feature Categorizes issue or PR as related to a new feature. label Mar 4, 2023
@reetasingh
Copy link
Contributor

@ vladimirvivien I am interested in working on this feature.

@wzshiming
Copy link
Member

wzshiming commented Mar 27, 2023

I am happy to see that the e2e-framework will support kwok 🎉🎉🎉

I have a small requirement, I want to refactor e2e for kwok/kwokctl with e2e-framework, and I need e2e-framework to be able to support modifications to the kwokctl dependency version, rather than like the kind version.

@harshanarayana
Copy link
Contributor

@wzshiming The kind version is configurable too. Just that it also defaults to a specific version

func (k *Cluster) WithVersion(ver string) *Cluster {
k.version = ver
return k
}

cluster := kind.NewCluster(name)
cluster.WithVersion("0.24.0")
kubeconfig, err := cluster.Create()
// do things after

@wzshiming
Copy link
Member

@wzshiming The kind version is configurable too. Just that it also defaults to a specific version

func (k *Cluster) WithVersion(ver string) *Cluster {
k.version = ver
return k
}

cluster := kind.NewCluster(name)
cluster.WithVersion("0.24.0")
kubeconfig, err := cluster.Create()
// do things after

Thank you, I see!

@vladimirvivien
Copy link
Contributor Author

When this is done it would be like an Inception: Kwok using e2e-framework and e2e-framework supports Kwok! 🤣 Love it!

@reetasingh
Copy link
Contributor

reetasingh commented Apr 16, 2023

@vladimirvivien @wzshiming @harshanarayana I have opened #239 for this feature. please review. My apologies for delay in sending a PR

@wzshiming
Copy link
Member

wzshiming commented Apr 21, 2023

@vladimirvivien
I'm working on e2e of kwok and didn't find that sigs.k8s.io/e2e-framework/klient/k8s/resources has a method to update subresources(status), which is essential for kwok e2e, is it possible to add this.

@vladimirvivien
Copy link
Contributor Author

@wzshiming Absolutely 👍 Please open a PR for contribution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants