func (sm *Manager) startARP() error {
	var cpCluster *cluster.Cluster
	var ns string
	var err error
	ctx, cancel := context.WithCancel(context.Background())
	defer cancel()
	ctxDNS, cancelDNS := context.WithCancel(context.Background())
	defer cancelDNS()
	go func() {
		<-sm.signalChan
		log.Info("Received termination, signaling shutdown")
		if sm.config.EnableControlPane {
			cpCluster.Stop()
		}
		cancel()
	}()
	if sm.config.EnableControlPane {
		cpCluster, err = cluster.InitCluster(sm.config, false)
		if err != nil {
			return err
		}
		if cpCluster.Network.IsDDNS() {
			if err := cpCluster.StartDDNS(ctxDNS); err != nil {
				log.Error(err)
			}
		}
		if cpCluster.Network.IsDNS() {
			log.Infof("starting the DNS updater for the address %s", cpCluster.Network.DNSName())
			ipUpdater := vip.NewIPUpdater(cpCluster.Network)
			ipUpdater.Run(ctxDNS)
		}
		clusterManager := &cluster.Manager{
			KubernetesClient: sm.clientSet,
			SignalChan:       sm.signalChan,
		}
		go func() {
			err := cpCluster.StartLeaderCluster(sm.config, clusterManager, nil)
			if err != nil {
				log.Errorf("Control Pane Error [%v]", err)
				sm.signalChan <- syscall.SIGINT
			}
		}()
		if !sm.config.EnableServices {
			<-sm.signalChan
			log.Infof("Shutting down Kube-Vip")
			return nil
		}
		ns = sm.config.Namespace
	} else {
		ns, err = returnNameSpace()
		if err != nil {
			return err
		}
	}
	id, err := os.Hostname()
	if err != nil {
		return err
	}
	upnpEnabled, _ := strconv.ParseBool(os.Getenv("enableUPNP"))
	if upnpEnabled {
		sm.upnp = new(upnp.Upnp)
		err := sm.upnp.ExternalIPAddr()
		if err != nil {
			log.Errorf("Error Enabling UPNP %s", err.Error())
			sm.upnp = nil
		} else {
			log.Infof("Successfully enabled UPNP, Gateway address [%s]", sm.upnp.GatewayOutsideIP)
		}
	}
	log.Infof("Beginning cluster membership, namespace [%s], lock name [%s], id [%s]", ns, plunderLock, id)
	lock := &resourcelock.LeaseLock{
		LeaseMeta: metav1.ObjectMeta{
			Name:      plunderLock,
			Namespace: ns,
		},
		Client: sm.clientSet.CoordinationV1(),
		LockConfig: resourcelock.ResourceLockConfig{
			Identity: id,
		},
	}
	leaderelection.RunOrDie(ctx, leaderelection.LeaderElectionConfig{
		Lock: lock,
		ReleaseOnCancel: true,
		LeaseDuration:   10 * time.Second,
		RenewDeadline:   5 * time.Second,
		RetryPeriod:     1 * time.Second,
		Callbacks: leaderelection.LeaderCallbacks{
			OnStartedLeading: func(ctx context.Context) {
				err = sm.servicesWatcher(ctx)
				if err != nil {
					log.Error(err)
				}
			},
			OnStoppedLeading: func() {
				log.Infof("leader lost: %s", id)
				for x := range sm.serviceInstances {
					sm.serviceInstances[x].cluster.Stop()
				}
				log.Fatal("lost leadership, restarting kube-vip")
			},
			OnNewLeader: func(identity string) {
				if identity == id {
					return
				}
				log.Infof("new leader elected: %s", identity)
			},
		},
	})
	return nil
}
Start will begin the Manager, which will start services and watch the configmap
package manager
import (
	"context"
	"os"
	"strconv"
	"syscall"
	"time"
	"github.com/kamhlos/upnp"
	"github.com/kube-vip/kube-vip/pkg/cluster"
	"github.com/kube-vip/kube-vip/pkg/vip"
	log "github.com/sirupsen/logrus"
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
	"k8s.io/client-go/tools/leaderelection"
	"k8s.io/client-go/tools/leaderelection/resourcelock"
)