Documentation ¶
Index ¶
- Constants
- func IsScheduleResultEqual(tc1, tc2 []workv1alpha2.TargetCluster) bool
- func MakeNodeWithLabels(node string, milliCPU, memory, pods, ephemeralStorage int64, ...) *corev1.Node
- func MakeNodeWithTaints(node string, milliCPU, memory, pods, ephemeralStorage int64, ...) *corev1.Node
- func NewCluster(name string) *clusterv1alpha1.Cluster
- func NewClusterPropagationPolicy(policyName string, rsSelectors []policyv1alpha1.ResourceSelector, ...) *policyv1alpha1.ClusterPropagationPolicy
- func NewClusterWithResource(name string, allocatable, allocating, allocated corev1.ResourceList) *clusterv1alpha1.Cluster
- func NewCustomResource(apiVersion, kind, namespace, name string) *unstructured.Unstructured
- func NewCustomResourceDefinition(group string, specNames apiextensionsv1.CustomResourceDefinitionNames, ...) *apiextensionsv1.CustomResourceDefinition
- func NewDeployment(namespace string, name string) *appsv1.Deployment
- func NewJob(namespace string, name string) *batchv1.Job
- func NewNamespace(namespace string) *corev1.Namespace
- func NewNode(node string, milliCPU, memory, pods, ephemeralStorage int64) *corev1.Node
- func NewOverridePolicy(namespace, policyName string, rsSelectors []policyv1alpha1.ResourceSelector, ...) *policyv1alpha1.OverridePolicy
- func NewOverridePolicyByOverrideRules(namespace, policyName string, rsSelectors []policyv1alpha1.ResourceSelector, ...) *policyv1alpha1.OverridePolicy
- func NewPod(namespace string, name string) *corev1.Pod
- func NewPodWithRequest(pod, node string, milliCPU, memory, ephemeralStorage int64) *corev1.Pod
- func NewPropagationPolicy(ns, name string, rsSelectors []policyv1alpha1.ResourceSelector, ...) *policyv1alpha1.PropagationPolicy
- func NewResourceList(milliCPU, memory, ephemeralStorage int64) corev1.ResourceList
- func NewService(namespace string, name string) *corev1.Service
- func NewWorkload(namespace string, name string) *worklodv1alpha1.Workload
Constants ¶
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
func NewCustomResourceDefinition(group string, specNames apiextensionsv1.CustomResourceDefinitionNames, scope apiextensionsv1.ResourceScope) *apiextensionsv1.CustomResourceDefinition
NewCustomResourceDefinition will build a CRD object.
func NewDeployment ¶
func NewDeployment(namespace string, name string) *appsv1.Deployment
NewDeployment will build a deployment object.
func NewNamespace ¶
NewNamespace will build a Namespace object.
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 NewPodWithRequest ¶ added in v0.9.0
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
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.