v1beta1

package
v2.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2025 License: MIT Imports: 7 Imported by: 10

Documentation

Overview

Package v1beta1 contains API Schema definitions for the configuration.konghq.com v1beta1 API group. +kubebuilder:object:generate=true +groupName=configuration.konghq.com

Index

Constants

View Source
const (
	// KongUpstreamPolicyAnnotationKey is the key used to attach KongUpstreamPolicy to Services.
	// The value of the annotation is the name of the KongUpstreamPolicy object in the same namespace as the Service.
	KongUpstreamPolicyAnnotationKey = "konghq.com/upstream-policy"
)

Variables

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

	// SchemeGroupVersion is a convenience var for generated clientsets.
	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 Resource

func Resource(resource string) schema.GroupResource

Resource takes an unqualified resource and returns a Group qualified GroupResource.

Types

type HTTPStatus

type HTTPStatus int

HTTPStatus is an HTTP status code. +kubebuilder:validation:Minimum=100 +kubebuilder:validation:Maximum=599

type HashInput

type HashInput string

HashInput is the input for consistent-hashing load balancing algorithm. Use "none" to disable hashing, it is required for sticky sessions.

+kubebuilder:validation:Enum=ip;consumer;path;none

type KongConsumerGroup

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

	Spec KongConsumerGroupSpec `json:"spec,omitempty"`

	// Status represents the current status of the KongConsumerGroup resource.
	// +kubebuilder:default={conditions: {{type: "Programmed", status: "Unknown", reason:"Pending", message:"Waiting for controller", lastTransitionTime: "1970-01-01T00:00:00Z"}}}
	Status KongConsumerGroupStatus `json:"status,omitempty"`
}

KongConsumerGroup is the Schema for the kongconsumergroups API.

+genclient +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +kubebuilder:object:root=true +kubebuilder:subresource:status +kubebuilder:storageversion +kubebuilder:resource:shortName=kcg,categories=kong-ingress-controller;kong +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp`,description="Age" +kubebuilder:printcolumn:name="Programmed",type=string,JSONPath=`.status.conditions[?(@.type=="Programmed")].status` +kubebuilder:validation:XValidation:rule="(!has(oldSelf.spec) || !has(oldSelf.spec.controlPlaneRef)) || has(self.spec.controlPlaneRef)", message="controlPlaneRef is required once set" +kubebuilder:validation:XValidation:rule="(!has(self.spec) || !has(self.spec.controlPlaneRef) || !has(self.spec.controlPlaneRef.konnectNamespacedRef)) ? true : !has(self.spec.controlPlaneRef.konnectNamespacedRef.__namespace__)", message="spec.controlPlaneRef cannot specify namespace for namespaced resource" +kubebuilder:validation:XValidation:rule="(!has(oldSelf.spec) || !has(oldSelf.spec.controlPlaneRef)) ? true : (!has(self.status) || !self.status.conditions.exists(c, c.type == 'Programmed' && c.status == 'True')) ? true : oldSelf.spec.controlPlaneRef == self.spec.controlPlaneRef", message="spec.controlPlaneRef is immutable when an entity is already Programmed" +apireference:kgo:include +kong:channels=gateway-operator

func (*KongConsumerGroup) DeepCopy

func (in *KongConsumerGroup) DeepCopy() *KongConsumerGroup

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

func (*KongConsumerGroup) DeepCopyInto

func (in *KongConsumerGroup) DeepCopyInto(out *KongConsumerGroup)

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

func (*KongConsumerGroup) DeepCopyObject

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

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

func (*KongConsumerGroup) GetConditions

func (obj *KongConsumerGroup) GetConditions() []metav1.Condition

GetConditions returns the Status Conditions

func (*KongConsumerGroup) GetControlPlaneID

func (obj *KongConsumerGroup) GetControlPlaneID() string

GetControlPlaneID returns the ControlPlane ID in the KongConsumerGroup status.

func (*KongConsumerGroup) GetControlPlaneRef

func (obj *KongConsumerGroup) GetControlPlaneRef() *commonv1alpha1.ControlPlaneRef

GetControlPlaneRef returns the ControlPlaneRef.

func (*KongConsumerGroup) GetKonnectID

func (obj *KongConsumerGroup) GetKonnectID() string

GetKonnectID returns the Konnect ID in the KongConsumerGroup status.

func (*KongConsumerGroup) GetKonnectStatus

func (obj *KongConsumerGroup) GetKonnectStatus() *konnectv1alpha2.KonnectEntityStatus

GetKonnectStatus returns the Konnect status contained in the KongConsumerGroup status.

func (KongConsumerGroup) GetTypeName

func (obj KongConsumerGroup) GetTypeName() string

GetTypeName returns the KongConsumerGroup Kind name

func (*KongConsumerGroup) SetConditions

func (obj *KongConsumerGroup) SetConditions(conditions []metav1.Condition)

SetConditions sets the Status Conditions

func (*KongConsumerGroup) SetControlPlaneID

func (obj *KongConsumerGroup) SetControlPlaneID(id string)

SetControlPlaneID sets the ControlPlane ID in the KongConsumerGroup status.

func (*KongConsumerGroup) SetControlPlaneRef

func (obj *KongConsumerGroup) SetControlPlaneRef(ref *commonv1alpha1.ControlPlaneRef)

SetControlPlaneRef sets the ControlPlaneRef.

func (*KongConsumerGroup) SetKonnectID

func (obj *KongConsumerGroup) SetKonnectID(id string)

SetKonnectID sets the Konnect ID in the KongConsumerGroup status.

type KongConsumerGroupList

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

KongConsumerGroupList contains a list of KongConsumerGroups. +kubebuilder:object:root=true

func (*KongConsumerGroupList) DeepCopy

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

func (*KongConsumerGroupList) DeepCopyInto

func (in *KongConsumerGroupList) DeepCopyInto(out *KongConsumerGroupList)

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

func (*KongConsumerGroupList) DeepCopyObject

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

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

func (KongConsumerGroupList) GetItems

func (obj KongConsumerGroupList) GetItems() []KongConsumerGroup

GetItems returns the list of KongConsumerGroup items.

type KongConsumerGroupSpec

type KongConsumerGroupSpec struct {
	// Name is the name of the ConsumerGroup in Kong.
	Name string `json:"name,omitempty"`

	// ControlPlaneRef is a reference to a ControlPlane this ConsumerGroup is associated with.
	// +kubebuilder:validation:XValidation:message="'konnectID' type is not supported", rule="self.type != 'konnectID'"
	// +optional
	ControlPlaneRef *commonv1alpha1.ControlPlaneRef `json:"controlPlaneRef,omitempty"`

	// Tags is an optional set of tags applied to the ConsumerGroup.
	Tags commonv1alpha1.Tags `json:"tags,omitempty"`
}

KongConsumerGroupSpec defines the desired state of KongConsumerGroup.

func (*KongConsumerGroupSpec) DeepCopy

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

func (*KongConsumerGroupSpec) DeepCopyInto

func (in *KongConsumerGroupSpec) DeepCopyInto(out *KongConsumerGroupSpec)

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

type KongConsumerGroupStatus

type KongConsumerGroupStatus struct {
	// Konnect contains the Konnect entity status.
	// +optional
	// +apireference:kic:exclude
	Konnect *konnectv1alpha2.KonnectEntityStatusWithControlPlaneRef `json:"konnect,omitempty"`

	// Conditions describe the current conditions of the KongConsumerGroup.
	//
	// Known condition types are:
	//
	// * "Programmed"
	//
	// +listType=map
	// +listMapKey=type
	// +kubebuilder:validation:MaxItems=8
	Conditions []metav1.Condition `json:"conditions,omitempty"`
}

KongConsumerGroupStatus represents the current status of the KongConsumerGroup resource.

func (*KongConsumerGroupStatus) DeepCopy

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

func (*KongConsumerGroupStatus) DeepCopyInto

func (in *KongConsumerGroupStatus) DeepCopyInto(out *KongConsumerGroupStatus)

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

type KongUpstreamActiveHealthcheck

type KongUpstreamActiveHealthcheck struct {
	// Type determines whether to perform active health checks using HTTP or HTTPS, or just attempt a TCP connection.
	// Accepted values are "http", "https", "tcp", "grpc", "grpcs".
	// +kubebuilder:validation:Enum=http;https;tcp;grpc;grpcs
	Type *string `json:"type,omitempty"`

	// Concurrency is the number of targets to check concurrently.
	// +kubebuilder:validation:Minimum=1
	Concurrency *int `json:"concurrency,omitempty"`

	// Healthy configures thresholds and HTTP status codes to mark targets healthy for an upstream.
	Healthy *KongUpstreamHealthcheckHealthy `json:"healthy,omitempty"`

	// Unhealthy configures thresholds and HTTP status codes to mark targets unhealthy for an upstream.
	Unhealthy *KongUpstreamHealthcheckUnhealthy `json:"unhealthy,omitempty"`

	// HTTPPath is the path to use in GET HTTP request to run as a probe.
	// +kubebuilder:validation:Pattern=^/.*$
	HTTPPath *string `json:"httpPath,omitempty"`

	// HTTPSSNI is the SNI to use in GET HTTPS request to run as a probe.
	HTTPSSNI *string `json:"httpsSni,omitempty"`

	// HTTPSVerifyCertificate is a boolean value that indicates if the certificate should be verified.
	HTTPSVerifyCertificate *bool `json:"httpsVerifyCertificate,omitempty"`

	// Timeout is the probe timeout in seconds.
	// +kubebuilder:validation:Minimum=0
	Timeout *int `json:"timeout,omitempty"`

	// Headers is a list of HTTP headers to add to the probe request.
	Headers map[string][]string `json:"headers,omitempty"`
}

KongUpstreamActiveHealthcheck configures active health check probing.

func (*KongUpstreamActiveHealthcheck) DeepCopy

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

func (*KongUpstreamActiveHealthcheck) DeepCopyInto

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

type KongUpstreamHash

type KongUpstreamHash struct {
	// Input allows using one of the predefined inputs (ip, consumer, path, none).
	// Set this to `none` if you want to use sticky sessions.
	// For other parameterized inputs, use one of the fields below.
	//
	// +optional
	Input *HashInput `json:"input,omitempty"`

	// Header is the name of the header to use as hash input.
	//
	// +optional
	Header *string `json:"header,omitempty"`

	// Cookie is the name of the cookie to use as hash input.
	//
	// +optional
	Cookie *string `json:"cookie,omitempty"`

	// CookiePath is cookie path to set in the response headers.
	//
	// +optional
	CookiePath *string `json:"cookiePath,omitempty"`

	// QueryArg is the name of the query argument to use as hash input.
	//
	// +optional
	QueryArg *string `json:"queryArg,omitempty"`

	// URICapture is the name of the URI capture group to use as hash input.
	//
	// +optional
	URICapture *string `json:"uriCapture,omitempty"`
}

KongUpstreamHash defines how to calculate hash for consistent-hashing load balancing algorithm. Only one of the fields must be set.

func (*KongUpstreamHash) DeepCopy

func (in *KongUpstreamHash) DeepCopy() *KongUpstreamHash

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

func (*KongUpstreamHash) DeepCopyInto

func (in *KongUpstreamHash) DeepCopyInto(out *KongUpstreamHash)

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

type KongUpstreamHealthcheck

type KongUpstreamHealthcheck struct {
	// Active configures active health check probing.
	Active *KongUpstreamActiveHealthcheck `json:"active,omitempty"`

	// Passive configures passive health check probing.
	Passive *KongUpstreamPassiveHealthcheck `json:"passive,omitempty"`

	// Threshold is the minimum percentage of the upstream’s targets’ weight that must be available for the whole
	// upstream to be considered healthy.
	Threshold *int `json:"threshold,omitempty"`
}

KongUpstreamHealthcheck represents a health-check config of an Upstream in Kong.

func (*KongUpstreamHealthcheck) DeepCopy

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

func (*KongUpstreamHealthcheck) DeepCopyInto

func (in *KongUpstreamHealthcheck) DeepCopyInto(out *KongUpstreamHealthcheck)

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

type KongUpstreamHealthcheckHealthy

type KongUpstreamHealthcheckHealthy struct {
	// HTTPStatuses is a list of HTTP status codes that Kong considers a success.
	HTTPStatuses []HTTPStatus `json:"httpStatuses,omitempty"`

	// Interval is the interval between active health checks for an upstream in seconds when in a healthy state.
	// +kubebuilder:validation:Minimum=0
	Interval *int `json:"interval,omitempty"`

	// Successes is the number of successes to consider a target healthy.
	// +kubebuilder:validation:Minimum=0
	Successes *int `json:"successes,omitempty"`
}

KongUpstreamHealthcheckHealthy configures thresholds and HTTP status codes to mark targets healthy for an upstream.

func (*KongUpstreamHealthcheckHealthy) DeepCopy

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

func (*KongUpstreamHealthcheckHealthy) DeepCopyInto

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

type KongUpstreamHealthcheckUnhealthy

type KongUpstreamHealthcheckUnhealthy struct {
	// HTTPFailures is the number of failures to consider a target unhealthy.
	// +kubebuilder:validation:Minimum=0
	HTTPFailures *int `json:"httpFailures,omitempty"`

	// HTTPStatuses is a list of HTTP status codes that Kong considers a failure.
	HTTPStatuses []HTTPStatus `json:"httpStatuses,omitempty"`

	// TCPFailures is the number of TCP failures in a row to consider a target unhealthy.
	// +kubebuilder:validation:Minimum=0
	TCPFailures *int `json:"tcpFailures,omitempty"`

	// Timeouts is the number of timeouts in a row to consider a target unhealthy.
	// +kubebuilder:validation:Minimum=0
	Timeouts *int `json:"timeouts,omitempty"`

	// Interval is the interval between active health checks for an upstream in seconds when in an unhealthy state.
	// +kubebuilder:validation:Minimum=0
	Interval *int `json:"interval,omitempty"`
}

KongUpstreamHealthcheckUnhealthy configures thresholds and HTTP status codes to mark targets unhealthy.

func (*KongUpstreamHealthcheckUnhealthy) DeepCopy

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

func (*KongUpstreamHealthcheckUnhealthy) DeepCopyInto

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

type KongUpstreamPassiveHealthcheck

type KongUpstreamPassiveHealthcheck struct {
	// Type determines whether to perform passive health checks interpreting HTTP/HTTPS statuses,
	// or just check for TCP connection success.
	// Accepted values are "http", "https", "tcp", "grpc", "grpcs".
	// +kubebuilder:validation:Enum=http;https;tcp;grpc;grpcs
	Type *string `json:"type,omitempty"`

	// Healthy configures thresholds and HTTP status codes to mark targets healthy for an upstream.
	Healthy *KongUpstreamHealthcheckHealthy `json:"healthy,omitempty"`

	// Unhealthy configures thresholds and HTTP status codes to mark targets unhealthy.
	Unhealthy *KongUpstreamHealthcheckUnhealthy `json:"unhealthy,omitempty"`
}

KongUpstreamPassiveHealthcheck configures passive checks around passive health checks.

func (*KongUpstreamPassiveHealthcheck) DeepCopy

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

func (*KongUpstreamPassiveHealthcheck) DeepCopyInto

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

type KongUpstreamPolicy

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

	// Spec contains the configuration of the Kong upstream.
	Spec KongUpstreamPolicySpec `json:"spec,omitempty"`

	// Status defines the current state of KongUpstreamPolicy
	Status gatewayv1alpha2.PolicyStatus `json:"status,omitempty"`
}

KongUpstreamPolicy allows configuring algorithm that should be used for load balancing traffic between Kong Upstream's Targets. It also allows configuring health checks for Kong Upstream's Targets.

Its configuration is similar to Kong Upstream object (https://docs.konghq.com/gateway/latest/admin-api/#upstream-object), and it is applied to Kong Upstream objects created by the controller.

It can be attached to Services. To attach it to a Service, it has to be annotated with `konghq.com/upstream-policy: <name>`, where `<name>` is the name of the KongUpstreamPolicy object in the same namespace as the Service.

When attached to a Service, it will affect all Kong Upstreams created for the Service.

When attached to a Service used in a Gateway API *Route rule with multiple BackendRefs, all of its Services MUST be configured with the same KongUpstreamPolicy. Otherwise, the controller will *ignore* the KongUpstreamPolicy.

Note: KongUpstreamPolicy doesn't implement Gateway API's GEP-713 strictly. In particular, it doesn't use the TargetRef for attaching to Services and Gateway API *Routes - annotations are used instead. This is to allow reusing the same KongUpstreamPolicy for multiple Services and Gateway API *Routes.

+genclient +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +kubebuilder:object:root=true +kubebuilder:resource:scope=Namespaced,shortName=kup,categories=kong-ingress-controller;kong +kubebuilder:subresource:status +kubebuilder:storageversion +kubebuilder:metadata:labels=gateway.networking.k8s.io/policy=direct +kubebuilder:validation:XValidation:rule="has(self.spec.hashOn) ? [has(self.spec.hashOn.input), has(self.spec.hashOn.cookie), has(self.spec.hashOn.header), has(self.spec.hashOn.uriCapture), has(self.spec.hashOn.queryArg)].filter(fieldSet, fieldSet == true).size() <= 1 : true", message="Only one of spec.hashOn.(input|cookie|header|uriCapture|queryArg) can be set." +kubebuilder:validation:XValidation:rule="has(self.spec.hashOn) && has(self.spec.hashOn.cookie) ? has(self.spec.hashOn.cookiePath) : true", message="When spec.hashOn.cookie is set, spec.hashOn.cookiePath is required." +kubebuilder:validation:XValidation:rule="has(self.spec.hashOn) && has(self.spec.hashOn.cookiePath) ? has(self.spec.hashOn.cookie) : true", message="When spec.hashOn.cookiePath is set, spec.hashOn.cookie is required." +kubebuilder:validation:XValidation:rule="has(self.spec.hashOn) ? has(self.spec.algorithm) && (self.spec.algorithm == \"consistent-hashing\" || self.spec.algorithm == \"sticky-sessions\") : true", message="spec.algorithm must be set to either 'consistent-hashing' or 'sticky-sessions' when spec.hashOn is set." +kubebuilder:validation:XValidation:rule="has(self.spec.hashOnFallback) ? [has(self.spec.hashOnFallback.input), has(self.spec.hashOnFallback.header), has(self.spec.hashOnFallback.uriCapture), has(self.spec.hashOnFallback.queryArg)].filter(fieldSet, fieldSet == true).size() <= 1 : true", message="Only one of spec.hashOnFallback.(input|header|uriCapture|queryArg) can be set." +kubebuilder:validation:XValidation:rule="has(self.spec.hashOnFallback) ? has(self.spec.algorithm) && self.spec.algorithm == \"consistent-hashing\" : true", message="spec.algorithm must be set to \"consistent-hashing\" when spec.hashOnFallback is set." +kubebuilder:validation:XValidation:rule="has(self.spec.hashOn) && has(self.spec.hashOn.cookie) ? !has(self.spec.hashOnFallback) : true", message="spec.hashOnFallback must not be set when spec.hashOn.cookie is set." +kubebuilder:validation:XValidation:rule="has(self.spec.healthchecks) && has(self.spec.healthchecks.passive) && has(self.spec.healthchecks.passive.healthy) ? !has(self.spec.healthchecks.passive.healthy.interval) : true", message="spec.healthchecks.passive.healthy.interval must not be set." +kubebuilder:validation:XValidation:rule="has(self.spec.healthchecks) && has(self.spec.healthchecks.passive) && has(self.spec.healthchecks.passive.unhealthy) ? !has(self.spec.healthchecks.passive.unhealthy.interval) : true", message="spec.healthchecks.passive.unhealthy.interval must not be set." +kubebuilder:validation:XValidation:rule="has(self.spec.stickySessions) ? (has(self.spec.hashOn) && has(self.spec.hashOn.input) && self.spec.hashOn.input == 'none' && !has(self.spec.hashOn.cookie) && !has(self.spec.hashOn.cookiePath) && !has(self.spec.hashOn.header) && !has(self.spec.hashOn.uriCapture) && !has(self.spec.hashOn.queryArg)) : true", message="When spec.stickySessions is set, spec.hashOn.input must be set to 'none' (no other hash_on fields allowed)." +kubebuilder:validation:XValidation:rule="has(self.spec.stickySessions) ? has(self.spec.stickySessions.cookie) : true", message="spec.stickySessions.cookie is required when spec.stickySessions is set." +kubebuilder:validation:XValidation:rule="has(self.spec.stickySessions) ? (has(self.spec.algorithm) && self.spec.algorithm == \"sticky-sessions\") : true", message="spec.algorithm must be set to 'sticky-sessions' when spec.stickySessions is set." +kong:channels=gateway-operator

func (*KongUpstreamPolicy) DeepCopy

func (in *KongUpstreamPolicy) DeepCopy() *KongUpstreamPolicy

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

func (*KongUpstreamPolicy) DeepCopyInto

func (in *KongUpstreamPolicy) DeepCopyInto(out *KongUpstreamPolicy)

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

func (*KongUpstreamPolicy) DeepCopyObject

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

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

type KongUpstreamPolicyList

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

KongUpstreamPolicyList contains a list of KongUpstreamPolicy. +kubebuilder:object:root=true

func (*KongUpstreamPolicyList) DeepCopy

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

func (*KongUpstreamPolicyList) DeepCopyInto

func (in *KongUpstreamPolicyList) DeepCopyInto(out *KongUpstreamPolicyList)

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

func (*KongUpstreamPolicyList) DeepCopyObject

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

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

type KongUpstreamPolicySpec

type KongUpstreamPolicySpec struct {
	// Algorithm is the load balancing algorithm to use.
	// Accepted values are: "round-robin", "consistent-hashing", "least-connections", "latency", "sticky-sessions"
	// +kubebuilder:validation:Enum=round-robin;consistent-hashing;least-connections;latency;sticky-sessions
	Algorithm *string `json:"algorithm,omitempty"`

	// Slots is the number of slots in the load balancer algorithm.
	// If not set, the default value in Kong for the algorithm is used.
	// +kubebuilder:validation:Minimum=10
	// +kubebuilder:validation:Maximum=65536
	Slots *int `json:"slots,omitempty"`

	// HashOn defines how to calculate hash for consistent-hashing or sticky-sessions load balancing algorithm.
	// Algorithm must be set to "consistent-hashing" or "sticky-sessions" for this field to have effect.
	HashOn *KongUpstreamHash `json:"hashOn,omitempty"`

	// HashOnFallback defines how to calculate hash for consistent-hashing load balancing algorithm if the primary hash
	// function fails.
	// Algorithm must be set to "consistent-hashing" for this field to have effect.
	HashOnFallback *KongUpstreamHash `json:"hashOnFallback,omitempty"`

	// Healthchecks defines the health check configurations in Kong.
	Healthchecks *KongUpstreamHealthcheck `json:"healthchecks,omitempty"`

	// StickySessions defines the sticky session configuration for the upstream.
	// When enabled, clients will be routed to the same backend target based on a cookie.
	// This requires Kong Enterprise Gateway and setting `hash_on` to `none`.
	//
	// +optional
	StickySessions *KongUpstreamStickySessions `json:"stickySessions,omitempty"`
}

KongUpstreamPolicySpec contains the specification for KongUpstreamPolicy.

func (*KongUpstreamPolicySpec) DeepCopy

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

func (*KongUpstreamPolicySpec) DeepCopyInto

func (in *KongUpstreamPolicySpec) DeepCopyInto(out *KongUpstreamPolicySpec)

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

type KongUpstreamStickySessions

type KongUpstreamStickySessions struct {
	// Cookie is the name of the cookie to use for sticky sessions.
	// Kong will generate this cookie if it doesn't exist in the request.
	//
	// +required
	// +kubebuilder:validation:MinLength=1
	Cookie string `json:"cookie"`

	// CookiePath is the path to set in the cookie.
	//
	// +optional
	// +kubebuilder:default="/"
	CookiePath *string `json:"cookiePath,omitempty"`
}

KongUpstreamStickySessions defines the sticky session configuration for Kong upstream. Sticky sessions ensure that requests from the same client are routed to the same backend target. This is achieved using cookies and requires Kong Enterprise Gateway.

func (*KongUpstreamStickySessions) DeepCopy

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

func (*KongUpstreamStickySessions) DeepCopyInto

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