Skip to content

Commit d99e352

Browse files
Extend hypervisor crd for cortex filtering
1 parent 768f631 commit d99e352

File tree

9 files changed

+382
-36
lines changed

9 files changed

+382
-36
lines changed

api/v1/hypervisor_types.go

Lines changed: 45 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,12 @@ type HypervisorSpec struct {
9393
// Aggregates are used to apply aggregates to the hypervisor.
9494
Aggregates []string `json:"aggregates"`
9595

96+
// +kubebuilder:default:={}
97+
// AllowedProjects defines which openstack projects are allowed to schedule
98+
// instances on this hypervisor. The values of this list should be project
99+
// uuids. If left empty, all projects are allowed.
100+
AllowedProjects []string `json:"allowedProjects"`
101+
96102
// +kubebuilder:default:=true
97103
// HighAvailability is used to enable the high availability handling of the hypervisor.
98104
HighAvailability bool `json:"highAvailability"`
@@ -190,8 +196,8 @@ type OperatingSystemStatus struct {
190196
GardenLinuxFeatures []string `json:"gardenLinuxFeatures,omitempty"`
191197
}
192198

193-
// Current capabilities reported by libvirt.
194-
type CapabilitiesStatus struct {
199+
// Capabilities of the hypervisor as reported by libvirt.
200+
type Capabilities struct {
195201
// +kubebuilder:default:=unknown
196202
// The hosts CPU architecture (not the guests).
197203
HostCpuArch string `json:"cpuArch,omitempty"`
@@ -201,6 +207,26 @@ type CapabilitiesStatus struct {
201207
HostCpus resource.Quantity `json:"cpus,omitempty"`
202208
}
203209

210+
// Domain capabilities of the hypervisor as reported by libvirt.
211+
// These details are relevant to check if a VM can be scheduled on the hypervisor.
212+
type DomainCapabilities struct {
213+
// +kubebuilder:default:=unknown
214+
// The available domain cpu architecture.
215+
Arch string `json:"arch,omitempty"`
216+
// +kubebuilder:default:=unknown
217+
// The supported type of virtualization for domains, such as "ch".
218+
HypervisorType string `json:"hypervisorType,omitempty"`
219+
// +kubebuilder:default:={}
220+
// Supported devices for domains, such as "video".
221+
SupportedDevices []string `json:"supportedDevices,omitempty"`
222+
// +kubebuilder:default:={}
223+
// Supported cpu modes for domains, such as "host-passthrough".
224+
SupportedCpuModes []string `json:"supportedCpuModes,omitempty"`
225+
// +kubebuilder:default:={}
226+
// Supported features for domains, such as "sev" or "sgx".
227+
SupportedFeatures []string `json:"supportedFeatures,omitempty"`
228+
}
229+
204230
// HypervisorStatus defines the observed state of Hypervisor
205231
type HypervisorStatus struct {
206232
// +kubebuilder:default:=unknown
@@ -216,8 +242,23 @@ type HypervisorStatus struct {
216242
// Represents the Hypervisor hosted Virtual Machines
217243
Instances []Instance `json:"instances,omitempty"`
218244

219-
// The capabilities of the hypervisors as reported by libvirt.
220-
Capabilities CapabilitiesStatus `json:"capabilities,omitempty"`
245+
// Auto-discovered capabilities as reported by libvirt.
246+
Capabilities Capabilities `json:"capabilities"`
247+
248+
// Auto-discovered domain capabilities relevant to check if a VM
249+
// can be scheduled on the hypervisor.
250+
DomainCapabilities DomainCapabilities `json:"domainCapabilities"`
251+
252+
// +kubebuilder:default:={}
253+
// Auto-discovered capacity available in total on the hypervisor.
254+
// The remaining physical capacity can be calculated
255+
// as Capacity - Allocation.
256+
Capacity map[string]resource.Quantity `json:"capacity,omitempty"`
257+
258+
// +kubebuilder:default:={}
259+
// Auto-discovered capacity currently allocated by instances
260+
// on the hypervisor. Note that this does not include reserved capacity.
261+
Allocation map[string]resource.Quantity `json:"allocation,omitempty"`
221262

222263
// +kubebuilder:default:=0
223264
// Represent the num of instances

api/v1/zz_generated.deepcopy.go

Lines changed: 55 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

applyconfigurations/api/v1/capabilitiesstatus.go renamed to applyconfigurations/api/v1/capabilities.go

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

applyconfigurations/api/v1/domaincapabilities.go

Lines changed: 65 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

applyconfigurations/api/v1/hypervisorspec.go

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)