gateway

package
v1.11.10 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	K8S_CORE_GROUP       = ""
	K8S_NETWORKING_GROUP = networkingv1.GroupName
	K8S_GATEWAY_GROUP    = v1beta1.GroupName
	K8S_TCPROUTE_KIND    = "TCPRoute"
	K8S_SERVICE_KIND     = "Service"
)

Gateway management

View Source
const (
	GatewayConditionReady           = "Ready"
	GatewayReasonReady              = "Ready"
	GatewayReasonListenersNotValid  = "ListenersNotValid"
	GatewayReasonListenersNotReady  = "ListenersNotReady"
	GatewayReasonAddressNotAssigned = "AddressNotAssigned"

	ListenerConditionConflicted    = "Conflicted"
	ListenerReasonHostnameConflict = "HostnameConflict"
	ListenerReasonProtocolConflict = "ProtocolConflict"
	ListenerReasonNoConflicts      = "NoConflicts"

	ListenerConditionReady = "Ready"
	ListenerReasonReady    = "Ready"
	ListenerReasonInvalid  = "Invalid"
	ListenerReasonPending  = "Pending"

	ListenerConditionDetached         = "Detached"
	ListenerReasonPortUnavailable     = "PortUnavailable"
	ListenerReasonUnsupportedProtocol = "UnsupportedProtocol"
	ListenerReasonUnsupportedAddress  = "UnsupportedAddress"
	ListenerReasonAttached            = "Attached"

	ListenerConditionResolvedRefs       = "ResolvedRefs"
	ListenerReasonResolvedRefs          = "ResolvedRefs"
	ListenerReasonInvalidCertificateRef = "InvalidCertificateRef"
	ListenerReasonInvalidRouteKinds     = "InvalidRouteKinds"
	ListenerReasonRefNotPermitted       = "RefNotPermitted"

	GatewayClassConditionStatusAccepted = "Accepted"
	GatewayClassReasonAccepted          = "Accepted"
	GatewayClassReasonInvalidParameters = "InvalidParameters"
	GatewayClassReasonWaiting           = "Waiting"

	RouteConditionAccepted                = "Accepted"
	RouteReasonAccepted                   = "Accepted"
	RouteReasonNotAllowedByListeners      = "NotAllowedByListeners"
	RouteReasonNoMatchingListenerHostname = "NoMatchingListenerHostname"
	RouteReasonUnsupportedValue           = "UnsupportedValue"

	RouteConditionResolvedRefs = "ResolvedRefs"
	RouteReasonResolvedRefs    = "ResolvedRefs"
	RouteReasonRefNotPermitted = "RefNotPermitted"
	RouteReasonInvalidKind     = "InvalidKind"
	RouteReasonBackendNotFound = "BackendNotFound"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type GatewayManager

type GatewayManager interface {
	ManageGateway()
	SetGatewayAPIInstalled(bool)
}

func New

func New(k8sStore store.K8s,
	haproxyClient api.HAProxyClient,
	osArgs utils.OSArgs,
	k8sRestClient client.Client,
) GatewayManager

type GatewayManagerImpl

type GatewayManagerImpl struct {
	// contains filtered or unexported fields
}

func (GatewayManagerImpl) ManageGateway

func (gm GatewayManagerImpl) ManageGateway()

func (*GatewayManagerImpl) SetGatewayAPIInstalled added in v1.10.3

func (gm *GatewayManagerImpl) SetGatewayAPIInstalled(gatewayAPIInstalled bool)

type RouteGroupKinds

type RouteGroupKinds []store.RouteGroupKind

type RouteStatusManager

type RouteStatusManager interface {
	SetRouteReasonInvalidKind(string)
	SetRouteReasonBackendNotFound(string)
	SetRouteReasonRefNotPermitted(string)
	SetRouteReasonNotAllowedByListeners(string, store.ParentRef)
}

type StatusManager

type StatusManager interface {
	ProcessStatuses()
	PrepareGatewayStatus(store.Gateway)
	PrepareTCPRouteStatusRecord(store.TCPRoute)
	PrepareListenerStatus(store.Listener)
	SetListenerReasonUnsupportedProtocol(string)
	SetListenerReasonInvalidRouteKinds(string, []store.RouteGroupKind)
	RouteStatusManager
	SetGatewayClassConditionStatusAccepted(store.GatewayClass)
	AddManagedParentRef(parentRef store.ParentRef)
	IncrementRouteForListener(store.Listener)
}

func NewStatusManager

func NewStatusManager(k8sRestClient client.Client, gatewayControllerName string) StatusManager

NewStatusManager creates the default implementation for status management with gateway controller.

type StatusManagerImpl

type StatusManagerImpl struct {
	// contains filtered or unexported fields
}

func (*StatusManagerImpl) AddManagedParentRef

func (statusMgr *StatusManagerImpl) AddManagedParentRef(parentRef store.ParentRef)

AddManagedParentRef adds the parentref inside a new parentrefStatusRecord for the current tcp route.

func (*StatusManagerImpl) IncrementRouteForListener

func (statusMgr *StatusManagerImpl) IncrementRouteForListener(listener store.Listener)

IncrementRouteForListener incremenents the counter of attached routes to the provided listener.

func (*StatusManagerImpl) PrepareGatewayStatus

func (statusMgr *StatusManagerImpl) PrepareGatewayStatus(gateway store.Gateway)

PrepareGatewayStatus sets the gateway status record for a gateway. Every upcoming status information about a gateway provided by the gateway controller will be set into this record.

func (*StatusManagerImpl) PrepareListenerStatus

func (statusMgr *StatusManagerImpl) PrepareListenerStatus(listener store.Listener)

PrepareListenerStatus sets the listener status record for a listener. Every upcoming status information about a listener provided by the gateway controller will be set into this record.

func (*StatusManagerImpl) PrepareTCPRouteStatusRecord

func (statusMgr *StatusManagerImpl) PrepareTCPRouteStatusRecord(tcproute store.TCPRoute)

PrepareTCPRouteStatusRecord sets the tcproute status record for a tcproute. Every upcoming status information about a tcproute provided by the gateway controller will be set into this record.

func (*StatusManagerImpl) ProcessStatuses

func (statusMgr *StatusManagerImpl) ProcessStatuses()

ProcessStatuses goes over all status records to update their counterparts in k8s with the corresponding resource.

func (*StatusManagerImpl) SetGatewayClassConditionStatusAccepted

func (statusMgr *StatusManagerImpl) SetGatewayClassConditionStatusAccepted(gwClass store.GatewayClass)

SetGatewayClassConditionStatusAccepted adds the provided gatewayclass to the list of accepted gatewayclasses.

func (*StatusManagerImpl) SetListenerReasonInvalidRouteKinds

func (statusMgr *StatusManagerImpl) SetListenerReasonInvalidRouteKinds(msg string, validRGK []store.RouteGroupKind)

SetListenerReasonInvalidRouteKinds sets the msg and the reason ListenerReasonInvalidRouteKinds for the current listener pushed by PrepareListenerStatus.

func (*StatusManagerImpl) SetListenerReasonUnsupportedProtocol

func (statusMgr *StatusManagerImpl) SetListenerReasonUnsupportedProtocol(msg string)

SetListenerReasonUnsupportedProtocol sets the msg and the reason ListenerReasonUnsupportedProtocol for the current listener pushed by PrepareListenerStatus.

func (*StatusManagerImpl) SetRouteReasonBackendNotFound

func (statusMgr *StatusManagerImpl) SetRouteReasonBackendNotFound(msg string)

SetRouteReasonBackendNotFound sets the msg and the reason RouteReasonBackendNotFound for the current tcp route pushed by PrepareTCPRouteStatus.

func (*StatusManagerImpl) SetRouteReasonInvalidKind

func (statusMgr *StatusManagerImpl) SetRouteReasonInvalidKind(msg string)

SetRouteReasonBackendNotFound sets the msg and the reason RouteReasonInvalidKind for the current tcp route pushed by PrepareTCPRouteStatus.

func (*StatusManagerImpl) SetRouteReasonNotAllowedByListeners

func (statusMgr *StatusManagerImpl) SetRouteReasonNotAllowedByListeners(msg string, parentRef store.ParentRef)

SetRouteReasonBackendNotFound sets the msg and the reason RouteReasonNotAllowedByListeners for the current tcp route pushed by PrepareTCPRouteStatus.

func (*StatusManagerImpl) SetRouteReasonRefNotPermitted

func (statusMgr *StatusManagerImpl) SetRouteReasonRefNotPermitted(msg string)

SetRouteReasonBackendNotFound sets the msg and the reason RouteReasonRefNotPermitted for the current tcp route pushed by PrepareTCPRouteStatus.

func (*StatusManagerImpl) UpdateStatusGatewayclasses

func (statusMgr *StatusManagerImpl) UpdateStatusGatewayclasses(gatewayclasses []store.GatewayClass)

UpdateStatusGatewayclasses is responsible of updating the statuses of the accepted gateway classes.

func (*StatusManagerImpl) UpdateStatusGateways

func (statusMgr *StatusManagerImpl) UpdateStatusGateways(gatewayStatusRecords []gatewayStatusRecord, numRoutesByListenerByGateway, previousNumRoutesByListenerByGateway map[string]map[string]int32)

UpdateStatusGateways is responsible of updating the statuses of the gateways. To be able to determine if a status update is necessary because of the number of route attached has changed by attachment or detachment. This is mandatory because an unmodified gateway can have its status to be updated because of changes from tcp routes in term of attachment.

func (*StatusManagerImpl) UpdateStatusTCPRoutes

func (statusMgr *StatusManagerImpl) UpdateStatusTCPRoutes(routesStatusRecords []routeStatusRecord)

UpdateStatusTCPRoutes is responsible of updating the statuses of the tcp routes.

Jump to

Keyboard shortcuts

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