Skip to content

Commit

Permalink
Add endpoint persistence in configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
francois141 authored and cvetkovic committed Apr 23, 2024
1 parent 975327b commit 7b18915
Show file tree
Hide file tree
Showing 10 changed files with 19 additions and 2 deletions.
2 changes: 2 additions & 0 deletions cmd/master_node/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,5 @@ redis:
password: ""
db: 0
fullPersistence: true

endpointPersistence: false
4 changes: 3 additions & 1 deletion cmd/master_node/config_cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,6 @@ redis:
replicas: ""
password: ""
db: 0
fullPersistence: true
fullPersistence: true

endpointPersistence: false
2 changes: 2 additions & 0 deletions cmd/master_node/config_cluster_raft_1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,5 @@ redis:
password: ""
db: 0
fullPersistence: true

endpointPersistence: false
2 changes: 2 additions & 0 deletions cmd/master_node/config_cluster_raft_2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,5 @@ redis:
password: ""
db: 0
fullPersistence: true

endpointPersistence: false
2 changes: 2 additions & 0 deletions cmd/master_node/config_cluster_raft_3.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,5 @@ redis:
password: ""
db: 0
fullPersistence: true

endpointPersistence: false
2 changes: 2 additions & 0 deletions cmd/master_node/config_raft_1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,5 @@ redis:
password: ""
db: 0
fullPersistence: true

endpointPersistence: false
2 changes: 2 additions & 0 deletions cmd/master_node/config_raft_2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,5 @@ redis:
password: ""
db: 0
fullPersistence: true

endpointPersistence: false
2 changes: 2 additions & 0 deletions cmd/master_node/config_raft_3.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,5 @@ redis:
password: ""
db: 0
fullPersistence: true

endpointPersistence: false
2 changes: 1 addition & 1 deletion internal/control_plane/scaling_loop.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ func (ss *ServiceInfoStorage) doUpscaling(toCreateCount int, loopStarted time.Ti

costPersistStart := time.Now()

if false {
if ss.ControlPlane.Config.EndpointPersistence {
ss.ControlPlane.PersistenceLayer.StoreEndpoint(context.Background(), core.Endpoint{
SandboxID: resp.ID,
URL: fmt.Sprintf("%s:%d", node.GetIP(), resp.PortMappings.HostPort),
Expand Down
1 change: 1 addition & 0 deletions pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ type ControlPlaneConfig struct {
RemoveWorkerNode bool `mapstructure:"removeWorkerNode"`
RemoveDataplane bool `mapstructure:"removeDataplane"`
PrecreateSnapshots bool `mapstructure:"precreateSnapshots"`
EndpointPersistence bool `mapstructure:"endpointPersistence"`
}

type DataPlaneConfig struct {
Expand Down

0 comments on commit 7b18915

Please sign in to comment.