k8s-proxmox / cluster-api-provider-proxmox

Cluster API provider implementation for Proxmox VE
Apache License 2.0
103 stars 11 forks source link

new feature qemu-scheduler #102

Closed sp-yduck closed 11 months ago

sp-yduck commented 11 months ago

fix #101

To specify vmid range or node name, we can use certain annotation for it. for example

# ProxmoxMachine
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
kind: ProxmoxMachine
metadata:
    name: sample-machine
    annotations:
        vmid.qemu-scheduler/range: 100-150 # this means your vmid will be chosen from the range of 100 to 150.

when you use MachineDeployment you can use spec.template.metadata.annotations since cluster api propagates this values to your ProxmoxMachine.

# MachineDeployment
apiVersion: cluster.x-k8s.io/v1beta1
kind: MachineDeployment
metadata:
  annotations:
    caution: "# do not use here, because this annotation won't be propagated to your ProxmoxMachine"
  name: sample-machine-deployment
spec:
  template:
    metadata:
      annotations:
        node.qemu-scheduler/regex: node[0-9]+ # this annotation will be propagated to your ProxmoxMachine via MachineSet