mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-07-28 01:35:18 -04:00
Use multiple loadbalancers on GCP
This commit is contained in:
parent
c954ec089f
commit
a02a46e454
59 changed files with 1629 additions and 557 deletions
|
@ -9,6 +9,7 @@ import (
|
|||
|
||||
"github.com/edgelesssys/constellation/bootstrapper/role"
|
||||
"github.com/edgelesssys/constellation/internal/cloud/cloudtypes"
|
||||
"github.com/edgelesssys/constellation/internal/constants"
|
||||
"google.golang.org/api/iterator"
|
||||
computepb "google.golang.org/genproto/googleapis/cloud/compute/v1"
|
||||
"google.golang.org/protobuf/proto"
|
||||
|
@ -76,8 +77,14 @@ func (c *Client) CreateInstances(ctx context.Context, input CreateInstancesInput
|
|||
ops = []Operation{}
|
||||
|
||||
controlPlaneGroupInput := instanceGroupManagerInput{
|
||||
Count: input.CountControlPlanes,
|
||||
Name: strings.Join([]string{c.name, "control-plane", c.uid}, "-"),
|
||||
Count: input.CountControlPlanes,
|
||||
Name: strings.Join([]string{c.name, "control-plane", c.uid}, "-"),
|
||||
NamedPorts: []*computepb.NamedPort{
|
||||
{Name: proto.String("kubernetes"), Port: proto.Int32(constants.KubernetesPort)},
|
||||
{Name: proto.String("debugd"), Port: proto.Int32(constants.DebugdPort)},
|
||||
{Name: proto.String("bootstrapper"), Port: proto.Int32(constants.BootstrapperPort)},
|
||||
{Name: proto.String("verify"), Port: proto.Int32(constants.VerifyServiceNodePortGRPC)},
|
||||
},
|
||||
Template: c.controlPlaneTemplate,
|
||||
UID: c.uid,
|
||||
Project: c.project,
|
||||
|
@ -277,18 +284,20 @@ func (c *Client) getInstanceIPs(ctx context.Context, groupID string, list cloudt
|
|||
}
|
||||
|
||||
type instanceGroupManagerInput struct {
|
||||
Count int
|
||||
Name string
|
||||
Template string
|
||||
Project string
|
||||
Zone string
|
||||
UID string
|
||||
Count int
|
||||
Name string
|
||||
NamedPorts []*computepb.NamedPort
|
||||
Template string
|
||||
Project string
|
||||
Zone string
|
||||
UID string
|
||||
}
|
||||
|
||||
func (i *instanceGroupManagerInput) InsertInstanceGroupManagerRequest() computepb.InsertInstanceGroupManagerRequest {
|
||||
return computepb.InsertInstanceGroupManagerRequest{
|
||||
InstanceGroupManagerResource: &computepb.InstanceGroupManager{
|
||||
BaseInstanceName: proto.String(i.Name),
|
||||
NamedPorts: i.NamedPorts,
|
||||
InstanceTemplate: proto.String("projects/" + i.Project + "/global/instanceTemplates/" + i.Template),
|
||||
Name: proto.String(i.Name),
|
||||
TargetSize: proto.Int32(int32(i.Count)),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue