health

package
v0.0.0-...-4762671 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2019 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsInvalidConfig

func IsInvalidConfig(err error) bool

IsInvalidConfig asserts invalidConfigError.

Types

type Cluster

type Cluster struct {
	Nodes  []v1.Node
	Pods   []v1.Pod
	Status v1alpha1.StatusCluster
	Spec   host.ProviderSpec
}

Cluster represents the control plane and tenant cluster data received for performing health calculations

type ClusterStatus

type ClusterStatus struct {
	Health key.Health         `json:"health"`
	State  key.LifecycleState `json:"state"`
}

ClusterStatus holds data about the overall health/status of a cluster.

type Config

type Config struct {
	Logger micrologger.Logger
}

Config represents the configuration used to create a new health service.

type NodeStatus

type NodeStatus struct {
	Identity         NodeStatusIdentity         `json:"identity"`
	MachineResources NodeStatusMachineResources `json:"machine"`
	Ready            bool                       `json:"ready"`
	Health           key.Health                 `json:"health"`
	RequestTotals    NodeStatusComputeResources `json:"request_totals"`
	LimitTotals      NodeStatusComputeResources `json:"limit_totals"`
}

NodeStatus represents the health status of a single node in a cluster.

type NodeStatusComputeResources

type NodeStatusComputeResources struct {
	CPU         int64 `json:"cpu"`
	MemoryBytes int64 `json:"memory_bytes"`
}

NodeStatusComputeResources holds data about available or requested compute resources.

type NodeStatusIdentity

type NodeStatusIdentity struct {
	Name               string `json:"name"`
	KubeletVersion     string `json:"kubelet_version"`
	OperatorVersion    string `json:"operator_version"`
	Role               string `json:"role"`
	IP                 string `json:"ip"`
	Hostname           string `json:"hostname"`
	InstanceType       string `json:"instance_type"`
	AvailabilityRegion string `json:"availability_region"`
	AvailabilityZone   string `json:"availability_zone"`
}

NodeStatusIdentity holds data about the identity of a node which is generally static.

type NodeStatusMachineResources

type NodeStatusMachineResources struct {
	CPUCount                          int64 `json:"cpu_count"`
	MemoryCapacityBytes               int64 `json:"memory_capacity_bytes"`
	MemoryAllocatableBytes            int64 `json:"memory_allocatable_bytes"`
	EphemeralStorageCap               int64 `json:"ephemeral_storage_capacity_bytes"`
	EphemeralStorageAvail             int64 `json:"ephemeral_storage_allocatable_bytes"`
	AttachableVolumesAllocatableCount int64 `json:"attachable_volume_allocatable_count"`
	AttachableVolumesCapacityCount    int64 `json:"attachable_volume_capacity_count"`
	DockerVolumeSizeGB                int64 `json:"docker_volume_size_gb"`
	AttachedVolumesCount              int64 `json:"attached_volumes_count"`
}

NodeStatusMachineResources holds data about the status of storage on a cluster node.

type Request

type Request struct {
	ClusterID string
	Cluster   Cluster
}

Request is the configuration for the service action.

type Response

type Response struct {
	Cluster ClusterStatus `json:"cluster"`
	Nodes   []NodeStatus  `json:"nodes"`
}

Response holds the data returned from the health searcher endpoint.

type Service

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

Service is an object representing the health service.

func New

func New(config Config) (*Service, error)

New creates a new configured service object.

func (*Service) Search

func (s *Service) Search(ctx context.Context, request Request) (*Response, error)

Search accepts data from the control plane and tenant cluster and returns an object representing an aggregate health of the cluster and its nodes.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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