@@ -179,7 +179,9 @@ const (
179
179
// DockerMachineTemplateStatus defines the observed state of a DockerMachineTemplate
180
180
type DockerMachineTemplateStatus struct {
181
181
Capacity corev1.ResourceList `json:"capacity,omitempty"`
182
- NodeInfo *platform.NodeSystemInfo `json:"nodeInfo,omitempty"`
182
+
183
+ // +optional
184
+ NodeInfo *platform.NodeInfo `json:"nodeInfo,omitempty"`
183
185
}
184
186
185
187
// DockerMachineTemplate is the Schema for the dockermachinetemplates API.
@@ -193,25 +195,34 @@ type DockerMachineTemplate struct {
193
195
```
194
196
_ Note: the ` ResourceList ` and ` ResourceName ` referenced are from k8s.io/api/core/v1`_
195
197
196
- ` platform.NodeSystemInfo ` is a struct that contains the architecture and operating system information of the node, to
198
+ ` platform.NodeInfo ` is a struct that contains the architecture and operating system information of the node, to
197
199
implement in the ` util ` package of the ` cluster-api ` project. The defined types and constants are exported for use by the
198
200
cluster-api providers integrations.
199
201
Its definition would look like this:
200
202
201
203
``` go
202
204
package platform
203
205
206
+ // Architecture represents the architecture of the node. Its underlying type is a string.
207
+ // +enum
204
208
type Architecture string
205
209
210
+ // Architecture constants defined for clarity and to be used by the cluster-api providers.
206
211
const (
207
212
ArchitectureAmd64 Architecture = " amd64"
208
213
ArchitectureArm64 Architecture = " arm64"
209
214
ArchitectureS390x Architecture = " s390x"
210
215
ArchitecturePpc64le Architecture = " ppc64le"
211
216
)
212
217
213
- type NodeSystemInfo struct {
218
+ // NodeInfo contains information about the node's architecture and operating system.
219
+ type NodeInfo struct {
220
+ // Architecture is the architecture of the node. It is a string that can be any of (amd64, arm64, s390x, ppc64le).
221
+ // +optional
222
+ // +kubebuilder:validation:Enum=amd64;arm64;s390x;ppc64le
214
223
Architecture Architecture ` json:"architecture,omitempty"`
224
+ // OperatingSystem is a string representing the operating system of the node.
225
+ // +optional
215
226
OperatingSystem string ` json:"operatingSystem,omitempty"`
216
227
}
217
228
```
@@ -265,8 +276,8 @@ metadata:
265
276
capacity.cluster-autoscaler.kubernetes.io/memory: "500mb"
266
277
capacity.cluster-autoscaler.kubernetes.io/cpu: "1"
267
278
capacity.cluster-autoscaler.kubernetes.io/ephemeral-disk: "100Gi"
268
- node-info.cluster-autoscaler.kubernetes.io/cpu- architecture: "arm64"
269
- node-info.cluster-autoscaler.kubernetes.io/os : "linux"
279
+ node-info.cluster-autoscaler.kubernetes.io/architecture: "arm64"
280
+ node-info.cluster-autoscaler.kubernetes.io/operating-system : "linux"
270
281
```
271
282
_ Note: the annotations will be defined in the cluster autoscaler, not in cluster-api._
272
283
0 commit comments