Skip to content

Commit ae86bcd

Browse files
committed
feat: add rootVolume API
1 parent 64bc043 commit ae86bcd

File tree

5 files changed

+176
-0
lines changed

5 files changed

+176
-0
lines changed

api/v1alpha1/aws_node_types.go

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33

44
package v1alpha1
55

6+
import (
7+
capav1 "github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/api/external/sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta2"
8+
)
9+
610
type AWSControlPlaneNodeSpec struct {
711
// The IAM instance profile to use for the cluster Machines.
812
// +kubebuilder:validation:Optional
@@ -50,6 +54,10 @@ type AWSGenericNodeSpec struct {
5054
// PlacementGroup specifies the placement group in which to launch the instance.
5155
// +kubebuilder:validation:Optional
5256
PlacementGroup *PlacementGroup `json:"placementGroup,omitempty"`
57+
58+
// Configuration options for the root storage volume.
59+
// +kubebuilder:validation:Optional
60+
RootVolume *Volume `json:"rootVolume,omitempty"`
5361
}
5462

5563
// +kubebuilder:validation:MaxItems=32
@@ -105,3 +113,38 @@ type AMILookup struct {
105113
// +kubebuilder:validation:MaxLength=32
106114
BaseOS string `json:"baseOS,omitempty"`
107115
}
116+
117+
type Volume struct {
118+
// Device name
119+
// +kubebuilder:validation:Optional
120+
DeviceName string `json:"deviceName,omitempty"`
121+
122+
// Size specifies size (in Gi) of the storage device.
123+
// Must be greater than the image snapshot size or 8 (whichever is greater).
124+
// +kubebuilder:validation:Optional
125+
// +kubebuilder:validation:Minimum=8
126+
// +kubebuilder:default=80
127+
Size int64 `json:"size,omitempty"`
128+
129+
// Type is the type of the volume (e.g. gp2, io1, etc...).
130+
// +kubebuilder:validation:Optional
131+
Type capav1.VolumeType `json:"type,omitempty"`
132+
133+
// IOPS is the number of IOPS requested for the disk. Not applicable to all types.
134+
// +kubebuilder:validation:Optional
135+
IOPS int64 `json:"iops,omitempty"`
136+
137+
// Throughput to provision in MiB/s supported for the volume type. Not applicable to all types.
138+
// +kubebuilder:validation:Optional
139+
Throughput int64 `json:"throughput,omitempty"`
140+
141+
// Encrypted is whether the volume should be encrypted or not.
142+
// +kubebuilder:validation:Optional
143+
Encrypted bool `json:"encrypted,omitempty"`
144+
145+
// EncryptionKey is the KMS key to use to encrypt the volume. Can be either a KMS key ID or ARN.
146+
// If Encrypted is set and this is omitted, the default AWS key will be used.
147+
// The key must already exist and be accessible by the controller.
148+
// +kubebuilder:validation:Optional
149+
EncryptionKey string `json:"encryptionKey,omitempty"`
150+
}

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

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -424,6 +424,41 @@ spec:
424424
required:
425425
- name
426426
type: object
427+
rootVolume:
428+
description: Configuration options for the root storage volume.
429+
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
461+
type: object
427462
type: object
428463
nodeRegistration:
429464
default: {}

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

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,45 @@ spec:
117117
required:
118118
- name
119119
type: object
120+
rootVolume:
121+
description: Configuration options for the root storage volume.
122+
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
158+
type: object
120159
type: object
121160
nodeRegistration:
122161
default: {}

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

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,45 @@ spec:
117117
required:
118118
- name
119119
type: object
120+
rootVolume:
121+
description: Configuration options for the root storage volume.
122+
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
158+
type: object
120159
type: object
121160
taints:
122161
description: Taints specifies the taints the Node API object should

api/v1alpha1/zz_generated.deepcopy.go

Lines changed: 20 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)