helper

package
v0.4.5 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ResourceUnitZero             int64 = 0
	ResourceUnitCPU              int64 = 1000
	ResourceUnitMem              int64 = 1024 * 1024 * 1024
	ResourceUnitPod              int64 = 1
	ResourceUnitEphemeralStorage int64 = 1024 * 1024 * 1024
	ResourceUnitGPU              int64 = 1
)

These are different resource units.

Variables

This section is empty.

Functions

func MakeNodeWithLabels

func MakeNodeWithLabels(node string, milliCPU, memory, pods, ephemeralStorage int64, labels map[string]string) *corev1.Node

MakeNodeWithLabels will build a ready node with resource and labels.

func MakeNodeWithTaints

func MakeNodeWithTaints(node string, milliCPU, memory, pods, ephemeralStorage int64, taints []corev1.Taint) *corev1.Node

MakeNodeWithTaints will build a ready node with resource and taints.

func NewCustomResource

func NewCustomResource(apiVersion, kind, namespace, name string) *unstructured.Unstructured

NewCustomResource will build a CR object with CRD Foo.

func NewCustomResourceDefinition

NewCustomResourceDefinition will build a CRD object.

func NewDeployment

func NewDeployment(namespace string, name string) *appsv1.Deployment

NewDeployment will build a deployment object.

func NewJob

func NewJob(namespace string, name string) *batchv1.Job

NewJob will build a job object.

func NewNode

func NewNode(node string, milliCPU, memory, pods, ephemeralStorage int64) *corev1.Node

NewNode will build a ready node with resource.

func NewPod

func NewPod(namespace string, name string) *corev1.Pod

NewPod will build a service object.

func NewPodWithRequest

func NewPodWithRequest(pod, node string, milliCPU, memory, ephemeralStorage int64) *corev1.Pod

NewPodWithRequest will build a Pod with resource request.

func NewResourceList

func NewResourceList(milliCPU, memory, ephemeralStorage int64) corev1.ResourceList

NewResourceList will build a ResourceList.

func NewService

func NewService(namespace string, name string) *corev1.Service

NewService will build a service object.

Types

This section is empty.

Jump to

Keyboard shortcuts

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