v1alpha1

package
v0.0.0-...-1aaef2a Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2024 License: Apache-2.0, BSD-3-Clause, CC-BY-3.0, + 1 more Imports: 13 Imported by: 0

Documentation

Overview

Package v1alpha1 contains API Schema definitions for the resource v1alpha1 API group +kubebuilder:object:generate=true +groupName=resource.servicefabrik.io

Index

Constants

This section is empty.

Variables

View Source
var (
	// GroupVersion is group version used to register these objects
	GroupVersion = schema.GroupVersion{Group: "resource.servicefabrik.io", Version: "v1alpha1"}
	// SchemeGroupVersion also used for code-generator
	SchemeGroupVersion = GroupVersion

	// SchemeBuilder is used to add go types to the GroupVersionKind scheme
	SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}

	// AddToScheme adds the types in this group-version to the given scheme.
	AddToScheme = SchemeBuilder.AddToScheme
)

Functions

func ResourceListAdd

func ResourceListAdd(x, y corev1.ResourceList)

ResourceListAdd adds the provided ResourceList y to the ResourceList x. If x or y is nil it just returns ResourceListAdd updates the value of x

func ResourceListEqual

func ResourceListEqual(x, y corev1.ResourceList) bool

ResourceListEqual return true if ResourceList x is equal to y. Otherwise returns false

func ResourceListLess

func ResourceListLess(x, y corev1.ResourceList) bool

ResourceListLess returns true if the ResourceList x is less to y, Otherwise return false

func ResourceListSub

func ResourceListSub(x, y corev1.ResourceList)

ResourceListSub subtracts the provided ResourceList y from the ResourceList x. If x or y is nil it just returns ResourceListSub updates the value of x

Types

type SFCluster

type SFCluster struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   SFClusterSpec   `json:"spec,omitempty"`
	Status SFClusterStatus `json:"status,omitempty"`
}

SFCluster is the Schema for the sfclusters API +kubebuilder:subresource:status +kubebuilder:printcolumn:name="numserviceinstance",type=integer,JSONPath=`.status.serviceInstanceCount`

func (*SFCluster) DeepCopy

func (in *SFCluster) DeepCopy() *SFCluster

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SFCluster.

func (*SFCluster) DeepCopyInto

func (in *SFCluster) DeepCopyInto(out *SFCluster)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*SFCluster) DeepCopyObject

func (in *SFCluster) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

func (*SFCluster) GetKubeConfig

func (cluster *SFCluster) GetKubeConfig(c kubernetes.Client) (*rest.Config, error)

GetKubeConfig return the kubeconfig of the cluster

type SFClusterInterface

type SFClusterInterface interface {
	metav1.Object
	GetKubeConfig(c kubernetes.Client) (*rest.Config, error)
}

SFClusterInterface is defined so that and SFCluster can be mocked in tests +kubebuilder:object:generate=false

type SFClusterList

type SFClusterList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []SFCluster `json:"items"`
}

SFClusterList contains a list of SFCluster

func (*SFClusterList) DeepCopy

func (in *SFClusterList) DeepCopy() *SFClusterList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SFClusterList.

func (*SFClusterList) DeepCopyInto

func (in *SFClusterList) DeepCopyInto(out *SFClusterList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*SFClusterList) DeepCopyObject

func (in *SFClusterList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type SFClusterSpec

type SFClusterSpec struct {
	// Name of the secret containing the kubeconfig required to access the
	// member cluster. The secret needs to exist in the same namespace
	// as the SFCluster and should have a "kubeconfig" key.
	SecretRef string `yaml:"secretRef" json:"secretRef"`

	// TotalCapacity represents the total resources of a cluster.
	// This should include the future capacity introduced by node autoscaler.
	TotalCapacity corev1.ResourceList `yaml:"totalCapacity,omitempty" json:"totalCapacity,omitempty"`

	// +kubebuilder:validation:Minimum=0
	// +kubebuilder:validation:Maximum=100
	// Determines the how filled the cluster becomes, before interoperator filters out the cluster as full.
	SchedulingLimitPercentage int `yaml:"schedulingLimitPercentage,omitempty" json:"schedulingLimitPercentage,omitempty"`
}

SFClusterSpec defines the desired state of SFCluster

func (*SFClusterSpec) DeepCopy

func (in *SFClusterSpec) DeepCopy() *SFClusterSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SFClusterSpec.

func (*SFClusterSpec) DeepCopyInto

func (in *SFClusterSpec) DeepCopyInto(out *SFClusterSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type SFClusterStatus

type SFClusterStatus struct {
	ServiceInstanceCount int `json:"serviceInstanceCount,omitempty"`

	// CurrentCapacity represents the total resources of a cluster from all the current nodes
	CurrentCapacity corev1.ResourceList `yaml:"currentCapacity,omitempty" json:"currentCapacity,omitempty"`

	// TotalCapacity represents the total resources of a cluster.
	// This should include the future capacity introduced by node autoscaler.
	TotalCapacity corev1.ResourceList `yaml:"totalCapacity,omitempty" json:"totalCapacity,omitempty"`

	// Requests represents the total resources requested by all the pods on the cluster
	Requests corev1.ResourceList `yaml:"requests,omitempty" json:"requests,omitempty"`
}

SFClusterStatus defines the observed state of SFCluster

func (*SFClusterStatus) DeepCopy

func (in *SFClusterStatus) DeepCopy() *SFClusterStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SFClusterStatus.

func (*SFClusterStatus) DeepCopyInto

func (in *SFClusterStatus) DeepCopyInto(out *SFClusterStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

Directories

Path Synopsis
Package mock_v1alpha1 is a generated GoMock package.
Package mock_v1alpha1 is a generated GoMock package.

Jump to

Keyboard shortcuts

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