calc

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package calc provides function to calculate resource quotas for different k8s resources.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Details

type Details struct {
	Version  string
	Kind     string
	Name     string
	Replicas int32
}

Details contains a few details to identify a k8s resource.

type ResourceUsage

type ResourceUsage struct {
	CPU     *resource.Quantity
	Memory  *resource.Quantity
	Details Details
}

ResourceUsage summarizes the usage of compute resources for a k8s resource.

func Deployment

func Deployment(deployment appsv1.Deployment) (*ResourceUsage, error)

Deployment calculates the cpu/memory resources a single deployment needs. Replicas and the deployment strategy are taken into account.

func StatefulSet

func StatefulSet(s appsv1.StatefulSet) (*ResourceUsage, error)

StatefulSet calculates the cpu/memory resources a single statefulset needs. Replicas are taken into account.

Jump to

Keyboard shortcuts

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