mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-05-07 16:55:15 -04:00
Add configurable node disk type (#317)
Signed-off-by: Daniel Weiße <dw@edgeless.systems>
This commit is contained in:
parent
6a84bb5b4b
commit
aa7fcce8af
7 changed files with 69 additions and 21 deletions
|
@ -19,6 +19,7 @@ func (c *Client) CreateInstances(ctx context.Context, input CreateInstancesInput
|
|||
Count: input.CountWorkers,
|
||||
InstanceType: input.InstanceType,
|
||||
StateDiskSizeGB: int32(input.StateDiskSizeGB),
|
||||
StateDiskType: input.StateDiskType,
|
||||
Image: input.Image,
|
||||
UserAssingedIdentity: input.UserAssingedIdentity,
|
||||
LoadBalancerBackendAddressPool: azure.BackendAddressPoolWorkerName + "-" + c.uid,
|
||||
|
@ -37,6 +38,7 @@ func (c *Client) CreateInstances(ctx context.Context, input CreateInstancesInput
|
|||
Count: input.CountControlPlanes,
|
||||
InstanceType: input.InstanceType,
|
||||
StateDiskSizeGB: int32(input.StateDiskSizeGB),
|
||||
StateDiskType: input.StateDiskType,
|
||||
Image: input.Image,
|
||||
UserAssingedIdentity: input.UserAssingedIdentity,
|
||||
LoadBalancerBackendAddressPool: azure.BackendAddressPoolControlPlaneName + "-" + c.uid,
|
||||
|
@ -70,6 +72,7 @@ type CreateInstancesInput struct {
|
|||
CountControlPlanes int
|
||||
InstanceType string
|
||||
StateDiskSizeGB int
|
||||
StateDiskType string
|
||||
Image string
|
||||
UserAssingedIdentity string
|
||||
}
|
||||
|
@ -175,6 +178,7 @@ func (c *Client) createScaleSet(ctx context.Context, input CreateScaleSetInput)
|
|||
Location: c.location,
|
||||
InstanceType: input.InstanceType,
|
||||
StateDiskSizeGB: input.StateDiskSizeGB,
|
||||
StateDiskType: input.StateDiskType,
|
||||
Count: int64(input.Count),
|
||||
Username: "constellation",
|
||||
SubnetID: c.subnetID,
|
||||
|
@ -254,6 +258,7 @@ type CreateScaleSetInput struct {
|
|||
Count int
|
||||
InstanceType string
|
||||
StateDiskSizeGB int32
|
||||
StateDiskType string
|
||||
Image string
|
||||
UserAssingedIdentity string
|
||||
LoadBalancerBackendAddressPool string
|
||||
|
|
|
@ -17,6 +17,7 @@ type ScaleSet struct {
|
|||
Location string
|
||||
InstanceType string
|
||||
StateDiskSizeGB int32
|
||||
StateDiskType string
|
||||
Count int64
|
||||
Username string
|
||||
SubnetID string
|
||||
|
@ -62,6 +63,9 @@ func (s ScaleSet) Azure() armcompute.VirtualMachineScaleSet {
|
|||
CreateOption: armcompute.DiskCreateOptionTypesEmpty.ToPtr(),
|
||||
DiskSizeGB: to.Int32Ptr(s.StateDiskSizeGB),
|
||||
Lun: to.Int32Ptr(0),
|
||||
ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{
|
||||
StorageAccountType: (*armcompute.StorageAccountTypes)(to.StringPtr(s.StateDiskType)),
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
|
@ -126,6 +126,7 @@ func (c *Creator) createGCP(ctx context.Context, cl gcpclient, config *config.Co
|
|||
ImageID: config.Provider.GCP.Image,
|
||||
InstanceType: insType,
|
||||
StateDiskSizeGB: config.StateDiskSizeGB,
|
||||
StateDiskType: config.Provider.GCP.StateDiskType,
|
||||
KubeEnv: gcp.KubeEnv,
|
||||
}
|
||||
if err := cl.CreateInstances(ctx, createInput); err != nil {
|
||||
|
@ -167,6 +168,7 @@ func (c *Creator) createAzure(ctx context.Context, cl azureclient, config *confi
|
|||
CountWorkers: workerCount,
|
||||
InstanceType: insType,
|
||||
StateDiskSizeGB: config.StateDiskSizeGB,
|
||||
StateDiskType: config.Provider.Azure.StateDiskType,
|
||||
Image: config.Provider.Azure.Image,
|
||||
UserAssingedIdentity: config.Provider.Azure.UserAssignedIdentity,
|
||||
}
|
||||
|
|
|
@ -33,6 +33,7 @@ func (c *Client) CreateInstances(ctx context.Context, input CreateInstancesInput
|
|||
ImageID: input.ImageID,
|
||||
InstanceType: input.InstanceType,
|
||||
StateDiskSizeGB: int64(input.StateDiskSizeGB),
|
||||
StateDiskType: input.StateDiskType,
|
||||
Role: role.Worker.String(),
|
||||
KubeEnv: input.KubeEnv,
|
||||
Project: c.project,
|
||||
|
@ -55,6 +56,7 @@ func (c *Client) CreateInstances(ctx context.Context, input CreateInstancesInput
|
|||
ImageID: input.ImageID,
|
||||
InstanceType: input.InstanceType,
|
||||
StateDiskSizeGB: int64(input.StateDiskSizeGB),
|
||||
StateDiskType: input.StateDiskType,
|
||||
Role: role.ControlPlane.String(),
|
||||
KubeEnv: input.KubeEnv,
|
||||
Project: c.project,
|
||||
|
@ -295,6 +297,7 @@ type CreateInstancesInput struct {
|
|||
ImageID string
|
||||
InstanceType string
|
||||
StateDiskSizeGB int
|
||||
StateDiskType string
|
||||
KubeEnv string
|
||||
}
|
||||
|
||||
|
@ -306,6 +309,7 @@ type insertInstanceTemplateInput struct {
|
|||
ImageID string
|
||||
InstanceType string
|
||||
StateDiskSizeGB int64
|
||||
StateDiskType string
|
||||
Role string
|
||||
KubeEnv string
|
||||
Project string
|
||||
|
@ -337,6 +341,7 @@ func (i insertInstanceTemplateInput) insertInstanceTemplateRequest() *computepb.
|
|||
{
|
||||
InitializeParams: &computepb.AttachedDiskInitializeParams{
|
||||
DiskSizeGb: proto.Int64(i.StateDiskSizeGB),
|
||||
DiskType: proto.String(i.StateDiskType),
|
||||
},
|
||||
AutoDelete: proto.Bool(true),
|
||||
DeviceName: proto.String("state-disk"),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue