coordinator

package
v5.0.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2019 License: Apache-2.0 Imports: 44 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// NodeCloudStatusBootstrapping is not used for upgrade and is listed here for reference
	NodeCloudStatusBootstrapping = "BOOTSTRAPPING"
	// NodeCloudStatusRunning should be posted when a node upgrade completes
	NodeCloudStatusRunning = "RUNNING"
)
View Source
const (
	// DockerConfigStringFormat is used for Docker tokens, using endpoint, and auth token as password
	DockerConfigStringFormat = `{"%s":{"username":"_json_key","password":"%s","email":"none"}}`
	// DockerJSONStringFormat is used for JSON tokens, endpoint is used under auths,
	// while auth is the token generated
	DockerJSONStringFormat = `{"auths":{"%s":{"auth":"%s","email":"none"}}}`
)

Variables

This section is empty.

Functions

func Initialize

func Initialize()

Initialize creates the informer factories, controller, and synchronizer.

func PostNodeCloudStatusMessage

func PostNodeCloudStatusMessage(nodeID string, status *NodeCloudStatusMessage) error

PostNodeCloudStatusMessage posts the node cloud status to cloud. Note that this status is not (currently) intended to be strictly identical to the actual node status in the ClusterUpgrade CRD and is only used for essentially a boolean "is running or not" check on cloud side.

func PostNodeCloudStatusMessageWithRetry

func PostNodeCloudStatusMessageWithRetry(nodeID string, status *NodeCloudStatusMessage, numRetries int) error

PostNodeCloudStatusMessageWithRetry posts the node cloud status, retrying up to numRetries times. TODO consider using a library such as `pester` to handle actual HTTP retries here and elsewhere

func RequestTerminate

func RequestTerminate()

RequestTerminate requests to stop syncing, clean up, and terminate

func Run

func Run()

Run kicks off the informer factories, controller, and synchronizer.

Types

type CloudSynchronizer

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

CloudSynchronizer synchronizes Containership Cloud resources into our Kubernetes CRDs.

func NewCloudSynchronizer

func NewCloudSynchronizer(csInformerFactory csinformers.SharedInformerFactory, cerebralInformerFactory cerebralinformers.SharedInformerFactory) *CloudSynchronizer

NewCloudSynchronizer constructs a new CloudSynchronizer.

func (*CloudSynchronizer) RequestTerminate

func (s *CloudSynchronizer) RequestTerminate()

RequestTerminate requests that all Containership resources be deleted from the cluster. It kicks off a goroutine to marks resources for deletion and returns without blocking.

func (*CloudSynchronizer) Run

func (s *CloudSynchronizer) Run()

Run kicks off cloud sync routines.

type ContainershipController

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

ContainershipController is the controller implementation for the containership setup

func NewContainershipController

func NewContainershipController(kubeclientset kubernetes.Interface, kubeInformerFactory kubeinformers.SharedInformerFactory) *ContainershipController

NewContainershipController returns a new containership controller

func (*ContainershipController) Run

func (c *ContainershipController) Run(numWorkers int, stopCh chan struct{})

Run will set up the event handlers for types we are interested in, as well as syncing informer caches and starting workers. It will block until stopCh is closed, at which point it will shutdown the workqueue and wait for workers to finish processing their current work items.

type NodeCloudStatus

type NodeCloudStatus struct {
	// Type is the status type
	Type string `json:"type"`
	// Percent is the progress percentage within this Type
	Percent string `json:"percent"`
}

NodeCloudStatus is a node status that Cloud uses

type NodeCloudStatusMessage

type NodeCloudStatusMessage struct {
	Status NodeCloudStatus `json:"status"`
}

NodeCloudStatusMessage is the message posted to Cloud to update a node status

type PluginController

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

PluginController is the controller implementation for the containership setup

func NewPluginController

func NewPluginController(kubeclientset kubernetes.Interface, clientset csclientset.Interface, csInformerFactory csinformers.SharedInformerFactory) *PluginController

NewPluginController returns a new containership controller

func (*PluginController) Run

func (c *PluginController) Run(numWorkers int, stopCh chan struct{})

Run will set up the event handlers for types we are interested in, as well as syncing informer caches and starting workers. It will block until stopCh is closed, at which point it will shutdown the workqueue and wait for workers to finish processing their current work items.

type RegistryController

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

RegistryController is the controller implementation for Registry resources

func NewRegistryController

func NewRegistryController(kubeclientset kubernetes.Interface, clientset csclientset.Interface, kubeInformerFactory kubeinformers.SharedInformerFactory, csInformerFactory csinformers.SharedInformerFactory) *RegistryController

NewRegistryController returns a new coordinator controller which watches namespace, service accounts, secrets and registries. It's job is to ensure each namespace has a secret for each registry, as well as ensuring that the containership SA in each namespace contains each secret as an image pull secret

func (*RegistryController) Run

func (c *RegistryController) Run(numWorkers int, stopCh chan struct{})

Run will set up the event handlers for types we are interested in, as well as syncing informer caches and starting workers. It will block until stopCh is closed, at which point it will shutdown the workqueue and wait for workers to finish processing their current work items.

type UpgradeController

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

UpgradeController is the controller implementation for the containership upgrading clusters to a users desired kubernetes version

func NewUpgradeController

func NewUpgradeController(kubeclientset kubernetes.Interface, clientset csclientset.Interface, kubeInformerFactory kubeinformers.SharedInformerFactory, csInformerFactory csinformers.SharedInformerFactory) *UpgradeController

NewUpgradeController returns a new upgrade controller

func (*UpgradeController) Run

func (uc *UpgradeController) Run(numWorkers int, stopCh chan struct{})

Run will set up the event handlers for types we are interested in, as well as syncing informer caches and starting workers. It will block until stopCh is closed, at which point it will shutdown the workqueue and wait for workers to finish processing their current work items.

Jump to

Keyboard shortcuts

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