mumoshu / terraform-provider-eksctl

Manage AWS EKS clusters using Terraform and eksctl
Apache License 2.0
234 stars 44 forks source link

Cluster upgrade timeout #51

Closed cilindrox closed 3 years ago

cilindrox commented 3 years ago

eksctl defaults to a 25 minute hard timeout for operations, which prevents things like nodegroup creation from completing gracefully.

cilindrox commented 3 years ago

@mumoshu this is a super rough approach - lmk if it makes sense. Happy to discuss alternatives.

Was thinking perhaps the timeout can be configured as an instance property of the m *Manager on the function - so I'd read that from m.getTimeout or something.

mumoshu commented 3 years ago

@cilindrox Hey! Thanks a lot for your effort here.

I fully agree this should be configurable.

Ideally, this should be configurable at the provider level https://github.com/mumoshu/terraform-provider-eksctl/blob/1ae92fefbf8b6a5199bd78e5fe1bba49c5053bac/pkg/provider/configure.go#L18 and/or the resource-level https://github.com/mumoshu/terraform-provider-eksctl/blob/1ae92fefbf8b6a5199bd78e5fe1bba49c5053bac/pkg/resource/cluster/resource.go#L21

Implementation-wise, passing it from some ResourceData into m *Manager as you pointed out sounds good.

Would you mind giving it a try?

cilindrox commented 3 years ago

Thanks for the comments @mumoshu - will take a stab at it

edit: this being a global var - might be a bit more useful to initially roll with it at as a provider-level flag?

mumoshu commented 3 years ago

edit: this being a global var - might be a bit more useful to initially roll with it at as a provider-level flag?

@cilindrox What do you mean by this?

ProviderInstance isn't a global var. It's passed as meta interface{} in the Terraform's Resource functions that can be seen in e.g. https://github.com/mumoshu/terraform-provider-eksctl/blob/1ae92fefbf8b6a5199bd78e5fe1bba49c5053bac/pkg/resource/cluster/resource.go#L41

You can define provider-level attributes in https://github.com/mumoshu/terraform-provider-eksctl/blob/1ae92fefbf8b6a5199bd78e5fe1bba49c5053bac/pkg/provider/provider.go#L19 and key-values for those prover-level attributes are available via d *schema.ResourceData in the providerConfigure function https://github.com/mumoshu/terraform-provider-eksctl/blob/1ae92fefbf8b6a5199bd78e5fe1bba49c5053bac/pkg/provider/configure.go#L14

cilindrox commented 3 years ago

Closing this, since it seems the timeout was due to a bug with eksctl upstream. Upgrading to v0.52.0+ did the trick.

Might revisit this later, but don't want to abandon an open PR.