mic

package
v1.5.3-rc4 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2019 License: MIT Imports: 28 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	CRDClient       crd.ClientInt
	CloudClient     cloudprovider.ClientInt
	PodClient       pod.ClientInt
	EventRecorder   record.EventRecorder
	EventChannel    chan aadpodid.EventType
	NodeClient      NodeGetter
	IsNamespaced    bool
	SyncLoopStarted bool

	*LeaderElectionConfig
	// contains filtered or unexported fields
}

Client has the required pointers to talk to the api server and interact with the CRD related datastructure.

func NewMICClient

func NewMICClient(cloudconfig string, config *rest.Config, isNamespaced bool, syncRetryInterval time.Duration, leaderElectionConfig *LeaderElectionConfig) (*Client, error)

NewMICClient returnes new mic client

func (*Client) NewLeaderElector

func (c *Client) NewLeaderElector(clientSet *kubernetes.Clientset, recorder record.EventRecorder, leaderElectionConfig *LeaderElectionConfig) (leaderElector *leaderelection.LeaderElector, err error)

NewLeaderElector - does the required leader election initialization

func (*Client) Run

func (c *Client) Run()

Run - Initiates the leader election run call to find if its leader and run it

func (*Client) Start

func (c *Client) Start(exit <-chan struct{})

Start ...

func (*Client) Sync

func (c *Client) Sync(exit <-chan struct{})

Sync ...

type ClientInt

type ClientInt interface {
	Start(exit <-chan struct{})
	Sync(exit <-chan struct{})
}

ClientInt ...

type LeaderElectionConfig

type LeaderElectionConfig struct {
	Namespace string
	Name      string
	Duration  time.Duration
	Instance  string
}

LeaderElectionConfig - used to keep track of leader election config.

type Log

type Log struct {
}

Log - this struct abstracts the logging libraries into single interface.

func (Log) Error added in v1.5.3

func (l Log) Error(err error)

Error - log the messages to be error

func (Log) Errorf

func (l Log) Errorf(format string, args ...interface{})

Errorf - log the messages to be error messages and formatted.

func (Log) Info

func (l Log) Info(msg string)

Info - log the messages to be info

func (Log) Infof added in v1.5.3

func (l Log) Infof(format string, args ...interface{})

Infof - log the messages to be info messages and formatted.

type NodeClient

type NodeClient struct {
	// contains filtered or unexported fields
}

NodeClient handles fetching node details from kubernetes

func (*NodeClient) Get

func (c *NodeClient) Get(name string) (*corev1.Node, error)

Get gets the specified kubernetes node.

Note that this is using a local, eventually consistent cache which may not be up to date with the actual state of the cluster.

func (*NodeClient) Start

func (c *NodeClient) Start(exit <-chan struct{})

Start starts syncing the underlying cache with kubernetes.

The passed in channel should be used to signal that the client should stop syncing. Close this channel when you want syncing to stop.

type NodeGetter

type NodeGetter interface {
	Get(name string) (*corev1.Node, error)
	Start(<-chan struct{})
}

NodeGetter ...

Jump to

Keyboard shortcuts

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