1
- // Copyright (c) 2024 VMware, Inc. All Rights Reserved.
1
+ // © Broadcom. All Rights Reserved.
2
+ // The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries.
2
3
// SPDX-License-Identifier: Apache-2.0
3
4
4
5
package v1alpha1
@@ -7,6 +8,23 @@ import (
7
8
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
8
9
)
9
10
11
+ const (
12
+ // ZoneConditionPersistentVolumeClaimsExist indicates that PVCs exist in the
13
+ // Zone.
14
+ ZoneConditionPersistentVolumeClaimsExist = "ZonePersistentVolumeClaimsExist"
15
+
16
+ // ZoneConditionPodsExist indicates that Pods exist in the Zone.
17
+ ZoneConditionPodsExist = "ZonePodsExist"
18
+
19
+ // ZoneConditionVirtualMachinesExist indicates that VirtualMachines exist
20
+ // in the Zone.
21
+ ZoneConditionVirtualMachinesExist = "ZoneVirtualMachinesExist"
22
+
23
+ // ZoneConditionNamespaceResourcePoolReconciled indicates that the
24
+ // Namespace ResourcePool has been reconciled.
25
+ ZoneConditionNamespaceResourcePoolReconciled = "ZoneNamespaceResourcePoolReconciled"
26
+ )
27
+
10
28
// AvailabilityZoneReference describes a reference to the cluster scoped
11
29
// AvailabilityZone object.
12
30
type AvailabilityZoneReference struct {
@@ -21,6 +39,11 @@ type AvailabilityZoneReference struct {
21
39
// VSphereEntityInfo contains the managed object IDs associated with
22
40
// a vSphere entity
23
41
type VSphereEntityInfo struct {
42
+ // +optional
43
+ // ClusterMoIDs are the managed object IDs of the vSphere Clusters in an
44
+ // individual vSphere Zone. A zone may be comprised of multiple Clusters.
45
+ ClusterMoIDs []string `json:"clusterMoIDs,omitempty"`
46
+
24
47
// +optional
25
48
// PoolMoIDs are the managed object ID of the vSphere ResourcePools
26
49
// in an individual vSphere Zone. A zone may be comprised of
@@ -33,6 +56,18 @@ type VSphereEntityInfo struct {
33
56
FolderMoID string `json:"folderMoID,omitempty"`
34
57
}
35
58
59
+ // VirtualMachineClassAllocationInfo describes the definition of allocations
60
+ // for Virtual Machines of a given class.
61
+ type VirtualMachineClassAllocationInfo struct {
62
+ // +optional
63
+ // Identifier of the Virtual Machine class used for allocation.
64
+ ReservedVMClass string `json:"reservedVmClass,omitempty"`
65
+
66
+ // +optional
67
+ // Number of instances of given Virtual Machine class.
68
+ Count int64 `json:"count,omitempty"`
69
+ }
70
+
36
71
// ZoneSpec contains identifying information about the
37
72
// vSphere resources used to represent a Kubernetes namespace on individual
38
73
// vSphere Zones.
@@ -51,13 +86,55 @@ type ZoneSpec struct {
51
86
// Zone is a reference to the cluster scoped AvailabilityZone this
52
87
// Zone is derived from.
53
88
Zone AvailabilityZoneReference `json:"availabilityZoneReference"`
89
+
90
+ // +optional
91
+ // Guaranteed number of reserved Virtual Machine class instances that are available for the
92
+ // namespace in this zone.
93
+ VirtualMachineReservations []VirtualMachineClassAllocationInfo `json:"virtualMachineReservations,omitempty"`
94
+
95
+ // +optional
96
+ // CPU limit (in megahertz) for the namespace in this zone in addition to the limits specified as part of
97
+ // reserved Virtual Machine classes.
98
+ CPULimitMHz int64 `json:"cpuLimitMHz,omitempty"`
99
+
100
+ // +optional
101
+ // CPU reservation (in megahertz) for the namespace in this zone, for VMs
102
+ // that are not using reserved Virtual Machine class instances.
103
+ CPUReservationMHz int64 `json:"cpuReservationMHz,omitempty"`
104
+
105
+ // +optional
106
+ // Memory limit (in mebibytes) for the namespace in this zone in addition
107
+ // to the limits specified as part of reserved Virtual Machine classes.
108
+ MemoryLimitMiB int64 `json:"memoryLimitMiB,omitempty"`
109
+
110
+ // +optional
111
+ // Memory reservation (in mebibytes) for the namespace in this zone, for
112
+ // VMs that are not using reserved Virtual Machine class instances.
113
+ MemoryReservationMiB int64 `json:"memoryReservationMiB,omitempty"`
114
+
115
+ // +optional
116
+ // Determines whether workloads that don't use a reserved Virtual Machine class
117
+ // instance can use a DirectPath device.
118
+ DisallowUnreservedDirectPathUsage bool `json:"disallowUnreservedDirectPathUsage,omitempty"`
119
+
120
+ // +optional
121
+ // AllowedClusterComputeResourceMoIDs are the managed object IDs of the vSphere
122
+ // ClusterComputeResources in this vSphere Zone on which workloads in this Supervisor
123
+ // Namespace can be placed on. If empty, all the vSphere Clusters in the vSphere Zone are
124
+ // candidates to place the workloads in this vSphere Namespace.
125
+ AllowedClusterComputeResourceMoIDs []string `json:"allowedClusterComputeResourceMoIDs,omitempty"`
54
126
}
55
127
56
128
// ZoneStatus defines the observed state of Zone.
57
129
type ZoneStatus struct {
58
130
// +optional
59
131
// Conditions describes the observed conditions of the Zone
60
132
Conditions []metav1.Condition `json:"conditions,omitempty"`
133
+
134
+ // +optional
135
+ // MarkedForRemoval describes if the Zone is marked for removal from the
136
+ // Namespace.
137
+ MarkedForRemoval bool `json:"markedForRemoval,omitempty"`
61
138
}
62
139
63
140
// Zone is the schema for the Zone resource for the vSphere topology API.
0 commit comments