helper

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2022 License: Apache-2.0 Imports: 14 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 IsScheduleResultEqual added in v0.10.0

func IsScheduleResultEqual(tc1, tc2 []workv1alpha2.TargetCluster) bool

IsScheduleResultEqual will check whether two schedule results are equal.

func MakeNodeWithLabels added in v0.9.0

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 added in v0.9.0

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 NewCluster added in v0.10.0

func NewCluster(name string) *clusterv1alpha1.Cluster

NewCluster will build a Cluster.

func NewClusterPropagationPolicy added in v0.7.0

func NewClusterPropagationPolicy(policyName string, rsSelectors []policyv1alpha1.ResourceSelector, placement policyv1alpha1.Placement) *policyv1alpha1.ClusterPropagationPolicy

NewClusterPropagationPolicy will build a ClusterPropagationPolicy object.

func NewClusterWithResource added in v0.10.0

func NewClusterWithResource(name string, allocatable, allocating, allocated corev1.ResourceList) *clusterv1alpha1.Cluster

NewClusterWithResource will build a Cluster with resource.

func NewCustomResource added in v0.5.0

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

NewCustomResource will build a CR object with CRD Foo.

func NewCustomResourceDefinition added in v0.5.0

NewCustomResourceDefinition will build a CRD object.

func NewDeployment

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

NewDeployment will build a deployment object.

func NewJob added in v0.8.0

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

NewJob will build a job object.

func NewNamespace

func NewNamespace(namespace string) *corev1.Namespace

NewNamespace will build a Namespace object.

func NewNode added in v0.9.0

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

NewNode will build a ready node with resource.

func NewOverridePolicy added in v0.7.0

func NewOverridePolicy(namespace, policyName string, rsSelectors []policyv1alpha1.ResourceSelector, clusterAffinity policyv1alpha1.ClusterAffinity, overriders policyv1alpha1.Overriders) *policyv1alpha1.OverridePolicy

NewOverridePolicy will build a OverridePolicy object.

func NewOverridePolicyByOverrideRules added in v1.0.0

func NewOverridePolicyByOverrideRules(namespace, policyName string, rsSelectors []policyv1alpha1.ResourceSelector, overrideRules []policyv1alpha1.RuleWithCluster) *policyv1alpha1.OverridePolicy

NewOverridePolicyByOverrideRules will build a OverridePolicy object by OverrideRules

func NewPod added in v0.4.0

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

NewPod will build a service object.

func NewPodWithRequest added in v0.9.0

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

NewPodWithRequest will build a Pod with resource request.

func NewPropagationPolicy added in v0.7.0

func NewPropagationPolicy(ns, name string, rsSelectors []policyv1alpha1.ResourceSelector, placement policyv1alpha1.Placement) *policyv1alpha1.PropagationPolicy

NewPropagationPolicy will build a PropagationPolicy object.

func NewResourceList added in v0.9.0

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

NewResourceList will build a ResourceList.

func NewService added in v0.4.0

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

NewService will build a service object.

func NewWorkload added in v1.0.0

func NewWorkload(namespace string, name string) *worklodv1alpha1.Workload

NewWorkload will build a workload object.

Types

This section is empty.

Jump to

Keyboard shortcuts

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