Hi All, I am using Terraform Provider for Harvest...
# harvester
g
Hi All, I am using Terraform Provider for Harvester to bootstrap nodes for Rancher controlplane/workers. Is there a way to setup anti-affinity / scheduling rules for the VM, to make sure that vms are not scheduled on one machine?
Is there a way to use unreleased provider, I see there is a node_selector added? https://github.com/harvester/terraform-provider-harvester/pull/132
Ended up in building the provider locally and configuring it using
.terraformrc
b
If you set labels, e.g.
<http://topology.kubernetes.io/zone=zone1|topology.kubernetes.io/zone=zone1>
on the Harvester nodes, you can define the zone in the VM definition (in the node scheduling section (which is the same as nodeAffinity), e.g.
<http://topology.kubernetes.io/zone|topology.kubernetes.io/zone> In zone1
. The zone info is even populated into the node/guest cluster, so you can use it there to further split your workload.
g
Yes, but the question is about Terraform provider, which does not expose scheduling options. I mean it does, but it's not released yet
👍 1
b
Not sure what you exactly mean. With the current provider you can set zones... which is a scheduling option, even though no nodeselector.
g
@bumpy-portugal-40754 I am using this provider, the latest version (1.6.0): https://registry.terraform.io/providers/harvester/harvester/latest/docs/resources/virtualmachine The problem is that If I use it, it may happen that all three VMs will e scheduled on one physical machine
So in the new version (1.7.0), it's possible to use node selector, to make sure that each of the VMs are scheduled on different node
It's not about workload scheduling based on K8S topology labels, but nodes (vms) schedling
It's possible to setup using UI, but not current Terraform
👍 1
b
Ok. Didn't know that.
g
The UI options are not present in TF:
As a temporary solutions I am building TF provider from main
as it has node_selector
b
Interesting that it's working. Normally there is a version match with Harvester... and Harvester 1.7 is not released yet.
h
missing this feature as well, any idea when the new provider version will be available ?
g
Together with 1.7 Harvester? Due date is mid Dec?
Response based on guessing :)
😁 2
h
I really hope so, also I’ve discovered a bug in the Harvester provider. When node scheduling is enabled via UI, Terraform seems to lose track of the PVC resources, which results in a disk claim failure during deletion.