mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-07-25 08:15:18 -04:00
AB#2261 Add loadbalancer for control-plane recovery (#151)
Signed-off-by: Daniel Weiße <dw@edgeless.systems>
This commit is contained in:
parent
273d89e002
commit
e367e1a68b
16 changed files with 418 additions and 243 deletions
|
@ -91,6 +91,7 @@ func (c *Client) CreateInstances(ctx context.Context, input CreateInstancesInput
|
|||
{Name: proto.String("bootstrapper"), Port: proto.Int32(constants.BootstrapperPort)},
|
||||
{Name: proto.String("verify"), Port: proto.Int32(constants.VerifyServiceNodePortGRPC)},
|
||||
{Name: proto.String("konnectivity"), Port: proto.Int32(constants.KonnectivityPort)},
|
||||
{Name: proto.String("recovery"), Port: proto.Int32(constants.RecoveryPort)},
|
||||
},
|
||||
Template: c.controlPlaneTemplate,
|
||||
UID: c.uid,
|
||||
|
|
|
@ -44,6 +44,7 @@ func (c *Client) CreateLoadBalancers(ctx context.Context, isDebugCluster bool) e
|
|||
//
|
||||
// LoadBalancer definitions.
|
||||
//
|
||||
// LoadBalancers added here also need to be referenced in instances.go:*Client.CreateInstances
|
||||
|
||||
c.loadbalancers = append(c.loadbalancers, &loadBalancer{
|
||||
name: c.buildResourceName("kube"),
|
||||
|
@ -78,6 +79,14 @@ func (c *Client) CreateLoadBalancers(ctx context.Context, isDebugCluster bool) e
|
|||
healthCheck: computepb.HealthCheck_TCP,
|
||||
})
|
||||
|
||||
c.loadbalancers = append(c.loadbalancers, &loadBalancer{
|
||||
name: c.buildResourceName("recovery"),
|
||||
ip: c.loadbalancerIPname,
|
||||
frontendPort: constants.RecoveryPort,
|
||||
backendPortName: "recovery",
|
||||
healthCheck: computepb.HealthCheck_TCP,
|
||||
})
|
||||
|
||||
// Only create when the debug cluster flag is set in the Constellation config
|
||||
if isDebugCluster {
|
||||
c.loadbalancers = append(c.loadbalancers, &loadBalancer{
|
||||
|
|
|
@ -119,10 +119,10 @@ func TestCreateLoadBalancers(t *testing.T) {
|
|||
}
|
||||
|
||||
if tc.isDebugCluster {
|
||||
assert.Equal(5, len(client.loadbalancers))
|
||||
assert.Equal(6, len(client.loadbalancers))
|
||||
assert.True(foundDebugdLB, "debugd loadbalancer not found in debug-mode")
|
||||
} else {
|
||||
assert.Equal(4, len(client.loadbalancers))
|
||||
assert.Equal(5, len(client.loadbalancers))
|
||||
assert.False(foundDebugdLB, "debugd loadbalancer found in non-debug mode")
|
||||
}
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue