terraform-provider-k0s icon indicating copy to clipboard operation
terraform-provider-k0s copied to clipboard

Raw SSH key support, k0sctl.yaml config output, read phase retries

Open danielskowronski opened this issue 1 year ago • 6 comments
trafficstars

This is only a draft, but I wanted to let the community know that it's soon to be completed :)

Scope:

  • add other option to pass SSH key - as raw PEM-encoded string #94
  • add k0sctlconfig as output, so it can be used with k0sctl CLI #76
  • handle situation, where k0s leader is not available - attempt to validate cluster on Read phase using all controllers
  • investigate ways of actual node removal #95

It can be tested with https://registry.terraform.io/providers/danielskowronski/k0s/

danielskowronski avatar Nov 28 '23 20:11 danielskowronski

Thanks for the PR! I'll do a review within the next week.

alessiodionisi avatar Nov 28 '23 22:11 alessiodionisi

It won't be easy to implement https://github.com/alessiodionisi/terraform-provider-k0s/issues/95 as issue seems to reside in k0sctl itself (https://github.com/k0sproject/k0sctl/issues/603) plus some features were added but are not yet released with version number.

I'll try to figure out if some quick fix can be applied, e.g. by setting Reset flag dynamically on Read phase based upon detected need to rebuild the controller. But most likely it'll need to go out of scope of this PR and the relevant issue would wait for k0sctl implementation.

danielskowronski avatar Dec 04 '23 17:12 danielskowronski

I prefer to wait k0sctl implementation, can you please rebase the PR? I can't do it because I can't commit to your branch.

alessiodionisi avatar Dec 23 '23 15:12 alessiodionisi

I prefer to wait k0sctl implementation

We'll need to wait for https://github.com/k0sproject/k0sctl/issues/603 and I assume it'd "just work". Otherwise, some logic would need to be applied as described previously.

Basically, k0sctl/k0s currently does not provide anything that a typical Terraform provider could use as a source of truth it can read at any given moment - for example, import operation can't be implemented from live cluster without any k0sctl.yaml file.

can you please rebase the PR? I can't do it because I can't commit to your branch.

Done

danielskowronski avatar Jan 02 '24 11:01 danielskowronski

@alessiodionisi Any change you can merge this in an release it?

Bugs5382 avatar Dec 02 '24 21:12 Bugs5382

Can you merge this?

cfredericksen avatar Feb 03 '25 00:02 cfredericksen