func initialConfiguration() (manager.Manager, error) {
	if err := initializingLeaderAndAnalytics(); err != nil {
		return nil, err
	}
	cfg, namespace, err := initializeMetricsService()
	if err != nil {
		return nil, err
	}
	mgr, err := registerComponents(cfg, namespace)
	if err != nil {
		return nil, err
	}
	return mgr, nil
}
initializing the configuration of chaos-operator
package main
import (
	"context"
	"flag"
	"fmt"
	"os"
	"runtime"
	"strings"
	"github.com/operator-framework/operator-sdk/pkg/k8sutil"
	"github.com/operator-framework/operator-sdk/pkg/leader"
	"github.com/operator-framework/operator-sdk/pkg/log/zap"
	"github.com/operator-framework/operator-sdk/pkg/metrics"
	sdkVersion "github.com/operator-framework/operator-sdk/version"
	"github.com/spf13/pflag"
	v1 "k8s.io/api/core/v1"
	"k8s.io/apimachinery/pkg/util/intstr"
	_ "k8s.io/client-go/plugin/pkg/client/auth"
	"k8s.io/client-go/rest"
	"sigs.k8s.io/controller-runtime/pkg/client/config"
	"sigs.k8s.io/controller-runtime/pkg/manager"
	logf "sigs.k8s.io/controller-runtime/pkg/runtime/log"
	"sigs.k8s.io/controller-runtime/pkg/runtime/signals"
	"github.com/litmuschaos/chaos-operator/pkg/analytics"
	"github.com/litmuschaos/chaos-operator/pkg/apis"
	"github.com/litmuschaos/chaos-operator/pkg/controller"
)
var (
	metricsHost       = "0.0.0.0"
	metricsPort int32 = 8383
	log               = logf.Log.WithName("cmd")
)
func main() {
	initializingLogConfiguration()
	printVersion()
	mgr, err := initialConfiguration()
	if err != nil {
		log.Error(err, "")
		os.Exit(1)
	}
	log.Info("Starting the Chaos-Operator...")
	if err := mgr.Start(signals.SetupSignalHandler()); err != nil {
		log.Error(err, "Chaos-Operator exited non-zero")
		os.Exit(1)
	}
}
func initializingLogConfiguration() {
	pflag.CommandLine.AddFlagSet(zap.FlagSet())
	pflag.CommandLine.AddGoFlagSet(flag.CommandLine)
	pflag.Parse()
	logf.SetLogger(zap.Logger())
}
func printVersion() {
	log.Info(fmt.Sprintf("Go Version: %s", runtime.Version()))
	log.Info(fmt.Sprintf("Go OS/Arch: %s/%s", runtime.GOOS, runtime.GOARCH))
	log.Info(fmt.Sprintf("Version of operator-sdk: %v", sdkVersion.Version))
}