-
Notifications
You must be signed in to change notification settings - Fork 21
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
Redesign scope of xk6-kubernetes API #66
Comments
I'm not sure if the
Yes...the deployment is rather ugly given the necessity of creating multiple resources in separate calls. A helper method to ease this would be welcome for sure.
Just wanted to note the original contributor mentioned that he added the 💯 to using Generics somehow to have a single From your later mention about incorporating tools to allow variable substitutions in YAML, I could see using something like Kustomize or Ytt, or even Kapp for deploying. (Caveat: I have not researched these tools to know enough about how well we could incorporate them into
My only concern is the duplication of Kubernetes base functionality. If |
That is what I understood, but this is not really relevant so I'm modifying the text.
I agree. This is mentioned in my comment. The intention is to make this the primary use case instead of just a generic wrapper over basic k8s api.
My concern here is that providing yaml text from javascript is not really convenient. I would like to explore other alternatives more idiomatic to javascript (even if providing yaml is also supported).
My intention is not to use external tools, but to integrate them into the library to avoid having dependencies of other binaries in the node running the tests. For instance,
That is the idea. Otherwise, I think they should remain in |
It was :D I'm totally in line with this proposal! Although, as I discussed with Pablo, a design doc showcasing the end-user experience of this extension (as we are doing with Chaos) would be pretty nice. Also, I think this process of making the extension leaner and smaller, plus creating more useful abstractions (instead of wrapping all the raw Kubernetes stuff) will get us closer to having this into Core k6 at some point. That way, anyone can spawn a new deployment, clone an existing one or apply some Kustomizations before running their tests. |
Good point, I will do it! |
I didn't mean to imply that I was in favor of defining YAML within the JavaScript, however, being able to possibly load from a YAML file would be nice. I'll look forward to your design thoughts! |
The generic API including the method |
The helpers are introduced in #72 |
Specialized functions such as attaching ephemeral containers have been moved to the xk6-disruptor extension |
@javaducky can we close this issue? I think we have covered all the scoped of the changes proposed here. |
@pablochacin sounds good to me! |
The
xk6-kubernetes
extensionwas initially developed with the intention ofhas been used for chaos experiments, providing basic functionalities such as deleting resources (e.g. namespaces, secrets) and running work loads (for example, jobs). It also provided some other basic functions for creating resources but adding little or no additional abstractions over the native k8s api.The functions provided by
xk6-kubernetes
can also be used when setting up tests. However, some common tasks such as exposing a deployment as a service require considerable boiler plate code and can became tedious to program.At the same time, as the requirements for running chaos experiments has become more complex, some specialized functions has been added, such as attaching ephemeral containers to running pods, or executing commands in a container.
It seems clear that the current design of
xk6-kubernetes
mixes functions that are too generic for been useful when setting up tests or too specialized for been in a general purpose k8s extension. Therefore the following changes are proposed:apply
functions for creating resources using yaml definitions.xk6-chaos
Regarding the generic
apply
method, as handling inline yaml can be cumbersome (in particular if we want to substitute certain fields using variables) other alternatives can be explored:kustomize
, embedding this tool(s) into the library to prevent dependencies with external binaries in the test environment.Edit:
The generic interface could also be provided by using using a generic golang client that handles resources as generic structs which should be easily mapped to javascript objects.
One potential benefit of using a generic apply method is the possibility of removing the dependencies to many of the k8s api packages, reducing the size of the extension.
#66 (comment)
The text was updated successfully, but these errors were encountered: