-
Notifications
You must be signed in to change notification settings - Fork 0
/
sync.go
26 lines (20 loc) · 814 Bytes
/
sync.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
package client
import (
"github.com/alehechka/kube-external-sync/client/liveness"
"github.com/alehechka/kube-external-sync/client/replicate/common"
log "github.com/sirupsen/logrus"
)
// SyncExternals syncs Services/Ingress across Namespaces as ExternalName references
func SyncExternals(config *SyncConfig) (err error) {
log.Debugf("Starting with following configuration: %#v", *config)
controller, err := NewController().Initialize(config)
if err != nil {
return err
}
go controller.ServiceReplicator.Run()
go controller.IngressReplicator.Run()
if config.EnableTraefik {
go controller.TraefikIngressRouteReplicator.Run()
}
return liveness.Serve(config.LivenessPort, []common.Replicator{controller.ServiceReplicator, controller.IngressReplicator, controller.TraefikIngressRouteReplicator})
}