-
Notifications
You must be signed in to change notification settings - Fork 105
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
Add support for kwok cluster simulator #239
Add support for kwok cluster simulator #239
Conversation
Hi @reetasingh. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
type kwokContextKey string | ||
|
||
// GetKwokClusterFromContext helps extract the kwok.Cluster object from the context. | ||
func GetKwokClusterFromContext(ctx context.Context, clusterName string) (*kwok.Cluster, bool) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this and kind_funcs.go
share more of less the same set of features/workflows, I am wondering if we can really simplify this better ? It might lead to an interface change but, that might not be a bad idea considering we are still in early phases.
- Create a interface type that indicates the cluster providers that can be used to implement
kwok
/kind
or any other one in the future - This env funcs use the interface type with certain args so that these things don't need to be changed frequently
cc @vladimirvivien @reetasingh Does this make sense ?
type clusterOpts func(c ClusterProvider)
type ClusterProvider interface {
WithVersion(version string) ClusterProvider
WithOpts(opts ...clusterOpts) ClusterProvider
Create(args ...string) (string, error)
GetKubeConfig() string
GetKubectlContext() string
ExportLogs(dest string) error
Destroy() error
LoadDockerImages(image string) error
LoadImageArchive(archivePath string) error
}
Define an interface like above and make the ClusterProvider
as an argument to functions in the envfuncs
helper so that we can build a reusable set of envfunc ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@harshanarayana I like this refactor a lot. First impression is that it is doable and makes sense. Let's spend some times discussing to make sure we're not trapping future development work into a corner by being too specific.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 I agree. And I think we should do that as a pre-work before we can get this one in and not really use this PR to do that change. What do you think ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
xref: #245
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@harshanarayana do you plan to address the comments in your PR #239 soon? I am thinking when do we plan to proceed and close this one out?
Thanks a lot for the wonderful work @reetasingh |
dca8922
to
8c89030
Compare
support/kwok/kwok.go
Outdated
return k.getKubeconfig() | ||
} | ||
|
||
command := fmt.Sprintf(`kwokctl create cluster --name %s`, k.name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
by default, this would spin up a k8s cluster using docker-compose, if we want to default it to kind, need to pass-in --runtime kind
explicitly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Huang-Wei would --runtime kind
require kind
to be installed too? thinking if we need to add kind dependency as well when installing kwok
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@wzshiming kwokctl
wouldn't install the missing runtime binary, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Huang-Wei @wzshiming do we want to default it to kind
? or we can let users pass config file to CreateWithConfig(kwokConfigFile string)
where file has entry for runtime: kind
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm fine with defaulting the same default runtime (docker) in kwokctl here; unless e2e-framework is keen on defaulting to kind.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My suggestion: since e2e-framework already has support for kind clusters, let's default to kind. If someone wants to use docker-compose, they can do so using the kwok config file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @vladimirvivien since kwokctl
defaults to using docker-compose
I think it makes more sense to default to docker-compose
. if we default to kind
with --runtime kind
argument we will not be able to override to docker-compose since --runtime kind
takes precendence over kwok config file
/ok-to-test |
/retest-required |
Will this PR use #246? |
@vladimirvivien unless this is really really urgent to get into the framework right now, can we wait a few more days until we finalize #246 and get this in using that same interface ? But if getting this in is critical, I can understand 😄 |
@harshanarayana I was asking because I do want it to wait to use #246. Thanks |
I'm all right with that.. Let us get this in if this is ready .. I can take care of refactoring this one. @vladimirvivien |
@vladimirvivien FYI, I ported this |
Hi @harshanarayana @vladimirvivien I was looking forward to merging my PR in this repo. it means a lot to a new contributor like me. I can make the changes required to update to meet the interface definiton. @harshanarayana is it ok with you that I continue to work on this PR instead and get it merged after the interface defintion PR is merged? |
@reetasingh sorry for any confusion that message might have caused. Migration done to other PR is only to show it is movable there easily.. And that was done so that this PR can be merged even before #246 finishes.. I think #246 PR isn't ready yet to be merged.. Like I mentioned above if this PR is all done and @vladimirvivien is okay with the changes on this current PR, and there isn't any more pending changes, let us definitely get this merged first |
thanks @harshanarayana . yes this PR is all done . @vladimirvivien please take a look. I have addressed all open review comments. |
@reetasingh and @harshanarayana |
@vladimirvivien Yes. Let us get this one merged if you dont have any pending review to be addressed. We can take care of refactoring and fitting this into the other interface later on in a different PR or I can take care of that in my already open PR. |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: reetasingh, vladimirvivien The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Fixes #214
kwok
cluster which includes installingkwokctl