types

package
v4.5.2003+incompatible Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AlamedaApplicationSpec

type AlamedaApplicationSpec struct {
	ScalingTool string
}

type AlamedaControllerSpec

type AlamedaControllerSpec struct {
	AlamedaScaler   *metadata.ObjectMeta
	ScalingTool     string
	Policy          string
	EnableExecution bool
}

func NewAlamedaControllerSpec

func NewAlamedaControllerSpec(entity *clusterstatus.ControllerEntity) *AlamedaControllerSpec

type AlamedaNodeSpec

type AlamedaNodeSpec struct {
	Provider            *Provider
	MachinesetName      string
	MachinesetNamespace string
	RoleMaster          bool
	RoleWorker          bool
	RoleInfra           bool
}

func NewAlamedaNodeSpec

func NewAlamedaNodeSpec(entity *clusterstatus.NodeEntity) *AlamedaNodeSpec

type AlamedaPodSpec

type AlamedaPodSpec struct {
	AlamedaScaler          *metadata.ObjectMeta
	Policy                 string
	UsedRecommendationId   string
	ScalingTool            string
	AlamedaScalerResources *ResourceRequirements
}

func NewAlamedaPodSpec

func NewAlamedaPodSpec(entity *clusterstatus.PodEntity) *AlamedaPodSpec

type Application

type Application struct {
	ObjectMeta             *metadata.ObjectMeta
	AlamedaApplicationSpec *AlamedaApplicationSpec
	Controllers            []*Controller
}

func NewApplication

func NewApplication(entity *clusterstatus.ApplicationEntity) *Application

func (*Application) BuildEntity

func (p *Application) BuildEntity() *clusterstatus.ApplicationEntity

type ApplicationDAO

type ApplicationDAO interface {
	CreateApplications([]*Application) error
	ListApplications(*ListApplicationsRequest) ([]*Application, error)
	DeleteApplications(*DeleteApplicationsRequest) error
}

type ApplicationObjectMeta

type ApplicationObjectMeta struct {
	ObjectMeta  *metadata.ObjectMeta
	ScalingTool string
}

func NewApplicationObjectMeta

func NewApplicationObjectMeta(objectMeta *metadata.ObjectMeta, scalingTool string) *ApplicationObjectMeta

type Capacity

type Capacity struct {
	CpuCores                 int64
	MemoryBytes              int64
	NetworkMegabitsPerSecond int64
}

func NewCapacity

func NewCapacity(entity *clusterstatus.NodeEntity) *Capacity

type Cluster

type Cluster struct {
	ObjectMeta *metadata.ObjectMeta
	Value      string
}

func NewCluster

func NewCluster(entity *clusterstatus.ClusterEntity) *Cluster

func (*Cluster) BuildEntity

func (p *Cluster) BuildEntity() *clusterstatus.ClusterEntity

type ClusterDAO

type ClusterDAO interface {
	CreateClusters([]*Cluster) error
	ListClusters(*ListClustersRequest) ([]*Cluster, error)
	DeleteClusters(*DeleteClustersRequest) error
}

type Container

type Container struct {
	Name                     string
	PodName                  string
	Namespace                string
	NodeName                 string
	ClusterName              string
	Uid                      string
	TopControllerName        string
	TopControllerKind        string
	AlamedaScalerName        string
	AlamedaScalerScalingTool string
	Resources                *ResourceRequirements
	Status                   *ContainerStatus
}

func NewContainer

func NewContainer() *Container

func (*Container) BuildEntity

func (p *Container) BuildEntity() *clusterstatus.ContainerEntity

func (*Container) Initialize

func (p *Container) Initialize(entity *clusterstatus.ContainerEntity)

type ContainerObjectMeta

type ContainerObjectMeta struct {
	Name                     string
	PodName                  string
	Namespace                string
	NodeName                 string
	ClusterName              string
	TopControllerName        string
	TopControllerKind        string
	AlamedaScalerName        string
	AlamedaScalerScalingTool string
}

type ContainerState

type ContainerState struct {
	Waiting    *ContainerStateWaiting
	Running    *ContainerStateRunning
	Terminated *ContainerStateTerminated
}

type ContainerStateRunning

type ContainerStateRunning struct {
	StartedAt *timestamp.Timestamp
}

type ContainerStateTerminated

type ContainerStateTerminated struct {
	ExitCode   int32
	Reason     string
	Message    string
	StartedAt  *timestamp.Timestamp
	FinishedAt *timestamp.Timestamp
}

type ContainerStateWaiting

type ContainerStateWaiting struct {
	Reason  string
	Message string
}

type ContainerStatus

type ContainerStatus struct {
	State                *ContainerState
	LastTerminationState *ContainerState
	RestartCount         int32
}

type Controller

type Controller struct {
	ObjectMeta            *metadata.ObjectMeta
	Kind                  string
	Replicas              int32
	SpecReplicas          int32
	AlamedaControllerSpec *AlamedaControllerSpec
}

func NewController

func NewController(entity *clusterstatus.ControllerEntity) *Controller

func (*Controller) BuildEntity

func (p *Controller) BuildEntity() *clusterstatus.ControllerEntity

type ControllerDAO

type ControllerDAO interface {
	CreateControllers([]*Controller) error
	ListControllers(*ListControllersRequest) ([]*Controller, error)
	DeleteControllers(*DeleteControllersRequest) error
}

type ControllerObjectMeta

type ControllerObjectMeta struct {
	ObjectMeta    *metadata.ObjectMeta
	AlamedaScaler *metadata.ObjectMeta
	Kind          string // Valid values: DEPLOYMENT, DEPLOYMENTCONFIG, STATEFULSET
	ScalingTool   string // Valid values: NONE, VPA, HPA
}

func NewControllerObjectMeta

func NewControllerObjectMeta(objectMeta, alamedaScaler *metadata.ObjectMeta, kind, scalingTool string) *ControllerObjectMeta

type DeleteApplicationsRequest

type DeleteApplicationsRequest struct {
	ApplicationObjectMeta []*ApplicationObjectMeta
}

func NewDeleteApplicationsRequest

func NewDeleteApplicationsRequest() *DeleteApplicationsRequest

type DeleteClustersRequest

type DeleteClustersRequest struct {
	ObjectMeta []*metadata.ObjectMeta
}

func NewDeleteClustersRequest

func NewDeleteClustersRequest() *DeleteClustersRequest

type DeleteContainersRequest

type DeleteContainersRequest struct {
	ContainerObjectMeta []*ContainerObjectMeta
}

func NewDeleteContainersRequest

func NewDeleteContainersRequest() DeleteContainersRequest

type DeleteControllersRequest

type DeleteControllersRequest struct {
	ControllerObjectMeta []*ControllerObjectMeta
}

func NewDeleteControllersRequest

func NewDeleteControllersRequest() *DeleteControllersRequest

type DeleteNamespacesRequest

type DeleteNamespacesRequest struct {
	ObjectMeta []*metadata.ObjectMeta
}

func NewDeleteNamespacesRequest

func NewDeleteNamespacesRequest() *DeleteNamespacesRequest

type DeleteNodesRequest

type DeleteNodesRequest struct {
	ObjectMeta []*metadata.ObjectMeta
}

func NewDeleteNodesRequest

func NewDeleteNodesRequest() *DeleteNodesRequest

type DeletePodsRequest

type DeletePodsRequest struct {
	PodObjectMeta []*PodObjectMeta
}

func NewDeletePodsRequest

func NewDeletePodsRequest() *DeletePodsRequest

type ListApplicationsRequest

type ListApplicationsRequest struct {
	common.QueryCondition
	ApplicationObjectMeta []*ApplicationObjectMeta
}

func NewListApplicationsRequest

func NewListApplicationsRequest() *ListApplicationsRequest

type ListClustersRequest

type ListClustersRequest struct {
	common.QueryCondition
	ObjectMeta []*metadata.ObjectMeta
}

func NewListClustersRequest

func NewListClustersRequest() *ListClustersRequest

type ListContainersRequest

type ListContainersRequest struct {
	common.QueryCondition
	ContainerObjectMeta []*ContainerObjectMeta
}

func NewListContainersRequest

func NewListContainersRequest() ListContainersRequest

type ListControllersRequest

type ListControllersRequest struct {
	common.QueryCondition
	ControllerObjectMeta []*ControllerObjectMeta
}

func NewListControllersRequest

func NewListControllersRequest() *ListControllersRequest

type ListNamespacesRequest

type ListNamespacesRequest struct {
	common.QueryCondition
	ObjectMeta []*metadata.ObjectMeta
}

func NewListNamespacesRequest

func NewListNamespacesRequest() *ListNamespacesRequest

type ListNodesRequest

type ListNodesRequest struct {
	common.QueryCondition
	ObjectMeta []*metadata.ObjectMeta
}

func NewListNodesRequest

func NewListNodesRequest() *ListNodesRequest

type ListPodsRequest

type ListPodsRequest struct {
	common.QueryCondition
	ObjectMeta  []*metadata.ObjectMeta
	Kind        string // Valid values: DEPLOYMENT, DEPLOYMENTCONFIG, STATEFULSET, ALAMEDASCALER
	ScalingTool string // Valid values: NONE, VPA, HPA
}

func NewListPodsRequest

func NewListPodsRequest() *ListPodsRequest

type Namespace

type Namespace struct {
	ObjectMeta *metadata.ObjectMeta
	Value      string
}

func NewNamespace

func NewNamespace(entity *clusterstatus.NamespaceEntity) *Namespace

func (*Namespace) BuildEntity

func (p *Namespace) BuildEntity() *clusterstatus.NamespaceEntity

type NamespaceDAO

type NamespaceDAO interface {
	CreateNamespaces([]*Namespace) error
	ListNamespaces(*ListNamespacesRequest) ([]*Namespace, error)
	DeleteNamespaces(*DeleteNamespacesRequest) error
}

type Node

type Node struct {
	ObjectMeta        *metadata.ObjectMeta
	CreateTime        *timestamp.Timestamp
	MachineCreateTime *timestamp.Timestamp
	Capacity          *Capacity
	AlamedaNodeSpec   *AlamedaNodeSpec
}

func NewNode

func NewNode(entity *clusterstatus.NodeEntity) *Node

func (*Node) BuildEntity

func (p *Node) BuildEntity() *clusterstatus.NodeEntity

type NodeDAO

type NodeDAO interface {
	CreateNodes([]*Node) error
	ListNodes(*ListNodesRequest) ([]*Node, error)
	DeleteNodes(*DeleteNodesRequest) error
}

Node provides node measurement operations

type Pod

type Pod struct {
	ObjectMeta     *metadata.ObjectMeta
	CreateTime     *timestamp.Timestamp
	ResourceLink   string
	AppName        string
	AppPartOf      string
	Containers     []*Container
	TopController  *Controller
	Status         *PodStatus
	AlamedaPodSpec *AlamedaPodSpec
}

func NewPod

func NewPod(entity *clusterstatus.PodEntity) *Pod

func (*Pod) BuildEntity

func (p *Pod) BuildEntity() *clusterstatus.PodEntity

func (*Pod) ClusterNamespacePodName

func (p *Pod) ClusterNamespacePodName() string

type PodDAO

type PodDAO interface {
	CreatePods([]*Pod) error
	ListPods(*ListPodsRequest) ([]*Pod, error)
	DeletePods(*DeletePodsRequest) error
}

ContainerOperation provides container measurement operations

type PodObjectMeta

type PodObjectMeta struct {
	ObjectMeta    *metadata.ObjectMeta
	TopController *metadata.ObjectMeta
	AlamedaScaler *metadata.ObjectMeta
	Kind          string // Valid values: DEPLOYMENT, DEPLOYMENTCONFIG, STATEFULSET, ALAMEDASCALER
	ScalingTool   string // Valid values: NONE, VPA, HPA
}

func NewPodObjectMeta

func NewPodObjectMeta(objectMeta, topController, alamedaScaler *metadata.ObjectMeta, kind, scalingTool string) *PodObjectMeta

type PodStatus

type PodStatus struct {
	Phase   string
	Message string
	Reason  string
}

func NewPodStatus

func NewPodStatus(entity *clusterstatus.PodEntity) *PodStatus

type Provider

type Provider struct {
	Provider     string
	InstanceType string
	Region       string
	Zone         string
	Os           string
	Role         string
	InstanceId   string
	StorageSize  int64
}

func NewProvider

func NewProvider(entity *clusterstatus.NodeEntity) *Provider

type ResourceRequirements

type ResourceRequirements struct {
	// limits describes the maximum amount of compute resources allowed
	// use enum ResourceName as key of the map which defined in common
	Limits map[int32]string
	// requests describes the minimum amount of compute resources required
	// use enum ResourceName as key of the map which defined in common
	Requests map[int32]string
}

func NewResourceRequirements

func NewResourceRequirements(limitCpu, limitMemory, reqCpu, reqMemory string) *ResourceRequirements

Jump to

Keyboard shortcuts

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