Exemple #1
0
// NewMinionServer creates the MinionServer struct with default values to be used by hyperkube
func NewMinionServer() *MinionServer {
	s := &MinionServer{
		KubeletExecutorServer: exservice.NewKubeletExecutorServer(),
		privateMountNS:        false, // disabled until Docker supports customization of the parent mount namespace
		done:                  make(chan struct{}),
		exit:                  make(chan error),

		logMaxSize:      config.DefaultLogMaxSize(),
		logMaxBackups:   config.DefaultLogMaxBackups,
		logMaxAgeInDays: config.DefaultLogMaxAgeInDays,

		runProxy: true,
	}

	// cache this for later use
	binary, err := osext.Executable()
	if err != nil {
		log.Fatalf("failed to determine currently running executable: %v", err)
	}
	s.kmBinary = binary

	return s
}
Exemple #2
0
// NewSchedulerServer creates a new SchedulerServer with default parameters
func NewSchedulerServer() *SchedulerServer {
	s := SchedulerServer{
		Port:            ports.SchedulerPort,
		Address:         util.IP(net.ParseIP("127.0.0.1")),
		FailoverTimeout: time.Duration((1 << 62) - 1).Seconds(),

		RunProxy:               true,
		ExecutorSuicideTimeout: execcfg.DefaultSuicideTimeout,
		ExecutorCgroupPrefix:   execcfg.DefaultCgroupPrefix,

		MinionLogMaxSize:      minioncfg.DefaultLogMaxSize(),
		MinionLogMaxBackups:   minioncfg.DefaultLogMaxBackups,
		MinionLogMaxAgeInDays: minioncfg.DefaultLogMaxAgeInDays,

		MesosAuthProvider:    sasl.ProviderName,
		MesosMaster:          defaultMesosMaster,
		MesosUser:            defaultMesosUser,
		ReconcileInterval:    defaultReconcileInterval,
		ReconcileCooldown:    defaultReconcileCooldown,
		Checkpoint:           true,
		FrameworkName:        defaultFrameworkName,
		HA:                   false,
		mux:                  http.NewServeMux(),
		KubeletCadvisorPort:  4194, // copied from github.com/GoogleCloudPlatform/kubernetes/blob/release-0.14/cmd/kubelet/app/server.go
		KubeletSyncFrequency: 10 * time.Second,
	}
	// cache this for later use. also useful in case the original binary gets deleted, e.g.
	// during upgrades, development deployments, etc.
	if filename, err := osext.Executable(); err != nil {
		log.Fatalf("failed to determine path to currently running executable: %v", err)
	} else {
		s.executable = filename
		s.KMPath = filename
	}

	return &s
}