task

package
v1.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 5, 2023 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TODO

func TODO() error

Types

type ProcessLeaseFunc

type ProcessLeaseFunc func(*coordinationv1.Lease) error

ProcessLeaseFunc processes the given lease in-place

type Service

type Service struct {
	NodeReportSubject string
	AgentID           string
	IPDetect          string
	NodeIPDetect      string
	Region            string
	AgentSubject      string
	RegisterNode      bool

	// nodeStatusUpdateFrequency specifies how often kubelet computes node status. If node lease
	// feature is not enabled, it is also the frequency that kubelet posts node status to master.
	// In that case, be cautious when changing the constant, it must work with nodeMonitorGracePeriod
	// in nodecontroller. There are several constraints:
	// 1. nodeMonitorGracePeriod must be N times more than nodeStatusUpdateFrequency, where
	//    N means number of retries allowed for kubelet to post node status. It is pointless
	//    to make nodeMonitorGracePeriod be less than nodeStatusUpdateFrequency, since there
	//    will only be fresh values from Kubelet at an interval of nodeStatusUpdateFrequency.
	//    The constant must be less than podEvictionTimeout.
	// 2. nodeStatusUpdateFrequency needs to be large enough for kubelet to generate node
	//    status. Kubelet may fail to update node status reliably if the value is too small,
	//    as it takes time to gather all necessary node information.
	NodeStatusUpdateFrequency time.Duration
	// contains filtered or unexported fields
}

func NewService

func NewService(agentID, region, ipDetectMethod, nodeIPDetectMethod string, registerNode bool, natOpts *natsio.NatsOptions, opts ...ServiceOption) *Service

func (*Service) Close

func (s *Service) Close()

func (*Service) PrepareRun

func (s *Service) PrepareRun(stopCh <-chan struct{}) error

func (*Service) Run

func (s *Service) Run(stopCh <-chan struct{}) error

type ServiceOption

type ServiceOption func(*Service)

func WithBackupStore

func WithBackupStore(backupStore bs.BackupStore) ServiceOption

func WithLeaseDurationSeconds

func WithLeaseDurationSeconds(seconds int32) ServiceOption

func WithNodeStatusUpdateFrequency

func WithNodeStatusUpdateFrequency(frequency time.Duration) ServiceOption

func WithRepoMirror

func WithRepoMirror(mirror string) ServiceOption

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL