Documentation ¶
Index ¶
- func NewK8sClient() scheduler.Scheduler
- func NewWatcher(w watch.Interface) scheduler.Interface
- func PodRequestsAndLimits(pod *v1.Pod) (reqs, limits v1.ResourceList)
- type APIClient
- type Client
- func (c *Client) Close() error
- func (c *Client) GetConfigOperator() scheduler.ConfigOperator
- func (c *Client) GetDaemonSetOperator() scheduler.DaemonSetOperator
- func (c *Client) GetDeploymentOperator() scheduler.DeploymentOperator
- func (c *Client) GetNamespaceOperator() scheduler.NamespaceOperator
- func (c *Client) GetNodeOperator() scheduler.NodeOperator
- func (c *Client) GetPodOperator() scheduler.PodOperator
- func (c *Client) GetRCOperator() scheduler.RCOperator
- func (c *Client) GetReplicaSetOperator() scheduler.ReplicaSetOperator
- func (c *Client) GetSTSOperator() scheduler.STSOperator
- func (c *Client) GetServiceOperator() scheduler.ServiceOperator
- func (c *Client) StartAndGC(config scheduler.Param) error
- type ClientOpts
- type ConfigMapClient
- func (c *ConfigMapClient) Create(ctx context.Context, param *scheduler.Config, options scheduler.Options) error
- func (c *ConfigMapClient) CreateWithYaml(ctx context.Context, param *scheduler.Config, options scheduler.Options) error
- func (c *ConfigMapClient) Delete(ctx context.Context, param *scheduler.Config, options scheduler.Options) error
- func (c *ConfigMapClient) Get(ctx context.Context, namespace string, param *scheduler.Config) (*scheduler.Config, error)
- func (c *ConfigMapClient) List(ctx context.Context, namespace string, options scheduler.Options) ([]*scheduler.Config, error)
- func (c *ConfigMapClient) Update(ctx context.Context, param *scheduler.Config) error
- func (c *ConfigMapClient) Watch(ctx context.Context, param *scheduler.Config, options scheduler.Options) (scheduler.Interface, error)
- type DaemonSetClient
- func (c *DaemonSetClient) Create(ctx context.Context, param *scheduler.DaemonSet, options scheduler.Options) error
- func (c *DaemonSetClient) CreateWithYaml(ctx context.Context, param *scheduler.DaemonSet, options scheduler.Options) error
- func (c *DaemonSetClient) Delete(ctx context.Context, param *scheduler.DaemonSet, options scheduler.Options) error
- func (c *DaemonSetClient) Get(ctx context.Context, namespace string, param *scheduler.DaemonSet) (*scheduler.DaemonSet, error)
- func (c *DaemonSetClient) List(ctx context.Context, namespace string, options scheduler.Options) ([]*scheduler.DaemonSet, error)
- func (c *DaemonSetClient) Update(ctx context.Context, param *scheduler.DaemonSet) error
- func (c *DaemonSetClient) Watch(ctx context.Context, param *scheduler.DaemonSet, options scheduler.Options) (scheduler.Interface, error)
- type DeploymentClient
- func (c *DeploymentClient) Create(ctx context.Context, param *scheduler.Deployment, options scheduler.Options) error
- func (c *DeploymentClient) CreateWithYaml(ctx context.Context, param *scheduler.Deployment, options scheduler.Options) error
- func (c *DeploymentClient) Delete(ctx context.Context, param *scheduler.Deployment, options scheduler.Options) error
- func (c *DeploymentClient) Get(ctx context.Context, namespace string, param *scheduler.Deployment) (*scheduler.Deployment, error)
- func (c *DeploymentClient) List(ctx context.Context, namespace string, options scheduler.Options) ([]*scheduler.Deployment, error)
- func (c *DeploymentClient) Update(ctx context.Context, param *scheduler.Deployment) error
- func (c *DeploymentClient) Watch(ctx context.Context, param *scheduler.Deployment, options scheduler.Options) (scheduler.Interface, error)
- type NameSpaceClient
- func (c *NameSpaceClient) Create(ctx context.Context, param *scheduler.Namespace, options scheduler.Options) error
- func (c *NameSpaceClient) CreateWithYaml(ctx context.Context, param *scheduler.Namespace, options scheduler.Options) error
- func (c *NameSpaceClient) Delete(ctx context.Context, param *scheduler.Namespace, options scheduler.Options) error
- func (c *NameSpaceClient) Get(ctx context.Context, param *scheduler.Namespace) (*scheduler.Namespace, error)
- func (c *NameSpaceClient) List(ctx context.Context, options scheduler.Options) ([]*scheduler.Namespace, error)
- func (c *NameSpaceClient) Update(ctx context.Context, param *scheduler.Namespace) error
- func (c *NameSpaceClient) Watch(ctx context.Context, param *scheduler.Namespace, options scheduler.Options) (scheduler.Interface, error)
- type NodeClient
- func (c *NodeClient) Create(ctx context.Context, param *scheduler.Node, options scheduler.Options) error
- func (c *NodeClient) CreateWithYaml(ctx context.Context, param *scheduler.Node, options scheduler.Options) error
- func (c *NodeClient) Delete(ctx context.Context, param *scheduler.Node, options scheduler.Options) error
- func (c *NodeClient) Describe(ctx context.Context, param *scheduler.Node) (*scheduler.NodeDetail, error)
- func (c *NodeClient) Get(ctx context.Context, param *scheduler.Node) (*scheduler.Node, error)
- func (c *NodeClient) List(ctx context.Context, options scheduler.Options) ([]*scheduler.Node, error)
- func (c *NodeClient) Update(ctx context.Context, param *scheduler.Node) error
- func (c *NodeClient) Watch(ctx context.Context, param *scheduler.Node, options scheduler.Options) (scheduler.Interface, error)
- type PodClient
- func (c *PodClient) Create(ctx context.Context, param *scheduler.Pod, options scheduler.Options) error
- func (c *PodClient) CreateWithYaml(ctx context.Context, param *scheduler.Pod, options scheduler.Options) error
- func (c *PodClient) Delete(ctx context.Context, param *scheduler.Pod, options scheduler.Options) error
- func (c *PodClient) Get(ctx context.Context, namespace string, param *scheduler.Pod) (*scheduler.Pod, error)
- func (c *PodClient) GetEvents(ctx context.Context, param *scheduler.Pod) ([]*scheduler.Event, error)
- func (c *PodClient) GetLogs(ctx context.Context, namespace, name, container string) ([]byte, error)
- func (c *PodClient) List(ctx context.Context, namespace string, options scheduler.Options) ([]*scheduler.Pod, error)
- func (c *PodClient) Update(ctx context.Context, param *scheduler.Pod) error
- func (c *PodClient) Watch(ctx context.Context, param *scheduler.Pod, options scheduler.Options) (scheduler.Interface, error)
- type ReplicaSetClient
- func (c *ReplicaSetClient) Create(ctx context.Context, param *scheduler.ReplicaSet, options scheduler.Options) error
- func (c *ReplicaSetClient) CreateWithYaml(ctx context.Context, param *scheduler.ReplicaSet, options scheduler.Options) error
- func (c *ReplicaSetClient) Delete(ctx context.Context, param *scheduler.ReplicaSet, options scheduler.Options) error
- func (c *ReplicaSetClient) Get(ctx context.Context, namespace string, param *scheduler.ReplicaSet) (*scheduler.ReplicaSet, error)
- func (c *ReplicaSetClient) List(ctx context.Context, namespace string, options scheduler.Options) ([]*scheduler.ReplicaSet, error)
- func (c *ReplicaSetClient) Update(ctx context.Context, param *scheduler.ReplicaSet) error
- func (c *ReplicaSetClient) Watch(ctx context.Context, param *scheduler.ReplicaSet, options scheduler.Options) (scheduler.Interface, error)
- type ReplicationControllerClient
- func (c *ReplicationControllerClient) Create(ctx context.Context, param *scheduler.RC, options scheduler.Options) error
- func (c *ReplicationControllerClient) CreateWithYaml(ctx context.Context, param *scheduler.RC, options scheduler.Options) error
- func (c *ReplicationControllerClient) Delete(ctx context.Context, param *scheduler.RC, options scheduler.Options) error
- func (c *ReplicationControllerClient) Get(ctx context.Context, namespace string, param *scheduler.RC) (*scheduler.RC, error)
- func (c *ReplicationControllerClient) List(ctx context.Context, namespace string, options scheduler.Options) ([]*scheduler.RC, error)
- func (c *ReplicationControllerClient) Update(ctx context.Context, param *scheduler.RC) error
- func (c *ReplicationControllerClient) Watch(ctx context.Context, param *scheduler.RC, options scheduler.Options) (scheduler.Interface, error)
- type ServiceClient
- func (c *ServiceClient) Create(ctx context.Context, param *scheduler.Service, options scheduler.Options) error
- func (c *ServiceClient) CreateWithYaml(ctx context.Context, param *scheduler.Service, options scheduler.Options) error
- func (c *ServiceClient) Delete(ctx context.Context, param *scheduler.Service, options scheduler.Options) error
- func (c *ServiceClient) Get(ctx context.Context, namespace string, param *scheduler.Service) (*scheduler.Service, error)
- func (c *ServiceClient) List(ctx context.Context, namespace string, options scheduler.Options) ([]*scheduler.Service, error)
- func (c *ServiceClient) Update(ctx context.Context, param *scheduler.Service) error
- func (c *ServiceClient) Watch(ctx context.Context, param *scheduler.Service, options scheduler.Options) (scheduler.Interface, error)
- type StatefulSetClient
- func (c *StatefulSetClient) Create(ctx context.Context, param *scheduler.STS, options scheduler.Options) error
- func (c *StatefulSetClient) CreateWithYaml(ctx context.Context, param *scheduler.STS, options scheduler.Options) error
- func (c *StatefulSetClient) Delete(ctx context.Context, param *scheduler.STS, options scheduler.Options) error
- func (c *StatefulSetClient) Get(ctx context.Context, namespace string, param *scheduler.STS) (*scheduler.STS, error)
- func (c *StatefulSetClient) List(ctx context.Context, namespace string, options scheduler.Options) ([]*scheduler.STS, error)
- func (c *StatefulSetClient) Update(ctx context.Context, param *scheduler.STS) error
- func (c *StatefulSetClient) Watch(ctx context.Context, param *scheduler.STS, options scheduler.Options) (scheduler.Interface, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewK8sClient ¶
NewK8sClient - create new scheduler client
func NewWatcher ¶
NewWatcher - create new k8s watcher
func PodRequestsAndLimits ¶
func PodRequestsAndLimits(pod *v1.Pod) (reqs, limits v1.ResourceList)
PodRequestsAndLimits returns a dictionary of all defined resources summed up for all containers of the pod. If pod overhead is non-nil, the pod overhead is added to the total container resource requests and to the total container limits which have a non-zero quantity.
Types ¶
type APIClient ¶
type APIClient struct {
// contains filtered or unexported fields
}
APIClient - api client
type Client ¶
type Client struct { APIClient ConfigMap scheduler.ConfigOperator Namespace scheduler.NamespaceOperator Service scheduler.ServiceOperator Pod scheduler.PodOperator Node scheduler.NodeOperator ReplicationController scheduler.RCOperator StatefulSet scheduler.STSOperator DaemonSet scheduler.DaemonSetOperator Deployment scheduler.DeploymentOperator ReplicaSet scheduler.ReplicaSetOperator // contains filtered or unexported fields }
Client - k8s base client
func (*Client) GetConfigOperator ¶
func (c *Client) GetConfigOperator() scheduler.ConfigOperator
GetConfigOperator - get config Operator
func (*Client) GetDaemonSetOperator ¶
func (c *Client) GetDaemonSetOperator() scheduler.DaemonSetOperator
GetDaemonSetOperator - get DaemonSet Operator
func (*Client) GetDeploymentOperator ¶
func (c *Client) GetDeploymentOperator() scheduler.DeploymentOperator
GetDeploymentOperator - get Deployment Operator
func (*Client) GetNamespaceOperator ¶
func (c *Client) GetNamespaceOperator() scheduler.NamespaceOperator
GetNamespaceOperator - get namespace Operator
func (*Client) GetNodeOperator ¶
func (c *Client) GetNodeOperator() scheduler.NodeOperator
GetNodeOperator - get node Operator
func (*Client) GetPodOperator ¶
func (c *Client) GetPodOperator() scheduler.PodOperator
GetPodOperator - get pod Operator
func (*Client) GetRCOperator ¶
func (c *Client) GetRCOperator() scheduler.RCOperator
GetRCOperator - get rc Operator
func (*Client) GetReplicaSetOperator ¶
func (c *Client) GetReplicaSetOperator() scheduler.ReplicaSetOperator
GetReplicaSetOperator - get ReplicaSet Operator
func (*Client) GetSTSOperator ¶
func (c *Client) GetSTSOperator() scheduler.STSOperator
GetSTSOperator - get sts Operator
func (*Client) GetServiceOperator ¶
func (c *Client) GetServiceOperator() scheduler.ServiceOperator
GetServiceOperator - get service Operator
type ClientOpts ¶
type ClientOpts struct { URL string Insecure bool Username string Password string BearerToken string Data interface{} }
ClientOpts - client options
type ConfigMapClient ¶
type ConfigMapClient struct {
// contains filtered or unexported fields
}
ConfigMapClient - config map client wrap
func (*ConfigMapClient) Create ¶
func (c *ConfigMapClient) Create(ctx context.Context, param *scheduler.Config, options scheduler.Options) error
Create - create new config map
func (*ConfigMapClient) CreateWithYaml ¶
func (c *ConfigMapClient) CreateWithYaml(ctx context.Context, param *scheduler.Config, options scheduler.Options) error
CreateWithYaml - create new config map with yaml
func (*ConfigMapClient) Delete ¶
func (c *ConfigMapClient) Delete(ctx context.Context, param *scheduler.Config, options scheduler.Options) error
Delete - delete config map
func (*ConfigMapClient) Get ¶
func (c *ConfigMapClient) Get(ctx context.Context, namespace string, param *scheduler.Config) (*scheduler.Config, error)
Get - query namespace list
func (*ConfigMapClient) List ¶
func (c *ConfigMapClient) List(ctx context.Context, namespace string, options scheduler.Options) ([]*scheduler.Config, error)
List - query config map list
type DaemonSetClient ¶
type DaemonSetClient struct {
// contains filtered or unexported fields
}
DaemonSetClient ...
func (*DaemonSetClient) Create ¶
func (c *DaemonSetClient) Create(ctx context.Context, param *scheduler.DaemonSet, options scheduler.Options) error
Create - create new DaemonSets
func (*DaemonSetClient) CreateWithYaml ¶
func (c *DaemonSetClient) CreateWithYaml(ctx context.Context, param *scheduler.DaemonSet, options scheduler.Options) error
CreateWithYaml - create new daemonSet map with yalm
func (*DaemonSetClient) Delete ¶
func (c *DaemonSetClient) Delete(ctx context.Context, param *scheduler.DaemonSet, options scheduler.Options) error
Delete - delete DaemonSets map
func (*DaemonSetClient) Get ¶
func (c *DaemonSetClient) Get(ctx context.Context, namespace string, param *scheduler.DaemonSet) (*scheduler.DaemonSet, error)
Get - query DaemonSets info
func (*DaemonSetClient) List ¶
func (c *DaemonSetClient) List(ctx context.Context, namespace string, options scheduler.Options) ([]*scheduler.DaemonSet, error)
List - query DaemonSets list
type DeploymentClient ¶
type DeploymentClient struct {
// contains filtered or unexported fields
}
DeploymentClient ...
func (*DeploymentClient) Create ¶
func (c *DeploymentClient) Create(ctx context.Context, param *scheduler.Deployment, options scheduler.Options) error
Create - create new Deployments
func (*DeploymentClient) CreateWithYaml ¶
func (c *DeploymentClient) CreateWithYaml(ctx context.Context, param *scheduler.Deployment, options scheduler.Options) error
CreateWithYaml - create new Deployments with yaml
func (*DeploymentClient) Delete ¶
func (c *DeploymentClient) Delete(ctx context.Context, param *scheduler.Deployment, options scheduler.Options) error
Delete - delete Deployments map
func (*DeploymentClient) Get ¶
func (c *DeploymentClient) Get(ctx context.Context, namespace string, param *scheduler.Deployment) (*scheduler.Deployment, error)
Get - query Deployments info
func (*DeploymentClient) List ¶
func (c *DeploymentClient) List(ctx context.Context, namespace string, options scheduler.Options) ([]*scheduler.Deployment, error)
List - query Deployments list
func (*DeploymentClient) Update ¶
func (c *DeploymentClient) Update(ctx context.Context, param *scheduler.Deployment) error
Update - update Deployments content
type NameSpaceClient ¶
type NameSpaceClient struct {
// contains filtered or unexported fields
}
NameSpaceClient - namespace operator client
func (*NameSpaceClient) Create ¶
func (c *NameSpaceClient) Create(ctx context.Context, param *scheduler.Namespace, options scheduler.Options) error
Create - create new namespace
func (*NameSpaceClient) CreateWithYaml ¶
func (c *NameSpaceClient) CreateWithYaml(ctx context.Context, param *scheduler.Namespace, options scheduler.Options) error
CreateWithYaml - create new namespace with yaml
func (*NameSpaceClient) Delete ¶
func (c *NameSpaceClient) Delete(ctx context.Context, param *scheduler.Namespace, options scheduler.Options) error
Delete - delete namespace
func (*NameSpaceClient) Get ¶
func (c *NameSpaceClient) Get(ctx context.Context, param *scheduler.Namespace) (*scheduler.Namespace, error)
Get - query namespace list
func (*NameSpaceClient) List ¶
func (c *NameSpaceClient) List(ctx context.Context, options scheduler.Options) ([]*scheduler.Namespace, error)
List - query namespace list
type NodeClient ¶
type NodeClient struct {
// contains filtered or unexported fields
}
NodeClient ...
func (*NodeClient) Create ¶
func (c *NodeClient) Create(ctx context.Context, param *scheduler.Node, options scheduler.Options) error
Create - create new node
func (*NodeClient) CreateWithYaml ¶
func (c *NodeClient) CreateWithYaml(ctx context.Context, param *scheduler.Node, options scheduler.Options) error
CreateWithYaml - create new node with yaml
func (*NodeClient) Delete ¶
func (c *NodeClient) Delete(ctx context.Context, param *scheduler.Node, options scheduler.Options) error
Delete - delete node map
func (*NodeClient) Describe ¶
func (c *NodeClient) Describe(ctx context.Context, param *scheduler.Node) (*scheduler.NodeDetail, error)
Describe - describe node resource info
func (*NodeClient) List ¶
func (c *NodeClient) List(ctx context.Context, options scheduler.Options) ([]*scheduler.Node, error)
List - query node list
type PodClient ¶
type PodClient struct {
// contains filtered or unexported fields
}
PodClient ...
func (*PodClient) Create ¶
func (c *PodClient) Create(ctx context.Context, param *scheduler.Pod, options scheduler.Options) error
Create - create new pod
func (*PodClient) CreateWithYaml ¶
func (c *PodClient) CreateWithYaml(ctx context.Context, param *scheduler.Pod, options scheduler.Options) error
CreateWithYaml - create new pod with yaml
func (*PodClient) Delete ¶
func (c *PodClient) Delete(ctx context.Context, param *scheduler.Pod, options scheduler.Options) error
Delete - delete pod map
func (*PodClient) Get ¶
func (c *PodClient) Get(ctx context.Context, namespace string, param *scheduler.Pod) (*scheduler.Pod, error)
Get - query pod info
func (*PodClient) GetEvents ¶
func (c *PodClient) GetEvents(ctx context.Context, param *scheduler.Pod) ([]*scheduler.Event, error)
GetEvents - query pod event
func (*PodClient) List ¶
func (c *PodClient) List(ctx context.Context, namespace string, options scheduler.Options) ([]*scheduler.Pod, error)
List - query pod list
type ReplicaSetClient ¶
type ReplicaSetClient struct {
// contains filtered or unexported fields
}
ReplicaSetClient ...
func (*ReplicaSetClient) Create ¶
func (c *ReplicaSetClient) Create(ctx context.Context, param *scheduler.ReplicaSet, options scheduler.Options) error
Create - create new ReplicaSets
func (*ReplicaSetClient) CreateWithYaml ¶
func (c *ReplicaSetClient) CreateWithYaml(ctx context.Context, param *scheduler.ReplicaSet, options scheduler.Options) error
CreateWithYaml - create new ReplicaSet with yaml
func (*ReplicaSetClient) Delete ¶
func (c *ReplicaSetClient) Delete(ctx context.Context, param *scheduler.ReplicaSet, options scheduler.Options) error
Delete - delete ReplicaSets map
func (*ReplicaSetClient) Get ¶
func (c *ReplicaSetClient) Get(ctx context.Context, namespace string, param *scheduler.ReplicaSet) (*scheduler.ReplicaSet, error)
Get - query ReplicaSets info
func (*ReplicaSetClient) List ¶
func (c *ReplicaSetClient) List(ctx context.Context, namespace string, options scheduler.Options) ([]*scheduler.ReplicaSet, error)
List - query ReplicaSets list
func (*ReplicaSetClient) Update ¶
func (c *ReplicaSetClient) Update(ctx context.Context, param *scheduler.ReplicaSet) error
Update - update ReplicaSets content
type ReplicationControllerClient ¶
type ReplicationControllerClient struct {
// contains filtered or unexported fields
}
ReplicationControllerClient replication controller client
func (*ReplicationControllerClient) Create ¶
func (c *ReplicationControllerClient) Create(ctx context.Context, param *scheduler.RC, options scheduler.Options) error
Create - create new ReplicationControllers
func (*ReplicationControllerClient) CreateWithYaml ¶
func (c *ReplicationControllerClient) CreateWithYaml(ctx context.Context, param *scheduler.RC, options scheduler.Options) error
CreateWithYaml - create new ReplicationControllers with yaml
func (*ReplicationControllerClient) Delete ¶
func (c *ReplicationControllerClient) Delete(ctx context.Context, param *scheduler.RC, options scheduler.Options) error
Delete - delete ReplicationControllers map
func (*ReplicationControllerClient) Get ¶
func (c *ReplicationControllerClient) Get(ctx context.Context, namespace string, param *scheduler.RC) (*scheduler.RC, error)
Get - query ReplicationControllers info
func (*ReplicationControllerClient) List ¶
func (c *ReplicationControllerClient) List(ctx context.Context, namespace string, options scheduler.Options) ([]*scheduler.RC, error)
List - query ReplicationControllers list
type ServiceClient ¶
type ServiceClient struct {
// contains filtered or unexported fields
}
ServiceClient ...
func (*ServiceClient) Create ¶
func (c *ServiceClient) Create(ctx context.Context, param *scheduler.Service, options scheduler.Options) error
Create - create new service map
func (*ServiceClient) CreateWithYaml ¶
func (c *ServiceClient) CreateWithYaml(ctx context.Context, param *scheduler.Service, options scheduler.Options) error
CreateWithYaml - create new service with yaml
func (*ServiceClient) Delete ¶
func (c *ServiceClient) Delete(ctx context.Context, param *scheduler.Service, options scheduler.Options) error
Delete - delete service map
func (*ServiceClient) Get ¶
func (c *ServiceClient) Get(ctx context.Context, namespace string, param *scheduler.Service) (*scheduler.Service, error)
Get - query service list
func (*ServiceClient) List ¶
func (c *ServiceClient) List(ctx context.Context, namespace string, options scheduler.Options) ([]*scheduler.Service, error)
List - query service map list
type StatefulSetClient ¶
type StatefulSetClient struct {
// contains filtered or unexported fields
}
StatefulSetClient ...
func (*StatefulSetClient) Create ¶
func (c *StatefulSetClient) Create(ctx context.Context, param *scheduler.STS, options scheduler.Options) error
Create - create new StatefulSets
func (*StatefulSetClient) CreateWithYaml ¶
func (c *StatefulSetClient) CreateWithYaml(ctx context.Context, param *scheduler.STS, options scheduler.Options) error
CreateWithYaml - create new StatefulSet with yaml
func (*StatefulSetClient) Delete ¶
func (c *StatefulSetClient) Delete(ctx context.Context, param *scheduler.STS, options scheduler.Options) error
Delete - delete StatefulSets map
func (*StatefulSetClient) Get ¶
func (c *StatefulSetClient) Get(ctx context.Context, namespace string, param *scheduler.STS) (*scheduler.STS, error)
Get - query StatefulSets info
func (*StatefulSetClient) List ¶
func (c *StatefulSetClient) List(ctx context.Context, namespace string, options scheduler.Options) ([]*scheduler.STS, error)
List - query StatefulSets list