v1beta1

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package v1beta1 contains API Schema definitions for the k8gb v1beta1 API group +kubebuilder:object:generate=true +groupName=k8gb.absa.oss

Index

Constants

This section is empty.

Variables

View Source
var (
	// GroupVersion is group version used to register these objects
	GroupVersion = schema.GroupVersion{Group: "k8gb.absa.oss", Version: "v1beta1"}

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

func ToV1IngressSpec(spec IngressSpec) netv1.IngressSpec

ToV1IngressSpec transforms from k8gb ingress Spec to networking.k8s.io/v1 IngressSpec

Types

type Gslb

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

	Spec   GslbSpec   `json:"spec,omitempty"`
	Status GslbStatus `json:"status,omitempty"`
}

Gslb is the Schema for the gslbs API +kubebuilder:printcolumn:name="strategy",type=string,JSONPath=`.spec.strategy.type` +kubebuilder:printcolumn:name="geoTag",type=string,JSONPath=`.status.geoTag` +kubebuilder:printcolumn:name="hosts",type=string,JSONPath=`.status.hosts`,priority=1

func (*Gslb) DeepCopy

func (in *Gslb) DeepCopy() *Gslb

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

func (*Gslb) DeepCopyInto

func (in *Gslb) DeepCopyInto(out *Gslb)

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

func (*Gslb) DeepCopyObject

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

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

type GslbList

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

GslbList contains a list of Gslb

func (*GslbList) DeepCopy

func (in *GslbList) DeepCopy() *GslbList

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

func (*GslbList) DeepCopyInto

func (in *GslbList) DeepCopyInto(out *GslbList)

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

func (*GslbList) DeepCopyObject

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

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

type GslbSpec

type GslbSpec struct {
	// Gslb-enabled Ingress Spec
	Ingress IngressSpec `json:"ingress,omitempty"`
	// Gslb Strategy spec
	Strategy Strategy `json:"strategy"`
	// ResourceRef spec
	ResourceRef ResourceRef `json:"resourceRef,omitempty"`
}

GslbSpec defines the desired state of Gslb +k8s:openapi-gen=true

func (*GslbSpec) DeepCopy

func (in *GslbSpec) DeepCopy() *GslbSpec

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

func (*GslbSpec) DeepCopyInto

func (in *GslbSpec) DeepCopyInto(out *GslbSpec)

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

type GslbStatus

type GslbStatus struct {
	// Associated Service status
	ServiceHealth map[string]HealthStatus `json:"serviceHealth"`
	// Current Healthy DNS record structure
	HealthyRecords map[string][]string `json:"healthyRecords"`
	// Cluster Geo Tag
	GeoTag string `json:"geoTag"`
	// Comma-separated list of hosts
	Hosts string `json:"hosts,omitempty"`
	// LoadBalancer configuration
	LoadBalancer LoadBalancer `json:"loadBalancer"`
	// Servers configuration
	Servers []*Server `json:"servers"`
}

GslbStatus defines the observed state of Gslb

func (*GslbStatus) DeepCopy

func (in *GslbStatus) DeepCopy() *GslbStatus

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

func (*GslbStatus) DeepCopyInto

func (in *GslbStatus) DeepCopyInto(out *GslbStatus)

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

type HealthStatus

type HealthStatus string
const (
	Healthy   HealthStatus = "Healthy"
	Unhealthy HealthStatus = "Unhealthy"
	NotFound  HealthStatus = "NotFound"
)

func (HealthStatus) String

func (h HealthStatus) String() string

type IngressRule

type IngressRule struct {
	// Host is the fully qualified domain name of a network host, as defined by RFC 3986.
	// Note the following deviations from the "host" part of the
	// URI as defined in RFC 3986:
	// 1. IPs are not allowed. Currently an IngressRuleValue can only apply to
	//    the IP in the Spec of the parent Ingress.
	// 2. The `:` delimiter is not respected because ports are not allowed.
	//	  Currently the port of an Ingress is implicitly :80 for http and
	//	  :443 for https.
	// Both these may change in the future.
	// Incoming requests are matched against the host before the
	// IngressRuleValue. If the host is unspecified, the Ingress routes all
	// traffic based on the specified IngressRuleValue.
	//
	// Host can be "precise" which is a domain name without the terminating dot of
	// a network host (e.g. "foo.bar.com") or "wildcard", which is a domain name
	// prefixed with a single wildcard label (e.g. "*.foo.com").
	// The wildcard character '*' must appear by itself as the first DNS label and
	// matches only a single label. You cannot have a wildcard label by itself (e.g. Host == "*").
	// Requests will be matched against the Host field in the following way:
	// 1. If Host is precise, the request matches this rule if the http host header is equal to Host.
	// 2. If Host is a wildcard, then the request matches this rule if the http host header
	// is to equal to the suffix (removing the first label) of the wildcard rule.
	// +optional
	Host string `json:"host,omitempty" protobuf:"bytes,1,opt,name=host"`
	// IngressRuleValue represents a rule to route requests for this IngressRule.
	// If unspecified, the rule defaults to a http catch-all. Whether that sends
	// just traffic matching the host to the default backend or all traffic to the
	// default backend, is left to the controller fulfilling the Ingress. Http is
	// currently the only supported IngressRuleValue.
	// +optional
	IngressRuleValue `json:",inline,omitempty" protobuf:"bytes,2,opt,name=ingressRuleValue"`
}

IngressRule represents the rules mapping the paths under a specified host to the related backend services. Incoming requests are first evaluated for a host match, then routed to the backend associated with the matching IngressRuleValue.

func (*IngressRule) DeepCopy

func (in *IngressRule) DeepCopy() *IngressRule

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

func (*IngressRule) DeepCopyInto

func (in *IngressRule) DeepCopyInto(out *IngressRule)

DeepCopyInto copying the receiver, writing into out. in must be non-nil.

type IngressRuleValue

type IngressRuleValue struct {

	// HTTPIngressRuleValue is a list of http selectors
	// pointing to backends. In the example: http://<host>/<path>?<searchpart>
	// -> backend where where parts of the url correspond to
	// RFC 3986, this resource will be used to match against
	// everything after the last '/' and before the first '?'
	// or '#'.
	HTTP *netv1.HTTPIngressRuleValue `json:"http" protobuf:"bytes,1,opt,name=http"`
}

IngressRuleValue represents a rule to apply against incoming requests. If the rule is satisfied, the request is routed to the specified backend. Currently mixing different types of rules in a single Ingress is disallowed, so exactly one of the following must be set.

func (*IngressRuleValue) DeepCopy

func (in *IngressRuleValue) DeepCopy() *IngressRuleValue

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

func (*IngressRuleValue) DeepCopyInto

func (in *IngressRuleValue) DeepCopyInto(out *IngressRuleValue)

DeepCopyInto copying the receiver, writing into out. in must be non-nil.

type IngressSpec

type IngressSpec struct {
	// IngressClassName is the name of the IngressClass cluster resource. The
	// associated IngressClass defines which controller will implement the
	// resource. This replaces the deprecated `kubernetes.io/ingress.class`
	// annotation. For backwards compatibility, when that annotation is set, it
	// must be given precedence over this field. The controller may emit a
	// warning if the field and annotation have different values.
	// Implementations of this API should ignore Ingresses without a class
	// specified. An IngressClass resource may be marked as default, which can
	// be used to set a default value for this field. For more information,
	// refer to the IngressClass documentation.
	// +optional
	IngressClassName *string `json:"ingressClassName,omitempty" protobuf:"bytes,4,opt,name=ingressClassName"`

	// A default backend capable of servicing requests that don't match any
	// rule. At least one of 'backend' or 'rules' must be specified. This field
	// is optional to allow the loadbalancer controller or defaulting logic to
	// specify a global default.
	// +optional
	DefaultBackend *netv1.IngressBackend `json:"backend,omitempty" protobuf:"bytes,1,opt,name=defaultBackend"`

	// TLS configuration. Currently the Ingress only supports a single TLS
	// port, 443. If multiple members of this list specify different hosts, they
	// will be multiplexed on the same port according to the hostname specified
	// through the SNI TLS extension, if the ingress controller fulfilling the
	// ingress supports SNI.
	// +optional
	TLS []netv1.IngressTLS `json:"tls,omitempty" protobuf:"bytes,2,rep,name=tls"`

	// A list of host rules used to configure the Ingress. If unspecified, or
	// no rule matches, all traffic is sent to the default backend.
	// +optional
	Rules []IngressRule `json:"rules,omitempty" protobuf:"bytes,3,rep,name=rules"`
}

IngressSpec overrides https://github.com/kubernetes/api/blob/master/networking/v1/types.go IngressSpec is upstream Ingress to be included in Gslb specification and extended with Gslb specific requirements.

func FromV1IngressSpec added in v0.9.0

func FromV1IngressSpec(v1Spec netv1.IngressSpec) IngressSpec

FromV1IngressSpec transforms from networking.k8s.io/v1 IngressSpec to custom k8gb ingress Spec

func (*IngressSpec) DeepCopy

func (in *IngressSpec) DeepCopy() *IngressSpec

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

func (*IngressSpec) DeepCopyInto

func (in *IngressSpec) DeepCopyInto(out *IngressSpec)

DeepCopyInto copying the receiver, writing into out. in must be non-nil.

type LoadBalancer added in v0.13.0

type LoadBalancer struct {
	// ExposedIPs on the local Load Balancer
	ExposedIPs []string `json:"exposedIps,omitempty"`
}

LoadBalancer holds the GSLB's load balancer configuration +k8s:openapi-gen=true

func (*LoadBalancer) DeepCopy added in v0.13.0

func (in *LoadBalancer) DeepCopy() *LoadBalancer

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

func (*LoadBalancer) DeepCopyInto added in v0.13.0

func (in *LoadBalancer) DeepCopyInto(out *LoadBalancer)

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

type NamespacedName added in v0.13.0

type NamespacedName struct {
	// Namespace where the resource can be found
	Namespace string `json:"namespace"`
	// Name of the resource
	Name string `json:"name"`
}

NamespacedName holds a reference to a k8s resource +k8s:openapi-gen=true

func (*NamespacedName) DeepCopy added in v0.13.0

func (in *NamespacedName) DeepCopy() *NamespacedName

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

func (*NamespacedName) DeepCopyInto added in v0.13.0

func (in *NamespacedName) DeepCopyInto(out *NamespacedName)

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

type ResourceRef added in v0.13.0

type ResourceRef struct {
	// Ingress selects a kubernetes.networking.k8s.io/v1.Ingress resource
	Ingress metav1.LabelSelector `json:"ingress,omitempty"`
}

ResourceRef selects a resource defining the GSLB's load balancer and server +k8s:openapi-gen=true

func (*ResourceRef) DeepCopy added in v0.13.0

func (in *ResourceRef) DeepCopy() *ResourceRef

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

func (*ResourceRef) DeepCopyInto added in v0.13.0

func (in *ResourceRef) DeepCopyInto(out *ResourceRef)

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

type Server added in v0.13.0

type Server struct {
	// Hostname exposed by the GSLB
	Host string `json:"host,omitempty"`
	// Kubernetes Services backing the load balanced application
	Services []*NamespacedName `json:"services,omitempty"`
}

Servers holds the GSLB's servers' configuration +k8s:openapi-gen=true

func (*Server) DeepCopy added in v0.13.0

func (in *Server) DeepCopy() *Server

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

func (*Server) DeepCopyInto added in v0.13.0

func (in *Server) DeepCopyInto(out *Server)

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

type Strategy

type Strategy struct {
	// Load balancing strategy type:(roundRobin|failover)
	Type string `json:"type"`
	// Weight is defined by map region:weight
	Weight map[string]int `json:"weight,omitempty"`
	// Primary Geo Tag. Valid for failover strategy only
	PrimaryGeoTag string `json:"primaryGeoTag,omitempty"`
	// Defines DNS record TTL in seconds
	DNSTtlSeconds int `json:"dnsTtlSeconds,omitempty"`
	// Split brain TXT record expiration in seconds
	SplitBrainThresholdSeconds int `json:"splitBrainThresholdSeconds,omitempty"`
}

Strategy defines Gslb behavior +k8s:openapi-gen=true

func (*Strategy) DeepCopy

func (in *Strategy) DeepCopy() *Strategy

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

func (*Strategy) DeepCopyInto

func (in *Strategy) DeepCopyInto(out *Strategy)

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

Jump to

Keyboard shortcuts

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