Skip to content
This repository was archived by the owner on May 6, 2020. It is now read-only.

Introduce kvm-libvirt platform#7

Merged
pothos merged 1 commit into
masterfrom
kai/terraform-libvirt
Jun 28, 2019
Merged

Introduce kvm-libvirt platform#7
pothos merged 1 commit into
masterfrom
kai/terraform-libvirt

Conversation

@pothos

@pothos pothos commented May 24, 2019

Copy link
Copy Markdown
Contributor

This documents how Lokomotive can be set up with nodes as VM on KVM through the libvirt Terraform provider. It provides a controller and a worker Terraform module to start with.

It provides a quick and easy way to test Lokomotive with a defined Flatcar image and doesn't require to have access to one of the cloud providers or spare hardware.

Testing

Please test it with the steps mentioned in the documentation.

Depends on kinvolk-archives/terraform-render-bootkube#12

Comment thread kvm-libvirt/flatcar-linux/kubernetes/bootkube.tf Outdated

@invidian invidian left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a few nits in the comments. I tested it and it works fine. It's actually cool how fast it deploys.

Comment thread kvm-libvirt/flatcar-linux/kubernetes/controllers.tf Outdated
Comment thread kvm-libvirt/flatcar-linux/kubernetes/bootkube.tf Outdated
Comment thread docs/flatcar-linux/kvm-libvirt.md
Comment thread docs/flatcar-linux/kvm-libvirt.md Outdated
Comment thread docs/flatcar-linux/kvm-libvirt.md Outdated
Comment thread docs/flatcar-linux/kvm-libvirt.md Outdated
Comment thread kvm-libvirt/flatcar-linux/kubernetes/bootkube.tf Outdated
@pothos pothos force-pushed the kai/terraform-libvirt branch from 386dc3d to e06afe7 Compare May 28, 2019 16:44
@pothos

pothos commented May 28, 2019

Copy link
Copy Markdown
Contributor Author

Thanks for the comments!

@chrskhl

chrskhl commented May 31, 2019

Copy link
Copy Markdown
Contributor

Is this something we could use for the CI? We currently have another VM setup for that.

@chrskhl

chrskhl commented May 31, 2019

Copy link
Copy Markdown
Contributor

I just noticed that @squeed did something like this for Typhoon in poseidon/typhoon#266

Is this based on that?

@invidian

Copy link
Copy Markdown
Contributor

Is this something we could use for the CI? We currently have another VM setup for that.

That doesn't use Matchbox and PXE, so I doubt in can be used for CI. We should test it on CI later on though.

@pothos

pothos commented May 31, 2019

Copy link
Copy Markdown
Contributor Author

Is this based on that?

@invidian Pointed me to this as well but the structure is different from the packet/aws files which I used as a basis. In the linked PR the controllers and workers get names instead of the count as done in packet/aws. I took the same mechanism to assign stable IPs to the controllers (starting with .10) and having a machine domain variable but the rest is different, e.g., this PR here does not change the host DNS server for IP resolution but uses node IPs in the configuration, and also uses a temporary disk image pool instead the default one.

@johananl johananl left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pothos I started reviewing this but haven't finished yet. I'm submitting what I currently have in the meantime and will do my best to finish testing this on Monday.

Comment thread docs/flatcar-linux/kvm-libvirt.md Outdated
Comment thread docs/flatcar-linux/kvm-libvirt.md Outdated
Comment thread docs/flatcar-linux/kvm-libvirt.md Outdated
Comment thread docs/flatcar-linux/kvm-libvirt.md Outdated
Comment thread docs/flatcar-linux/kvm-libvirt.md Outdated
Comment thread docs/flatcar-linux/kvm-libvirt.md Outdated
Comment thread docs/flatcar-linux/kvm-libvirt.md Outdated
Comment thread docs/flatcar-linux/kvm-libvirt.md Outdated
Comment thread docs/flatcar-linux/kvm-libvirt.md Outdated
Comment thread docs/flatcar-linux/kvm-libvirt.md Outdated
@johananl

Copy link
Copy Markdown
Contributor

Is this something we could use for the CI? We currently have another VM setup for that.

@blixtra our CI process uses the bare-metal target. This one adds a new target (libvirt).

@pothos pothos force-pushed the kai/terraform-libvirt branch 2 times, most recently from 47ace3b to 97f272b Compare June 3, 2019 16:19
@pothos

pothos commented Jun 3, 2019

Copy link
Copy Markdown
Contributor Author

I have to fix a problem with multiple nodes.

Comment thread kvm-libvirt/flatcar-linux/kubernetes/controllers.tf Outdated
Comment thread kvm-libvirt/flatcar-linux/kubernetes/controllers.tf
@invidian

invidian commented Jun 4, 2019

Copy link
Copy Markdown
Contributor

BTW I stripped the code a bit and it's actually also a cool way of having a bunch of Flatcar instances running locally :)

@pothos pothos force-pushed the kai/terraform-libvirt branch from 97f272b to 74f6283 Compare June 4, 2019 08:52
@pothos

pothos commented Jun 4, 2019

Copy link
Copy Markdown
Contributor Author

I think I've fixed the multi-node configuration count mistake.

@pothos pothos force-pushed the kai/terraform-libvirt branch from 74f6283 to 35c27ae Compare June 12, 2019 18:57

@kosyfrances kosyfrances left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While trying to apply terraform, I got hit with

Error: Error applying plan:

2 error(s) occurred:

* module.worker-pool-one.libvirt_domain.worker-machine: 1 error(s) occurred:

* libvirt_domain.worker-machine: Error creating libvirt domain: virError(Code=1, Domain=10, Message='internal error: process exited while connecting to monitor: 2019-06-20T11:05:59.605317Z qemu-system-x86_64: -drive file=/var/tmp/vmszqzs07/vmcluster-one-worker-0.qcow2,format=qcow2,if=none,id=drive-virtio-disk0: Could not open '/var/tmp/vmszqzs07/vmcluster-one-worker-0.qcow2': Permission denied')
* module.controller.libvirt_domain.controller-machine: 1 error(s) occurred:

* libvirt_domain.controller-machine: Error creating libvirt domain: virError(Code=1, Domain=10, Message='internal error: process exited while connecting to monitor: 2019-06-20T11:05:59.605666Z qemu-system-x86_64: -drive file=/var/tmp/vmszqzs07/vmcluster-controller-0.qcow2,format=qcow2,if=none,id=drive-virtio-disk0: Could not open '/var/tmp/vmszqzs07/vmcluster-controller-0.qcow2': Permission denied')

Left a couple of notes from my review so far. I will try setting up and continuing with review again some other time.

Comment thread docs/flatcar-linux/kvm-libvirt.md Outdated
Comment thread docs/flatcar-linux/kvm-libvirt.md Outdated
Comment thread docs/flatcar-linux/kvm-libvirt.md Outdated
Comment thread docs/flatcar-linux/kvm-libvirt.md Outdated
Comment thread docs/flatcar-linux/kvm-libvirt.md
Comment thread docs/flatcar-linux/kvm-libvirt.md Outdated
Comment thread docs/flatcar-linux/kvm-libvirt.md Outdated
Comment thread docs/flatcar-linux/kvm-libvirt.md Outdated
Comment thread docs/flatcar-linux/kvm-libvirt.md
@pothos pothos force-pushed the kai/terraform-libvirt branch from 35c27ae to 2c0b627 Compare June 21, 2019 15:45
@pothos

pothos commented Jun 21, 2019

Copy link
Copy Markdown
Contributor Author

@kosyfrances Thanks for the review, can we have a look how to solve the error together?

@pothos pothos force-pushed the kai/terraform-libvirt branch 2 times, most recently from b64e66e to c7b3797 Compare June 21, 2019 16:02

@invidian invidian left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a few nits, but otherwise LGTM!

Comment thread docs/flatcar-linux/kvm-libvirt.md Outdated
Comment thread docs/flatcar-linux/kvm-libvirt.md Outdated
Comment thread docs/flatcar-linux/kvm-libvirt.md Outdated
Comment thread kvm-libvirt/flatcar-linux/kubernetes/controllers.tf
Comment thread kvm-libvirt/flatcar-linux/kubernetes/controllers.tf Outdated
Comment thread docs/flatcar-linux/kvm-libvirt.md
@pothos pothos force-pushed the kai/terraform-libvirt branch 2 times, most recently from bd0ca10 to 9788c1b Compare June 27, 2019 11:17
@pothos pothos force-pushed the kai/terraform-libvirt branch from 9788c1b to 496ff09 Compare June 27, 2019 11:21
@pothos

pothos commented Jun 27, 2019

Copy link
Copy Markdown
Contributor Author

I've removed the ?ref=thisbranch part of the terraform URLs to make it ready for merging.

@pothos pothos merged commit fbb7eee into master Jun 28, 2019
@pothos pothos deleted the kai/terraform-libvirt branch June 28, 2019 16:18
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants