cluster

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2017 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const (
	//user agent for client
	UserAgentName = "Navarkos-Cluster-Controller"
)

Variables

This section is empty.

Functions

func GetClusterPods

func GetClusterPods(client *clientset.Clientset) (allocatablePods int64, capacityPods int64, err error)

GetClusterPods finds the names of all zones and the region in which we have nodes in this cluster.

Types

type ClusterClient

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

ClusterClient holds cluster specific clients

func NewClusterClientSet

func NewClusterClientSet(c *federation_v1beta1.Cluster) (*ClusterClient, error)

NewClusterClientSet initializes ClusterClient based on provided or default values

func (*ClusterClient) GetClusterHealthStatus

func (self *ClusterClient) GetClusterHealthStatus() *federation_v1beta1.ClusterStatus

GetClusterHealthStatus retrieves and return current health state of given cluster

func (*ClusterClient) GetClusterPods

func (self *ClusterClient) GetClusterPods() (allocatablePods int64, capacityPods int64, err error)

GetClusterPods gets the number of pods in a given kubernetes cluster.

func (*ClusterClient) GetClusterZones

func (self *ClusterClient) GetClusterZones() (zones []string, region string, err error)

GetClusterZones gets the kubernetes cluster zones and region by inspecting labels on nodes in the cluster.

type ClusterController

type ClusterController struct {

	//call back to dpmt controller reconcile
	OnClusterChange ReconcileOnClusterChange
	// contains filtered or unexported fields
}

ClusterController provides for management of cluster

func StartClusterController

func StartClusterController(config *restclient.Config, stopChan <-chan struct{}, clusterMonitorPeriod time.Duration) *ClusterController

StartClusterController starts a new cluster controller

func (*ClusterController) GetCluster

func (cc *ClusterController) GetCluster(clusterName string) (*v1beta1.Cluster, error)

GetCluster retrieves the cluster from federation store

func (*ClusterController) GetClusterClient

func (cc *ClusterController) GetClusterClient(cluster *v1beta1.Cluster) (*ClusterClient, error)

GetClusterClient retrieves the client for given cluster based on config

func (*ClusterController) GetClusterDeployment

func (cc *ClusterController) GetClusterDeployment(cluster *v1beta1.Cluster, namespace string, name string) (*extensions.Deployment, error)

GetClusterDeployment looks for specified deployment in given cluster

func (*ClusterController) GetReadyClusters

func (cc *ClusterController) GetReadyClusters() ([]*v1beta1.Cluster, error)

GetReadyClusters returns all clusters for which the sub-informers are run.

func (*ClusterController) GetUnreadyClusters

func (cc *ClusterController) GetUnreadyClusters() ([]*v1beta1.Cluster, error)

GetUnreadyClusters returns all clusters for which the sub-informers are not run.

func (*ClusterController) IsCapacityDataPresent

func (cc *ClusterController) IsCapacityDataPresent(cluster *v1beta1.Cluster) bool

IsCapacityDataPresent retrieves the capacity info from cluster annotations

func (*ClusterController) IsClusterScaling

func (cc *ClusterController) IsClusterScaling(cluster *v1beta1.Cluster) bool

IsClusterScaling confirm scalability based on cluster annotations

func (*ClusterController) IsSynced

func (cc *ClusterController) IsSynced() bool

IsSynced returns if clusterController HasSynced or not

func (*ClusterController) Run

func (cc *ClusterController) Run(stopChan <-chan struct{})

Run begins watching and syncing.

func (*ClusterController) UpdateCluster

func (cc *ClusterController) UpdateCluster(cluster *v1beta1.Cluster) error

UpdateCluster updates the cluster in federation store

func (*ClusterController) UpdateClusterStatus

func (cc *ClusterController) UpdateClusterStatus() error

UpdateClusterStatus checks cluster status and get the metrics from cluster's restapi

type ReconcileOnClusterChange

type ReconcileOnClusterChange func()

ReconcileOnClusterChange defines callback to DeploymentController

Jump to

Keyboard shortcuts

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