plugin

package
Version: v1.0.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ClientSetInstance *kubernetes.Clientset

ClientSetInstance helps in accessing kubernetes apis through client.

Functions

func GetAllNodesCost

func GetAllNodesCost()

GetAllNodesCost returns the cumulative cost of all the nodes.

func GetClusterNodes

func GetClusterNodes() []v1.Node

GetClusterNodes returns the list of nodes in the cluster.

func GetClusterPersistentVolumeClaims

func GetClusterPersistentVolumeClaims() []v1.PersistentVolumeClaim

GetClusterPersistentVolumeClaims returns the list of persistent volume claims for the cluster.

func GetClusterPods

func GetClusterPods() []v1.Pod

GetClusterPods returns the list of pods in cluster.

func GetClusterSummary

func GetClusterSummary()

GetClusterSummary summarizes cluster metrics.

func GetClusterVolumes

func GetClusterVolumes() []v1.PersistentVolume

GetClusterVolumes returns list of persistent volumes for the cluster.

func GetGroupByName

func GetGroupByName(groupClient *groups.GroupClient, groupName string) *groups_v1.Group

GetGroupByName return group CRD by name.

func GetPodCost

func GetPodCost(podName string)

GetPodCost returns the cumulative cost for the pods.

func GetPodsCostForLabel

func GetPodsCostForLabel(label string)

GetPodsCostForLabel returns pods cost for given label.

func GetSavings

func GetSavings()

GetSavings returns the savings summary.

func PrintGroup

func PrintGroup(group *groups_v1.Group)

PrintGroup displays the group information.

func ProvideClientSetInstance

func ProvideClientSetInstance(clientset *kubernetes.Clientset)

ProvideClientSetInstance sets the client set instance.

func SaveUserCosts

func SaveUserCosts(cpuCostPerCPUPerHour, memCostPerGBPerHour, storageCostPerGBPerHour string) bool

SaveUserCosts stores the cpu, memory and storage cost per unit per hour in the cluster as config maps.

Types

type Cost

type Cost struct {
	TotalCost   float64
	CPUCost     float64
	MemoryCost  float64
	StorageCost float64
}

Cost details

func GetGroupDetails

func GetGroupDetails(group *groups_v1.Group) (*metrics.GroupMetrics, *metrics.GroupMetrics, *Cost)

GetGroupDetails returns aggregated metrics (cpu, memory, storage) and cost (total, cpu, memory and storage) of a Group

type PersistentVolumeClaim

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

PersistentVolumeClaim details

type Pod

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

Pod Information

type Price

type Price struct {
	CPU     float64
	Memory  float64
	Storage float64
}

Price information. NOTE: All fields are Per unit resource per hour

func GetUserCosts

func GetUserCosts() *Price

GetUserCosts gives the cpu, memory and storage cost per unit per hour which are stored in the cluster as config maps.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL