Skip to content

Commit 7aa470d

Browse files
committed
refactor: extend the API to support both root and additional volumes
1 parent 76ca116 commit 7aa470d

19 files changed

+777
-333
lines changed

api/v1alpha1/aws_node_types.go

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,9 @@ type AWSGenericNodeSpec struct {
5555
// +kubebuilder:validation:Optional
5656
PlacementGroup *PlacementGroup `json:"placementGroup,omitempty"`
5757

58-
// Configuration options for the root storage volume.
58+
// Configuration options for the root and additional storage volume.
5959
// +kubebuilder:validation:Optional
60-
RootVolume *Volume `json:"rootVolume,omitempty"`
60+
Volumes *AWSVolumes `json:"volumes,omitempty"`
6161
}
6262

6363
// +kubebuilder:validation:MaxItems=32
@@ -114,7 +114,17 @@ type AMILookup struct {
114114
BaseOS string `json:"baseOS,omitempty"`
115115
}
116116

117-
type Volume struct {
117+
type AWSVolumes struct {
118+
// Configuration options for the root storage volume.
119+
// +kubebuilder:validation:Optional
120+
Root *AWSVolume `json:"root,omitempty"`
121+
122+
// Configuration options for non-root storage volumes.
123+
// +kubebuilder:validation:Optional
124+
NonRoot []AWSVolume `json:"nonroot,omitempty"`
125+
}
126+
127+
type AWSVolume struct {
118128
// Device name
119129
// +kubebuilder:validation:Optional
120130
DeviceName string `json:"deviceName,omitempty"`
@@ -123,7 +133,6 @@ type Volume struct {
123133
// Must be greater than the image snapshot size or 8 (whichever is greater).
124134
// +kubebuilder:validation:Optional
125135
// +kubebuilder:validation:Minimum=8
126-
// +kubebuilder:default=80
127136
Size int64 `json:"size,omitempty"`
128137

129138
// Type is the type of the volume (e.g. gp2, io1, etc...).

api/v1alpha1/crds/caren.nutanix.com_awsclusterconfigs.yaml

Lines changed: 72 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -424,40 +424,79 @@ spec:
424424
required:
425425
- name
426426
type: object
427-
rootVolume:
428-
description: Configuration options for the root storage volume.
427+
volumes:
428+
description: Configuration options for the root and additional storage volume.
429429
properties:
430-
deviceName:
431-
description: Device name
432-
type: string
433-
encrypted:
434-
description: Encrypted is whether the volume should be encrypted or not.
435-
type: boolean
436-
encryptionKey:
437-
description: |-
438-
EncryptionKey is the KMS key to use to encrypt the volume. Can be either a KMS key ID or ARN.
439-
If Encrypted is set and this is omitted, the default AWS key will be used.
440-
The key must already exist and be accessible by the controller.
441-
type: string
442-
iops:
443-
description: IOPS is the number of IOPS requested for the disk. Not applicable to all types.
444-
format: int64
445-
type: integer
446-
size:
447-
default: 80
448-
description: |-
449-
Size specifies size (in Gi) of the storage device.
450-
Must be greater than the image snapshot size or 8 (whichever is greater).
451-
format: int64
452-
minimum: 8
453-
type: integer
454-
throughput:
455-
description: Throughput to provision in MiB/s supported for the volume type. Not applicable to all types.
456-
format: int64
457-
type: integer
458-
type:
459-
description: Type is the type of the volume (e.g. gp2, io1, etc...).
460-
type: string
430+
nonroot:
431+
description: Configuration options for non-root storage volumes.
432+
items:
433+
properties:
434+
deviceName:
435+
description: Device name
436+
type: string
437+
encrypted:
438+
description: Encrypted is whether the volume should be encrypted or not.
439+
type: boolean
440+
encryptionKey:
441+
description: |-
442+
EncryptionKey is the KMS key to use to encrypt the volume. Can be either a KMS key ID or ARN.
443+
If Encrypted is set and this is omitted, the default AWS key will be used.
444+
The key must already exist and be accessible by the controller.
445+
type: string
446+
iops:
447+
description: IOPS is the number of IOPS requested for the disk. Not applicable to all types.
448+
format: int64
449+
type: integer
450+
size:
451+
description: |-
452+
Size specifies size (in Gi) of the storage device.
453+
Must be greater than the image snapshot size or 8 (whichever is greater).
454+
format: int64
455+
minimum: 8
456+
type: integer
457+
throughput:
458+
description: Throughput to provision in MiB/s supported for the volume type. Not applicable to all types.
459+
format: int64
460+
type: integer
461+
type:
462+
description: Type is the type of the volume (e.g. gp2, io1, etc...).
463+
type: string
464+
type: object
465+
type: array
466+
root:
467+
description: Configuration options for the root storage volume.
468+
properties:
469+
deviceName:
470+
description: Device name
471+
type: string
472+
encrypted:
473+
description: Encrypted is whether the volume should be encrypted or not.
474+
type: boolean
475+
encryptionKey:
476+
description: |-
477+
EncryptionKey is the KMS key to use to encrypt the volume. Can be either a KMS key ID or ARN.
478+
If Encrypted is set and this is omitted, the default AWS key will be used.
479+
The key must already exist and be accessible by the controller.
480+
type: string
481+
iops:
482+
description: IOPS is the number of IOPS requested for the disk. Not applicable to all types.
483+
format: int64
484+
type: integer
485+
size:
486+
description: |-
487+
Size specifies size (in Gi) of the storage device.
488+
Must be greater than the image snapshot size or 8 (whichever is greater).
489+
format: int64
490+
minimum: 8
491+
type: integer
492+
throughput:
493+
description: Throughput to provision in MiB/s supported for the volume type. Not applicable to all types.
494+
format: int64
495+
type: integer
496+
type:
497+
description: Type is the type of the volume (e.g. gp2, io1, etc...).
498+
type: string
499+
type: object
461500
type: object
462501
type: object
463502
nodeRegistration:

api/v1alpha1/crds/caren.nutanix.com_awsworkernodeconfigs.yaml

Lines changed: 81 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -117,44 +117,88 @@ spec:
117117
required:
118118
- name
119119
type: object
120-
rootVolume:
121-
description: Configuration options for the root storage volume.
120+
volumes:
121+
description: Configuration options for the root and additional
122+
storage volume.
122123
properties:
123-
deviceName:
124-
description: Device name
125-
type: string
126-
encrypted:
127-
description: Encrypted is whether the volume should be encrypted
128-
or not.
129-
type: boolean
130-
encryptionKey:
131-
description: |-
132-
EncryptionKey is the KMS key to use to encrypt the volume. Can be either a KMS key ID or ARN.
133-
If Encrypted is set and this is omitted, the default AWS key will be used.
134-
The key must already exist and be accessible by the controller.
135-
type: string
136-
iops:
137-
description: IOPS is the number of IOPS requested for the
138-
disk. Not applicable to all types.
139-
format: int64
140-
type: integer
141-
size:
142-
default: 80
143-
description: |-
144-
Size specifies size (in Gi) of the storage device.
145-
Must be greater than the image snapshot size or 8 (whichever is greater).
146-
format: int64
147-
minimum: 8
148-
type: integer
149-
throughput:
150-
description: Throughput to provision in MiB/s supported for
151-
the volume type. Not applicable to all types.
152-
format: int64
153-
type: integer
154-
type:
155-
description: Type is the type of the volume (e.g. gp2, io1,
156-
etc...).
157-
type: string
124+
nonroot:
125+
description: Configuration options for non-root storage volumes.
126+
items:
127+
properties:
128+
deviceName:
129+
description: Device name
130+
type: string
131+
encrypted:
132+
description: Encrypted is whether the volume should
133+
be encrypted or not.
134+
type: boolean
135+
encryptionKey:
136+
description: |-
137+
EncryptionKey is the KMS key to use to encrypt the volume. Can be either a KMS key ID or ARN.
138+
If Encrypted is set and this is omitted, the default AWS key will be used.
139+
The key must already exist and be accessible by the controller.
140+
type: string
141+
iops:
142+
description: IOPS is the number of IOPS requested for
143+
the disk. Not applicable to all types.
144+
format: int64
145+
type: integer
146+
size:
147+
description: |-
148+
Size specifies size (in Gi) of the storage device.
149+
Must be greater than the image snapshot size or 8 (whichever is greater).
150+
format: int64
151+
minimum: 8
152+
type: integer
153+
throughput:
154+
description: Throughput to provision in MiB/s supported
155+
for the volume type. Not applicable to all types.
156+
format: int64
157+
type: integer
158+
type:
159+
description: Type is the type of the volume (e.g. gp2,
160+
io1, etc...).
161+
type: string
162+
type: object
163+
type: array
164+
root:
165+
description: Configuration options for the root storage volume.
166+
properties:
167+
deviceName:
168+
description: Device name
169+
type: string
170+
encrypted:
171+
description: Encrypted is whether the volume should be
172+
encrypted or not.
173+
type: boolean
174+
encryptionKey:
175+
description: |-
176+
EncryptionKey is the KMS key to use to encrypt the volume. Can be either a KMS key ID or ARN.
177+
If Encrypted is set and this is omitted, the default AWS key will be used.
178+
The key must already exist and be accessible by the controller.
179+
type: string
180+
iops:
181+
description: IOPS is the number of IOPS requested for
182+
the disk. Not applicable to all types.
183+
format: int64
184+
type: integer
185+
size:
186+
description: |-
187+
Size specifies size (in Gi) of the storage device.
188+
Must be greater than the image snapshot size or 8 (whichever is greater).
189+
format: int64
190+
minimum: 8
191+
type: integer
192+
throughput:
193+
description: Throughput to provision in MiB/s supported
194+
for the volume type. Not applicable to all types.
195+
format: int64
196+
type: integer
197+
type:
198+
description: Type is the type of the volume (e.g. gp2,
199+
io1, etc...).
200+
type: string
201+
type: object
158202
type: object
159203
type: object
160204
nodeRegistration:

0 commit comments

Comments
 (0)