mic

package
v1.8.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: May 5, 2021 License: MIT Imports: 35 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CMConfig added in v1.6.0

type CMConfig struct {
	Namespace string
	Name      string
}

CMConfig - config map for aad-pod-identity

type Client

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

	ImmutableUserMSIsMap map[string]bool

	*LeaderElectionConfig
	Reporter       *metrics.Reporter
	TypeUpgradeCfg *TypeUpgradeConfig
	CMCfg          *CMConfig
	CMClient       typedcorev1.ConfigMapInterface
	// contains filtered or unexported fields
}

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

func NewMICClient

func NewMICClient(cfg *Config) (*Client, error)

NewMICClient returns new mic client

func (*Client) NewLeaderElector

func (c *Client) NewLeaderElector(clientSet *kubernetes.Clientset, recorder record.EventRecorder, leaderElectionConfig *LeaderElectionConfig) (*leaderelection.LeaderElector, 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 starts various go routines to watch for any relevant changes that would trigger a MIC sync.

func (*Client) Sync

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

Sync perform a sync cycle.

func (*Client) UpgradeTypeIfRequired added in v1.6.0

func (c *Client) UpgradeTypeIfRequired() error

UpgradeTypeIfRequired performs type upgrade for all aad-pod-identity CRDs if required.

type ClientInt

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

ClientInt is an abstraction used to perform an MIC sync cycle.

type Config added in v1.6.0

type Config struct {
	CloudCfgPath                        string
	RestConfig                          *rest.Config
	IsNamespaced                        bool
	SyncRetryInterval                   time.Duration
	LeaderElectionCfg                   *LeaderElectionConfig
	EnableScaleFeatures                 bool
	CreateDeleteBatch                   int64
	ImmutableUserMSIsList               []string
	CMcfg                               *CMConfig
	TypeUpgradeCfg                      *TypeUpgradeConfig
	UpdateUserMSICfg                    *UpdateUserMSIConfig
	IdentityAssignmentReconcileInterval time.Duration
}

Config - MIC Config

type LeaderElectionConfig

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

LeaderElectionConfig - used to keep track of leader election config.

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 is an abstraction used to get Kubernetes node info.

type TypeUpgradeConfig added in v1.6.0

type TypeUpgradeConfig struct {
	// Key in the config map which indicates if a type upgrade has been performed.
	TypeUpgradeStatusKey string
	EnableTypeUpgrade    bool
}

TypeUpgradeConfig - configuration aspects of type related changes required for client-go upgrade.

type UpdateUserMSIConfig added in v1.6.1

type UpdateUserMSIConfig struct {
	MaxRetry      int
	RetryInterval time.Duration
}

UpdateUserMSIConfig - parameters for retrying cloudprovider's UpdateUserMSI function

Jump to

Keyboard shortcuts

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