Documentation ¶
Index ¶
Constants ¶
View Source
const ( // DefaultPulsarNamespace is the default pulsar namespace in the cluster DefaultPulsarNamespace = "pulsar" // ZookeeperSts is zookeeper sts name ZookeeperSts = "zookeeper" // BookkeeperSts is bookkeeper sts name BookkeeperSts = "bookkeeper" // BrokerDeployment is the broker deployment name BrokerDeployment = "broker" // BrokerSts is the broker deployment name BrokerSts = "brokersts" // ProxyDeployment is the proxy deployment name ProxyDeployment = "proxy" // FunctionWorkerDeployment is the function worker deployment name FunctionWorkerDeployment = "functionWorker" )
Variables ¶
This section is empty.
Functions ¶
func ClusterStatusCodeString ¶
func ClusterStatusCodeString(status ClusterStatusCode) string
ClusterStatusCodeString is the cluster status code in Kubernetes
func GetObjectMetaData ¶
func GetObjectMetaData(obj interface{}) meta_v1.ObjectMeta
GetObjectMetaData returns metadata of a given k8s object
Types ¶
type Client ¶
type Client struct { Clientset *kubernetes.Clientset Metrics *metrics.Clientset ClusterName string DefaultNamespace string Status ClusterStatusCode Zookeeper StatefulSet Bookkeeper StatefulSet BrokerSts StatefulSet Broker Deployment Proxy Deployment FunctionWorker StatefulSet }
Client is the k8s client object
func GetK8sClient ¶
GetK8sClient gets k8s clientset
func (*Client) EvalHealth ¶
func (c *Client) EvalHealth() (string, ClusterStatus)
EvalHealth evaluate the health of cluster status
func (*Client) GetNodeResource ¶
func (c *Client) GetNodeResource()
GetNodeResource gets the node total available memory
func (*Client) UpdateReplicas ¶
UpdateReplicas updates the replicas for deployments and sts
func (*Client) WatchPodResource ¶
WatchPodResource watches pod's resource
type ClusterStatus ¶
type ClusterStatus struct { ZookeeperOfflineInstances int BookkeeperOfflineInstances int BrokerOfflineInstances int BrokerStsOfflineInstances int ProxyOfflineInstances int Status ClusterStatusCode }
ClusterStatus is the health status of the cluster and its components
type ClusterStatusCode ¶
type ClusterStatusCode int
ClusterStatusCode is the high level health of cluster status
const ( // TotalDown is the initial status TotalDown ClusterStatusCode = iota // OK is the healthy status OK // PartialReady is some parts of system are ok PartialReady )
type Deployment ¶
Deployment is the k8s deployment
type StatefulSet ¶
StatefulSet is the k8s sts
Click to show internal directories.
Click to hide internal directories.