Skip to content

Commit

Permalink
setting for all except sap-converged-cloud
Browse files Browse the repository at this point in the history
setting worker name and volume size and type

volume size from parameters

test updated
  • Loading branch information
jaroslaw-pieszka committed Aug 12, 2024
1 parent dc9efe4 commit fbb17fb
Show file tree
Hide file tree
Showing 8 changed files with 52 additions and 3 deletions.
11 changes: 10 additions & 1 deletion internal/process/provisioning/create_runtime_resource_step.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,11 @@ func (s *CreateRuntimeResourceStep) updateRuntimeResourceObject(runtime *imv1.Ru
runtime.Spec.Shoot.SecretBindingName = *operation.ProvisioningParameters.Parameters.TargetSecret
runtime.Spec.Shoot.ControlPlane.HighAvailability = s.createHighAvailabilityConfiguration()
runtime.Spec.Shoot.EnforceSeedLocation = operation.ProvisioningParameters.Parameters.ShootAndSeedSameRegion
runtime.Spec.Security = s.createSecurityConfiguration(operation)
runtime.Spec.Shoot.Networking = s.createNetworkingConfiguration(operation)
runtime.Spec.Shoot.Kubernetes = s.createKubernetesConfiguration(operation)

runtime.Spec.Security = s.createSecurityConfiguration(operation)

return nil
}

Expand Down Expand Up @@ -190,10 +192,13 @@ func (s *CreateRuntimeResourceStep) createShootProvider(operation *internal.Oper
max := int32(DefaultIfParamNotSet(values.DefaultAutoScalerMax, operation.ProvisioningParameters.Parameters.AutoScalerMax))
min := int32(DefaultIfParamNotSet(values.DefaultAutoScalerMin, operation.ProvisioningParameters.Parameters.AutoScalerMin))

volumeSize := int32(DefaultIfParamNotSet(values.VolumeSizeGb, operation.ProvisioningParameters.Parameters.VolumeSizeGb))

providerObj := imv1.Provider{
Type: values.ProviderType,
Workers: []gardener.Worker{
{
Name: "cpu-worker-0",
Machine: gardener.Machine{
Type: DefaultIfParamNotSet(values.DefaultMachineType, operation.ProvisioningParameters.Parameters.MachineType),
Image: &gardener.ShootMachineImage{
Expand All @@ -206,6 +211,10 @@ func (s *CreateRuntimeResourceStep) createShootProvider(operation *internal.Oper
MaxSurge: &maxSurge,
MaxUnavailable: &maxUnavailable,
Zones: values.Zones,
Volume: &gardener.Volume{
Type: ptr.String(values.DiskType),
VolumeSize: string(volumeSize),
},
},
},
}
Expand Down
6 changes: 6 additions & 0 deletions internal/provider/aws.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ func (p *AWSInputProvider) Provide() Values {
DefaultMachineType: DefaultAWSMachineType,
Region: region,
Purpose: PurposeProduction,
VolumeSizeGb: 50,
DiskType: "gp2",
}
}

Expand Down Expand Up @@ -72,6 +74,8 @@ func (p *AWSTrialInputProvider) Provide() Values {
DefaultMachineType: machineType,
Region: region,
Purpose: PurposeEvaluation,
VolumeSizeGb: 50,
DiskType: "gp2",
}
}

Expand Down Expand Up @@ -107,6 +111,8 @@ func (p *AWSFreemiumInputProvider) Provide() Values {
DefaultMachineType: machineType,
Region: region,
Purpose: PurposeEvaluation,
VolumeSizeGb: 50,
DiskType: "gp2",
}
}

Expand Down
8 changes: 8 additions & 0 deletions internal/provider/aws_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ func TestAWSDefaults(t *testing.T) {
DefaultMachineType: "m6i.large",
Region: "eu-central-1",
Purpose: "production",
VolumeSizeGb: 50,
DiskType: "gp2",
}, values)
}

Expand Down Expand Up @@ -68,6 +70,8 @@ func TestAWSSpecific(t *testing.T) {
DefaultMachineType: "m6i.large",
Region: "ap-southeast-1",
Purpose: "production",
VolumeSizeGb: 50,
DiskType: "gp2",
}, values)
}

Expand Down Expand Up @@ -96,6 +100,8 @@ func TestAWSTrialDefaults(t *testing.T) {
DefaultMachineType: "m5.xlarge",
Region: "eu-central-1",
Purpose: "evaluation",
VolumeSizeGb: 50,
DiskType: "gp2",
}, values)
}

Expand Down Expand Up @@ -128,6 +134,8 @@ func TestAWSTrialSpecific(t *testing.T) {
DefaultMachineType: "m5.xlarge",
Region: "ap-southeast-1",
Purpose: "evaluation",
VolumeSizeGb: 50,
DiskType: "gp2",
}, values)
}

Expand Down
8 changes: 8 additions & 0 deletions internal/provider/azure.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ func (p *AzureInputProvider) Provide() Values {
DefaultMachineType: DefaultAzureMachineType,
Region: region,
Purpose: PurposeProduction,
DiskType: "Standard_LRS",
VolumeSizeGb: 50,
}
}

Expand Down Expand Up @@ -78,6 +80,8 @@ func (p *AzureTrialInputProvider) Provide() Values {
DefaultMachineType: machineType,
Region: region,
Purpose: PurposeEvaluation,
DiskType: "Standard_LRS",
VolumeSizeGb: 50,
}
}

Expand Down Expand Up @@ -120,6 +124,8 @@ func (p *AzureLiteInputProvider) Provide() Values {
DefaultMachineType: machineType,
Region: region,
Purpose: PurposeEvaluation,
DiskType: "Standard_LRS",
VolumeSizeGb: 50,
}
}

Expand Down Expand Up @@ -153,6 +159,8 @@ func (p *AzureFreemiumInputProvider) Provide() Values {
DefaultMachineType: machineType,
Region: region,
Purpose: PurposeEvaluation,
DiskType: "Standard_LRS",
VolumeSizeGb: 50,
}
}

Expand Down
12 changes: 12 additions & 0 deletions internal/provider/azure_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ func TestAzureDefaults(t *testing.T) {
DefaultMachineType: "Standard_D2s_v5",
Region: "eastus",
Purpose: "production",
DiskType: "Standard_LRS",
VolumeSizeGb: 50,
}, values)
}

Expand Down Expand Up @@ -62,6 +64,8 @@ func TestAzureTrialDefaults(t *testing.T) {
DefaultMachineType: "Standard_D4s_v5",
Region: "switzerlandnorth",
Purpose: "evaluation",
DiskType: "Standard_LRS",
VolumeSizeGb: 50,
}, values)
}

Expand Down Expand Up @@ -89,6 +93,8 @@ func TestAzureLiteDefaults(t *testing.T) {
DefaultMachineType: "Standard_D4s_v5",
Region: "eastus",
Purpose: "evaluation",
DiskType: "Standard_LRS",
VolumeSizeGb: 50,
}, values)
}

Expand Down Expand Up @@ -122,6 +128,8 @@ func TestAzureSpecific(t *testing.T) {
DefaultMachineType: "Standard_D2s_v5",
Region: "uksouth",
Purpose: "production",
DiskType: "Standard_LRS",
VolumeSizeGb: 50,
}, values)
}

Expand Down Expand Up @@ -156,6 +164,8 @@ func TestAzureTrialSpecific(t *testing.T) {
DefaultMachineType: "Standard_D4s_v5",
Region: "southeastasia",
Purpose: "evaluation",
DiskType: "Standard_LRS",
VolumeSizeGb: 50,
}, values)
}

Expand Down Expand Up @@ -188,5 +198,7 @@ func TestAzureLiteSpecific(t *testing.T) {
DefaultMachineType: "Standard_D4s_v5",
Region: "uksouth",
Purpose: "evaluation",
DiskType: "Standard_LRS",
VolumeSizeGb: 50,
}, values)
}
4 changes: 4 additions & 0 deletions internal/provider/gcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ func (p *GCPInputProvider) Provide() Values {
DefaultMachineType: DefaultGCPMachineType,
Region: region,
Purpose: PurposeProduction,
VolumeSizeGb: 50,
DiskType: "pd-standard",
}
}

Expand Down Expand Up @@ -63,6 +65,8 @@ func (p *GCPTrialInputProvider) Provide() Values {
DefaultMachineType: DefaultGCPTrialMachineType,
Region: region,
Purpose: PurposeEvaluation,
VolumeSizeGb: 30,
DiskType: "pd-standard",
}
}

Expand Down
5 changes: 3 additions & 2 deletions internal/provider/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@ package provider
type Values struct {
DefaultAutoScalerMax int
DefaultAutoScalerMin int
ZonesCount int //TODO do we need this as separate value?
ZonesCount int
Zones []string
ProviderType string
DefaultMachineType string
Region string
Purpose string //TODO default per landscape in configuration

VolumeSizeGb int
DiskType string
// todo: add other plan specific values
}
1 change: 1 addition & 0 deletions internal/provider/sap-converged-cloud.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ func (p *SapConvergedCloudInputProvider) Provide() Values {
DefaultMachineType: DefaultSapConvergedCloudMachineType,
Region: region,
Purpose: PurposeProduction,
DiskType: "",
}
}

Expand Down

0 comments on commit fbb17fb

Please sign in to comment.