Skip to content

Commit 6d2fb96

Browse files
committed
Updates from review
1 parent 85da18e commit 6d2fb96

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

docs/proposals/20210310-opt-in-autoscaling-from-zero.md

+16-5
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,9 @@ const (
179179
// DockerMachineTemplateStatus defines the observed state of a DockerMachineTemplate
180180
type DockerMachineTemplateStatus struct {
181181
Capacity corev1.ResourceList `json:"capacity,omitempty"`
182-
NodeInfo *platform.NodeSystemInfo `json:"nodeInfo,omitempty"`
182+
183+
// +optional
184+
NodeInfo *platform.NodeInfo `json:"nodeInfo,omitempty"`
183185
}
184186
185187
// DockerMachineTemplate is the Schema for the dockermachinetemplates API.
@@ -193,25 +195,34 @@ type DockerMachineTemplate struct {
193195
```
194196
_Note: the `ResourceList` and `ResourceName` referenced are from k8s.io/api/core/v1`_
195197

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
197199
implement in the `util` package of the `cluster-api` project. The defined types and constants are exported for use by the
198200
cluster-api providers integrations.
199201
Its definition would look like this:
200202

201203
```go
202204
package platform
203205

206+
// Architecture represents the architecture of the node. Its underlying type is a string.
207+
// +enum
204208
type Architecture string
205209

210+
// Architecture constants defined for clarity and to be used by the cluster-api providers.
206211
const (
207212
ArchitectureAmd64 Architecture = "amd64"
208213
ArchitectureArm64 Architecture = "arm64"
209214
ArchitectureS390x Architecture = "s390x"
210215
ArchitecturePpc64le Architecture = "ppc64le"
211216
)
212217

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
214223
Architecture Architecture `json:"architecture,omitempty"`
224+
// OperatingSystem is a string representing the operating system of the node.
225+
// +optional
215226
OperatingSystem string `json:"operatingSystem,omitempty"`
216227
}
217228
```
@@ -265,8 +276,8 @@ metadata:
265276
capacity.cluster-autoscaler.kubernetes.io/memory: "500mb"
266277
capacity.cluster-autoscaler.kubernetes.io/cpu: "1"
267278
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"
270281
```
271282
_Note: the annotations will be defined in the cluster autoscaler, not in cluster-api._
272283

0 commit comments

Comments
 (0)