mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-05-06 08:15:48 -04:00
terraform: gcp node groups (#1941)
* terraform: GCP node groups * cli: marshal GCP node groups to terraform variables This does not have any side effects for users. We still strictly create one control-plane and one worker group. This is a preparation for enabling customizable node groups in the future.
This commit is contained in:
parent
5823aa2438
commit
2808012c9c
17 changed files with 545 additions and 163 deletions
|
@ -166,20 +166,30 @@ func (c *Creator) createAWS(ctx context.Context, cl terraformClient, opts Create
|
|||
|
||||
func (c *Creator) createGCP(ctx context.Context, cl terraformClient, opts CreateOptions) (idFile clusterid.File, retErr error) {
|
||||
vars := terraform.GCPClusterVariables{
|
||||
CommonVariables: terraform.CommonVariables{
|
||||
Name: opts.Config.Name,
|
||||
CountControlPlanes: opts.ControlPlaneCount,
|
||||
CountWorkers: opts.WorkerCount,
|
||||
StateDiskSizeGB: opts.Config.StateDiskSizeGB,
|
||||
Name: opts.Config.Name,
|
||||
NodeGroups: map[string]terraform.GCPNodeGroup{
|
||||
"control_plane_default": {
|
||||
Role: "ControlPlane",
|
||||
StateDiskSizeGB: opts.Config.StateDiskSizeGB,
|
||||
InitialCount: opts.ControlPlaneCount,
|
||||
Zone: opts.Config.Provider.GCP.Zone,
|
||||
InstanceType: opts.InsType,
|
||||
DiskType: opts.Config.Provider.GCP.StateDiskType,
|
||||
},
|
||||
"worker_default": {
|
||||
Role: "Worker",
|
||||
StateDiskSizeGB: opts.Config.StateDiskSizeGB,
|
||||
InitialCount: opts.WorkerCount,
|
||||
Zone: opts.Config.Provider.GCP.Zone,
|
||||
InstanceType: opts.InsType,
|
||||
DiskType: opts.Config.Provider.GCP.StateDiskType,
|
||||
},
|
||||
},
|
||||
Project: opts.Config.Provider.GCP.Project,
|
||||
Region: opts.Config.Provider.GCP.Region,
|
||||
Zone: opts.Config.Provider.GCP.Zone,
|
||||
CredentialsFile: opts.Config.Provider.GCP.ServiceAccountKeyPath,
|
||||
InstanceType: opts.InsType,
|
||||
StateDiskType: opts.Config.Provider.GCP.StateDiskType,
|
||||
ImageID: opts.image,
|
||||
Debug: opts.Config.IsDebugCluster(),
|
||||
Project: opts.Config.Provider.GCP.Project,
|
||||
Region: opts.Config.Provider.GCP.Region,
|
||||
Zone: opts.Config.Provider.GCP.Zone,
|
||||
ImageID: opts.image,
|
||||
Debug: opts.Config.IsDebugCluster(),
|
||||
}
|
||||
|
||||
if err := cl.PrepareWorkspace(path.Join("terraform", strings.ToLower(cloudprovider.GCP.String())), &vars); err != nil {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue