Documentation
¶
Overview ¶
Package v1alpha1 contains API Schema definitions for the balancer v1alpha1 API group. +k8s:deepcopy-gen=package,register +groupName=exposer.hliangzhao.io
Package v1alpha1 contains API Schema definitions for the exposer v1alpha1 API group +kubebuilder:object:generate=true +groupName=exposer.hliangzhao.io
Index ¶
Constants ¶
const (
// BalancerKey is the key of the label which is used to select the Balancer instance.
BalancerKey = "balancer.exposer.hliangzhao.io/balancer-name"
)
const ( // ConfigMapHashKey is the key of the annotation which is used by the Balancer. // Balancer wraps a Nginx instance, and the value corresponding to key ConfigMapHashKey is a hashing result. ConfigMapHashKey = "balancer.exposer.hliangzhao.io/configmap-hash" )
Variables ¶
var ( // SchemeGroupVersion is group version used to register these objects SchemeGroupVersion = schema.GroupVersion{Group: "exposer.hliangzhao.io", Version: "v1alpha1"} // SchemeBuilder is used to add go types to the GroupVersionKind scheme SchemeBuilder = &scheme.Builder{GroupVersion: SchemeGroupVersion} // AddToScheme adds the types in this group-version to the given scheme. AddToScheme = SchemeBuilder.AddToScheme )
Functions ¶
func RegisterDefaults ¶
RegisterDefaults adds defaulters functions to the given scheme. Public to allow building arbitrary schemes. All generated defaulters are covering - they call all nested defaulters.
func Resource ¶
func Resource(resource string) schema.GroupResource
Resource takes an unqualified resource and returns a Group-qualified GroupResource.
Types ¶
type BackendSpec ¶
type BackendSpec struct { // +kubebuilder:validation:MinLength=1 Name string `json:"name"` // +kubebuilder:validation:Minimum=1 Weight int32 `json:"weight"` Selector map[string]string `json:"selector,omitempty"` }
BackendSpec defines the desired status of endpoints of Balancer +k8s:openapi-gen=true
func (*BackendSpec) DeepCopy ¶
func (in *BackendSpec) DeepCopy() *BackendSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackendSpec.
func (*BackendSpec) DeepCopyInto ¶
func (in *BackendSpec) DeepCopyInto(out *BackendSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type Balancer ¶
type Balancer struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` Spec BalancerSpec `json:"spec,omitempty"` Status BalancerStatus `json:"status,omitempty"` }
Balancer is the Schema for the balancers API +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +genclient +k8s:openapi-gen=true +kubebuilder:object:root=true +kubebuilder:subresource:status +kubebuilder:subresource:scale:specpath=.spec.replicas,statuspath=.status.replicas,selectorpath=.status.selector
func (*Balancer) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Balancer.
func (*Balancer) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*Balancer) DeepCopyObject ¶
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type BalancerList ¶
type BalancerList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata,omitempty"` Items []Balancer `json:"items"` }
BalancerList contains a list of Balancer +kubebuilder:object:root=true +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +k8s:openapi-gen=true
func (*BalancerList) DeepCopy ¶
func (in *BalancerList) DeepCopy() *BalancerList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BalancerList.
func (*BalancerList) DeepCopyInto ¶
func (in *BalancerList) DeepCopyInto(out *BalancerList)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*BalancerList) DeepCopyObject ¶
func (in *BalancerList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type BalancerPort ¶
type BalancerPort struct { // The name of this port within the balancer. This must be a DNS_LABEL. // All ports within a ServiceSpec must have unique names. This maps to // the 'Name' field in EndpointPort objects. // Optional if only one BalancerPort is defined on this service. // +required Name string `json:"name,omitempty"` // +optional Protocol Protocol `json:"protocol,omitempty"` // the port that will be exposed by the balancer Port Port `json:"port"` // the port that used by the container // +optional TargetPort intstr.IntOrString `json:"targetPort,omitempty"` }
BalancerPort contains the endpoints and exposed ports. +k8s:openapi-gen=true
func (*BalancerPort) DeepCopy ¶
func (in *BalancerPort) DeepCopy() *BalancerPort
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BalancerPort.
func (*BalancerPort) DeepCopyInto ¶
func (in *BalancerPort) DeepCopyInto(out *BalancerPort)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type BalancerSpec ¶
type BalancerSpec struct { // +kubebuilder:validation:MinItems=1 Backends []BackendSpec `json:"backends"` Selector map[string]string `json:"selector,omitempty"` Ports []BalancerPort `json:"ports"` }
BalancerSpec defines the desired state of Balancer +k8s:openapi-gen=true
func (*BalancerSpec) DeepCopy ¶
func (in *BalancerSpec) DeepCopy() *BalancerSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BalancerSpec.
func (*BalancerSpec) DeepCopyInto ¶
func (in *BalancerSpec) DeepCopyInto(out *BalancerSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type BalancerStatus ¶
type BalancerStatus struct { // +optional ActiveBackendsNum int32 `json:"activeBackendsNum,omitempty"` // +optional ObsoleteBackendsNum int32 `json:"obsoleteBackendsNum,omitempty"` }
BalancerStatus defines the observed state of Balancer +k8s:openapi-gen=true
func (*BalancerStatus) DeepCopy ¶
func (in *BalancerStatus) DeepCopy() *BalancerStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BalancerStatus.
func (*BalancerStatus) DeepCopyInto ¶
func (in *BalancerStatus) DeepCopyInto(out *BalancerStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.