reconciler

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2022 License: MPL-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// GatewayClassConditionAccepted - This condition indicates whether the
	// GatewayClass has been accepted by the controller requested in the
	// spec.controller field.
	//
	// This condition defaults to Unknown, and MUST be set by a controller when it
	// sees a GatewayClass using its controller string. The status of this condition
	// MUST be set to True if the controller will support provisioning Gateways
	// using this class. Otherwise, this status MUST be set to False. If the status
	// is set to False, the controller SHOULD set a Message and Reason as an
	// explanation.
	//
	// [spec]
	GatewayClassConditionAccepted = "Accepted"
	// GatewayClassConditionReasonAccepted - This reason is used with the
	// “Accepted” condition when the condition is true.
	//
	// [spec]
	GatewayClassConditionReasonAccepted = "Accepted"
	// GatewayClassConditionReasonInvalidParameters - This reason is used with the
	// “Accepted” condition when the GatewayClass was not accepted because the
	// parametersRef field was invalid, with more detail in the message.
	//
	// [spec]
	GatewayClassConditionReasonInvalidParameters = "InvalidParameters"
	// GatewayClassConditionReasonWaiting - This reason is used with the
	// “Accepted” condition when the requested controller has not yet made a
	// decision about whether to admit the GatewayClass. It is the default Reason on
	// a new GatewayClass.
	//
	// [spec]
	GatewayClassConditionReasonWaiting = "Waiting"
)
View Source
const (
	// GatewayConditionReady - This condition is true when the Gateway is expected
	// to be able to serve traffic. Note that this does not indicate that the
	// Gateway configuration is current or even complete (e.g. the controller may
	// still not have reconciled the latest version, or some parts of the
	// configuration could be missing).
	//
	// If both the “ListenersNotValid” and “ListenersNotReady” reasons are
	// true, the Gateway controller should prefer the “ListenersNotValid”
	// reason.
	//
	// [spec]
	GatewayConditionReady = "Ready"
	// GatewayConditionReasonReady - This reason is used with the “Ready”
	// condition when the condition is true.
	//
	// [spec]
	GatewayConditionReasonReady = "Ready"
	// GatewayConditionReasonListenersNotValid - This reason is used with the
	// “Ready” condition when one or more Listeners have an invalid or
	// unsupported configuration and cannot be configured on the Gateway.
	//
	// [spec]
	GatewayConditionReasonListenersNotValid = "ListenersNotValid"
	// GatewayConditionReasonListenersNotReady - This reason is used with the
	// “Ready” condition when one or more Listeners are not ready to serve
	// traffic.
	//
	// [spec]
	GatewayConditionReasonListenersNotReady = "ListenersNotReady"
	// GatewayConditionReasonAddressNotAssigned - This reason is used with the
	// “Ready” condition when none of the requested addresses have been assigned
	// to the Gateway. This reason can be used to express a range of circumstances,
	// including (but not limited to) IPAM address exhaustion, invalid or
	// unsupported address requests, or a named address not being found.
	//
	// [spec]
	GatewayConditionReasonAddressNotAssigned = "AddressNotAssigned"
)
View Source
const (
	// GatewayConditionScheduled - This condition is true when the controller
	// managing the Gateway has scheduled the Gateway to the underlying network
	// infrastructure.
	//
	// [spec]
	GatewayConditionScheduled = "Scheduled"
	// GatewayConditionReasonScheduled - This reason is used with the
	// “Scheduled” condition when the condition is true.
	//
	// [spec]
	GatewayConditionReasonScheduled = "Scheduled"
	// GatewayConditionReasonNotReconciled - This reason is used with the
	// “Scheduled” condition when no controller has reconciled the Gateway.
	//
	// [spec]
	GatewayConditionReasonNotReconciled = "NotReconciled"
	// GatewayConditionReasonPodFailed - This reason is used when the underlying pod
	// on the gateway has failed.
	//
	// [custom]
	GatewayConditionReasonPodFailed = "PodFailed"
	// GatewayConditionReasonUnknown - This reason is used when the underlying pod
	// has an unhandled pod status.
	//
	// [custom]
	GatewayConditionReasonUnknown = "Unknown"
	// GatewayConditionReasonNoResources - This reason is used with the
	// “Scheduled” condition when the Gateway is not scheduled because
	// insufficient infrastructure resources are available.
	//
	// [spec]
	GatewayConditionReasonNoResources = "NoResources"
)
View Source
const (
	// GatewayConditionInSync - This condition is true when the Gateway has
	// successfully synced externally.
	//
	// [spec]
	GatewayConditionInSync = "InSync"
	// GatewayConditionReasonInSync - This reason is used with the “InSync”
	// condition when the condition is true.
	//
	// [spec]
	GatewayConditionReasonInSync = "InSync"
	// GatewayConditionReasonSyncError - This reason is used with the "InSync"
	// condition when there has been an error encountered synchronizing the Gateway.
	//
	// [spec]
	GatewayConditionReasonSyncError = "SyncError"
)
View Source
const (
	// RouteConditionAccepted - This condition indicates whether the route has been
	// accepted or rejected by a Gateway, and why.
	//
	// [spec]
	RouteConditionAccepted = "Accepted"
	// RouteConditionReasonAccepted - This reason is used with the "Accepted"
	// condition when the condition is True.
	//
	// [custom]
	RouteConditionReasonAccepted = "Accepted"
	// RouteConditionReasonInvalidRouteKind - This reason is used when a Route is
	// rejected from binding to a Listener because it does not match a Listener's
	// allowed route kinds.
	//
	// [custom]
	RouteConditionReasonInvalidRouteKind = "InvalidRouteKind"
	// RouteConditionReasonListenerNamespacePolicy - This reason is used when a
	// Route is rejected from binding to a Gateway because it does not match a
	// Listener's namespace attachment policy.
	//
	// [custom]
	RouteConditionReasonListenerNamespacePolicy = "ListenerNamespacePolicy"
	// RouteConditionReasonListenerHostnameMismatch - This reason is used when a
	// Route is rejected from binding to a Listener becasue it does not match a
	// Listener's hostname.
	//
	// [custom]
	RouteConditionReasonListenerHostnameMismatch = "ListenerHostnameMismatch"
	// RouteConditionReasonBindError - This reason is used when there is a generic
	// binding error for a Route.
	//
	// [custom]
	RouteConditionReasonBindError = "BindError"
)
View Source
const (
	// RouteConditionResolvedRefs - This condition indicates whether the controller
	// was able to resolve all the object references for the Route.
	//
	// [spec]
	RouteConditionResolvedRefs = "ResolvedRefs"
	// RouteConditionReasonResolvedRefs - This reason is used with the
	// "ResolvedRefs" condition when the condition is True.
	//
	// [custom]
	RouteConditionReasonResolvedRefs = "ResolvedRefs"
	// RouteConditionReasonErrors - This reason is used when multiple resolution
	// errors occur of varying types. See the condition message for more details.
	//
	// [custom]
	RouteConditionReasonErrors = "Errors"
	// RouteConditionReasonServiceNotFound - This reason is used when a Route
	// references Kubernetes services that the controller cannot resolve.
	//
	// [custom]
	RouteConditionReasonServiceNotFound = "ServiceNotFound"
	// RouteConditionReasonConsulServiceNotFound - This reason is used when a Route
	// references services that the controller cannot resolve as services inside of
	// Consul.
	//
	// [custom]
	RouteConditionReasonConsulServiceNotFound = "ConsulServiceNotFound"
)
View Source
const (
	// ListenerConditionConflicted - This condition indicates that the controller
	// was unable to resolve conflicting specification requirements for this
	// Listener. If a Listener is conflicted, its network port should not be
	// configured on any network elements.
	//
	// [spec]
	ListenerConditionConflicted = "Conflicted"
	// ListenerConditionReasonNoConflicts - This reason is used with the
	// “Conflicted” condition when the condition is False.
	//
	// [spec]
	ListenerConditionReasonNoConflicts = "NoConflicts"
	// ListenerConditionReasonHostnameConflict - This reason is used with the
	// “Conflicted” condition when the Listener conflicts with hostnames in
	// other Listeners. For example, this reason would be used when multiple
	// Listeners on the same port use example.com in the hostname field.
	//
	// [spec]
	ListenerConditionReasonHostnameConflict = "HostnameConflict"
	// ListenerConditionReasonProtocolConflict - This reason is used with the
	// “Conflicted” condition when multiple Listeners are specified with the
	// same Listener port number, but have conflicting protocol specifications.
	//
	// [spec]
	ListenerConditionReasonProtocolConflict = "ProtocolConflict"
	// ListenerConditionReasonRouteConflict - This reason is used with the
	// “Conflicted” condition when the route resources selected for this
	// Listener conflict with other specified properties of the Listener (e.g.
	// Protocol). For example, a Listener that specifies “UDP” as the protocol
	// but a route selector that resolves “TCPRoute” objects.
	//
	// [spec]
	ListenerConditionReasonRouteConflict = "RouteConflict"
)
View Source
const (
	// ListenerConditionDetached - This condition indicates that, even though the
	// listener is syntactically and semantically valid, the controller is not able
	// to configure it on the underlying Gateway infrastructure.
	//
	// A Listener is specified as a logical requirement, but needs to be configured
	// on a network endpoint (i.e. address and port) by a controller. The controller
	// may be unable to attach the Listener if it specifies an unsupported
	// requirement, or prerequisite resources are not available.
	//
	// [spec]
	ListenerConditionDetached = "Detached"
	// ListenerConditionReasonAttached - This reason is used with the “Detached”
	// condition when the condition is False.
	//
	// [spec]
	ListenerConditionReasonAttached = "Attached"
	// ListenerConditionReasonPortUnavailable - This reason is used with the
	// “Detached” condition when the Listener requests a port that cannot be
	// used on the Gateway. This reason could be used in a number of instances,
	// including:
	//
	// - The port is already in use.
	//
	// - The port is not supported by the implementation.
	//
	// [spec]
	ListenerConditionReasonPortUnavailable = "PortUnavailable"
	// ListenerConditionReasonUnsupportedExtension - This reason is used with the
	// “Detached” condition when the controller detects that an
	// implementation-specific Listener extension is being requested, but is not
	// able to support the extension.
	//
	// [spec]
	ListenerConditionReasonUnsupportedExtension = "UnsupportedExtension"
	// ListenerConditionReasonUnsupportedProtocol - This reason is used with the
	// “Detached” condition when the Listener could not be attached to be
	// Gateway because its protocol type is not supported.
	//
	// [spec]
	ListenerConditionReasonUnsupportedProtocol = "UnsupportedProtocol"
	// ListenerConditionReasonUnsupportedAddress - This reason is used with the
	// “Detached” condition when the Listener could not be attached to the
	// Gateway because the requested address is not supported. This reason could be
	// used in a number of instances, including:
	//
	// - The address is already in use.
	//
	// - The type of address is not supported by the implementation.
	//
	// [spec]
	ListenerConditionReasonUnsupportedAddress = "UnsupportedAddress"
)
View Source
const (
	// ListenerConditionReady - This condition indicates whether the Listener has
	// been configured on the Gateway.
	//
	// [spec]
	ListenerConditionReady = "Ready"
	// ListenerConditionReasonReady - This reason is used with the “Ready”
	// condition when the condition is true.
	//
	// [spec]
	ListenerConditionReasonReady = "Ready"
	// ListenerConditionReasonInvalid - This reason is used with the “Ready”
	// condition when the Listener is syntactically or semantically invalid.
	//
	// [spec]
	ListenerConditionReasonInvalid = "Invalid"
	// ListenerConditionReasonPending - This reason is used with the “Ready”
	// condition when the Listener is not yet not online and ready to accept client
	// traffic.
	//
	// [spec]
	ListenerConditionReasonPending = "Pending"
)
View Source
const (
	// ListenerConditionResolvedRefs - This condition indicates whether the
	// controller was able to resolve all the object references for the Listener.
	//
	// [spec]
	ListenerConditionResolvedRefs = "ResolvedRefs"
	// ListenerConditionReasonResolvedRefs - This reason is used with the
	// “ResolvedRefs” condition when the condition is true.
	//
	// [spec]
	ListenerConditionReasonResolvedRefs = "ResolvedRefs"
	// ListenerConditionReasonInvalidCertificateRef - This reason is used with the
	// “ResolvedRefs” condition when the Listener has a TLS configuration with
	// at least one TLS CertificateRef that is invalid or cannot be resolved.
	//
	// [spec]
	ListenerConditionReasonInvalidCertificateRef = "InvalidCertificateRef"
	// ListenerConditionReasonInvalidRouteKinds - This reason is used with the
	// “ResolvedRefs” condition when an invalid or unsupported Route kind is
	// specified by the Listener.
	//
	// [spec]
	ListenerConditionReasonInvalidRouteKinds = "InvalidRouteKinds"
	// ListenerConditionReasonRefNotPermitted - This reason is used with the
	// “ResolvedRefs” condition when one of the Listener’s Routes has a
	// BackendRef to an object in another namespace, where the object in the other
	// namespace does not have a ReferencePolicy explicitly allowing the reference.
	//
	// [spec]
	ListenerConditionReasonRefNotPermitted = "RefNotPermitted"
)
View Source
const (
	// NamespaceNameLabel represents that label added automatically to namespaces is newer Kubernetes clusters
	NamespaceNameLabel = "kubernetes.io/metadata.name"
)

Variables

This section is empty.

Functions

func HTTPRouteID

func HTTPRouteID(namespacedName types.NamespacedName) string

func TCPRouteID

func TCPRouteID(namespacedName types.NamespacedName) string

func TLSRouteID

func TLSRouteID(namespacedName types.NamespacedName) string

func UDPRouteID

func UDPRouteID(namespacedName types.NamespacedName) string

Types

type BindError

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

func NewBindErrorHostnameMismatch

func NewBindErrorHostnameMismatch(inner string) BindError

func NewBindErrorListenerNamespacePolicy

func NewBindErrorListenerNamespacePolicy(inner string) BindError

func NewBindErrorRouteInvalid

func NewBindErrorRouteInvalid(inner string) BindError

func NewBindErrorRouteKind

func NewBindErrorRouteKind(inner string) BindError

func (BindError) Error

func (r BindError) Error() string

func (BindError) Kind

func (r BindError) Kind() BindErrorType

type BindErrorType

type BindErrorType int
const (
	BindErrorTypeRouteKind BindErrorType = iota
	BindErrorTypeListenerNamespacePolicy
	BindErrorTypeHostnameMismatch
	BindErrorTypeRouteInvalid
)

type CertificateResolutionError

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

func NewCertificateResolutionErrorNotFound

func NewCertificateResolutionErrorNotFound(inner string) CertificateResolutionError

func NewCertificateResolutionErrorUnsupported

func NewCertificateResolutionErrorUnsupported(inner string) CertificateResolutionError

func (CertificateResolutionError) Error

func (CertificateResolutionError) Kind

type CertificateResolutionErrorType

type CertificateResolutionErrorType int
const (
	CertificateResolutionErrorTypeNotFound CertificateResolutionErrorType = iota
	CertificateResolutionErrorTypeUnsupported
)

type GatewayClassAcceptedStatus

type GatewayClassAcceptedStatus struct {
	// This reason is used with the “Accepted” condition when the GatewayClass
	// was not accepted because the parametersRef field was invalid, with more
	// detail in the message.
	//
	// [spec]
	InvalidParameters error
	// This reason is used with the “Accepted” condition when the requested
	// controller has not yet made a decision about whether to admit the
	// GatewayClass. It is the default Reason on a new GatewayClass.
	//
	// [spec]
	Waiting error
}

GatewayClassAcceptedStatus - This condition indicates whether the GatewayClass has been accepted by the controller requested in the spec.controller field.

This condition defaults to Unknown, and MUST be set by a controller when it sees a GatewayClass using its controller string. The status of this condition MUST be set to True if the controller will support provisioning Gateways using this class. Otherwise, this status MUST be set to False. If the status is set to False, the controller SHOULD set a Message and Reason as an explanation.

[spec]

func (GatewayClassAcceptedStatus) Condition

func (s GatewayClassAcceptedStatus) Condition(generation int64) meta.Condition

Condition returns the status condition of the GatewayClassAcceptedStatus based off of the underlying errors that are set.

func (GatewayClassAcceptedStatus) HasError

func (s GatewayClassAcceptedStatus) HasError() bool

HasError returns whether any of the GatewayClassAcceptedStatus errors are set.

type GatewayClassStatus

type GatewayClassStatus struct {
	// This condition indicates whether the GatewayClass has been accepted by the
	// controller requested in the spec.controller field.
	//
	// This condition defaults to Unknown, and MUST be set by a controller when it
	// sees a GatewayClass using its controller string. The status of this condition
	// MUST be set to True if the controller will support provisioning Gateways
	// using this class. Otherwise, this status MUST be set to False. If the status
	// is set to False, the controller SHOULD set a Message and Reason as an
	// explanation.
	Accepted GatewayClassAcceptedStatus
}

GatewayClassStatus - Defines the observed state of a GatewayClass.

func (GatewayClassStatus) Conditions

func (s GatewayClassStatus) Conditions(generation int64) []meta.Condition

Conditions returns the aggregated status conditions of the GatewayClassStatus.

type GatewayInSyncStatus

type GatewayInSyncStatus struct {
	// This reason is used with the "InSync" condition when there has been an error
	// encountered synchronizing the Gateway.
	//
	// [spec]
	SyncError error
}

GatewayInSyncStatus - This condition is true when the Gateway has successfully synced externally.

[spec]

func (GatewayInSyncStatus) Condition

func (s GatewayInSyncStatus) Condition(generation int64) meta.Condition

Condition returns the status condition of the GatewayInSyncStatus based off of the underlying errors that are set.

func (GatewayInSyncStatus) HasError

func (s GatewayInSyncStatus) HasError() bool

HasError returns whether any of the GatewayInSyncStatus errors are set.

type GatewayReadyStatus

type GatewayReadyStatus struct {
	// This reason is used with the “Ready” condition when one or more Listeners
	// have an invalid or unsupported configuration and cannot be configured on the
	// Gateway.
	//
	// [spec]
	ListenersNotValid error
	// This reason is used with the “Ready” condition when one or more Listeners
	// are not ready to serve traffic.
	//
	// [spec]
	ListenersNotReady error
	// This reason is used with the “Ready” condition when none of the requested
	// addresses have been assigned to the Gateway. This reason can be used to
	// express a range of circumstances, including (but not limited to) IPAM address
	// exhaustion, invalid or unsupported address requests, or a named address not
	// being found.
	//
	// [spec]
	AddressNotAssigned error
}

GatewayReadyStatus - This condition is true when the Gateway is expected to be able to serve traffic. Note that this does not indicate that the Gateway configuration is current or even complete (e.g. the controller may still not have reconciled the latest version, or some parts of the configuration could be missing).

If both the “ListenersNotValid” and “ListenersNotReady” reasons are true, the Gateway controller should prefer the “ListenersNotValid” reason.

[spec]

func (GatewayReadyStatus) Condition

func (s GatewayReadyStatus) Condition(generation int64) meta.Condition

Condition returns the status condition of the GatewayReadyStatus based off of the underlying errors that are set.

func (GatewayReadyStatus) HasError

func (s GatewayReadyStatus) HasError() bool

HasError returns whether any of the GatewayReadyStatus errors are set.

type GatewayReconcileManager

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

GatewayReconcileManager manages a GatewayReconciler for each Gateway and is the interface by which Consul operations should be invoked in a kubernetes controller.

func NewReconcileManager

func NewReconcileManager(config ManagerConfig) *GatewayReconcileManager

func (*GatewayReconcileManager) DeleteGateway

func (m *GatewayReconcileManager) DeleteGateway(ctx context.Context, name types.NamespacedName) error

func (*GatewayReconcileManager) DeleteGatewayClass

func (m *GatewayReconcileManager) DeleteGatewayClass(ctx context.Context, name string) error

func (*GatewayReconcileManager) DeleteHTTPRoute

func (m *GatewayReconcileManager) DeleteHTTPRoute(ctx context.Context, name types.NamespacedName) error

func (*GatewayReconcileManager) DeleteTCPRoute

func (m *GatewayReconcileManager) DeleteTCPRoute(ctx context.Context, name types.NamespacedName) error

func (*GatewayReconcileManager) DeleteTLSRoute

func (m *GatewayReconcileManager) DeleteTLSRoute(ctx context.Context, name types.NamespacedName) error

func (*GatewayReconcileManager) UpsertGateway

func (m *GatewayReconcileManager) UpsertGateway(ctx context.Context, g *gw.Gateway) error

func (*GatewayReconcileManager) UpsertGatewayClass

func (m *GatewayReconcileManager) UpsertGatewayClass(ctx context.Context, gc *gw.GatewayClass) error

func (*GatewayReconcileManager) UpsertHTTPRoute

func (m *GatewayReconcileManager) UpsertHTTPRoute(ctx context.Context, r Route) error

func (*GatewayReconcileManager) UpsertTCPRoute

func (m *GatewayReconcileManager) UpsertTCPRoute(ctx context.Context, r Route) error

func (*GatewayReconcileManager) UpsertTLSRoute

func (m *GatewayReconcileManager) UpsertTLSRoute(ctx context.Context, r Route) error

type GatewayScheduledStatus

type GatewayScheduledStatus struct {
	// This reason is used with the “Scheduled” condition when no controller has
	// reconciled the Gateway.
	//
	// [spec]
	NotReconciled error
	// This reason is used when the underlying pod on the gateway has failed.
	//
	// [custom]
	PodFailed error
	// This reason is used when the underlying pod has an unhandled pod status.
	//
	// [custom]
	Unknown error
	// This reason is used with the “Scheduled” condition when the Gateway is
	// not scheduled because insufficient infrastructure resources are available.
	//
	// [spec]
	NoResources error
}

GatewayScheduledStatus - This condition is true when the controller managing the Gateway has scheduled the Gateway to the underlying network infrastructure.

[spec]

func (GatewayScheduledStatus) Condition

func (s GatewayScheduledStatus) Condition(generation int64) meta.Condition

Condition returns the status condition of the GatewayScheduledStatus based off of the underlying errors that are set.

func (GatewayScheduledStatus) HasError

func (s GatewayScheduledStatus) HasError() bool

HasError returns whether any of the GatewayScheduledStatus errors are set.

type GatewayStatus

type GatewayStatus struct {
	// This condition is true when the Gateway is expected to be able to serve
	// traffic. Note that this does not indicate that the Gateway configuration is
	// current or even complete (e.g. the controller may still not have reconciled
	// the latest version, or some parts of the configuration could be missing).
	//
	// If both the “ListenersNotValid” and “ListenersNotReady” reasons are
	// true, the Gateway controller should prefer the “ListenersNotValid”
	// reason.
	Ready GatewayReadyStatus
	// This condition is true when the controller managing the Gateway has scheduled
	// the Gateway to the underlying network infrastructure.
	Scheduled GatewayScheduledStatus
	// This condition is true when the Gateway has successfully synced externally.
	InSync GatewayInSyncStatus
}

GatewayStatus - Defines the observed state of a Gateway.

func (GatewayStatus) Conditions

func (s GatewayStatus) Conditions(generation int64) []meta.Condition

Conditions returns the aggregated status conditions of the GatewayStatus.

type K8sGateway

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

func NewK8sGateway

func NewK8sGateway(gateway *gw.Gateway, config K8sGatewayConfig) *K8sGateway

func (*K8sGateway) Compare

func (g *K8sGateway) Compare(other store.Gateway) store.CompareResult

func (*K8sGateway) ID

func (g *K8sGateway) ID() core.GatewayID

func (*K8sGateway) Listeners

func (g *K8sGateway) Listeners() []store.Listener

func (*K8sGateway) Meta

func (g *K8sGateway) Meta() map[string]string

func (*K8sGateway) ShouldBind

func (g *K8sGateway) ShouldBind(route store.Route) bool

func (*K8sGateway) Status

func (g *K8sGateway) Status() gw.GatewayStatus

func (*K8sGateway) TrackSync

func (g *K8sGateway) TrackSync(ctx context.Context, sync func() (bool, error)) error

func (*K8sGateway) Validate

func (g *K8sGateway) Validate(ctx context.Context) error

type K8sGatewayClass

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

func NewK8sGatewayClass

func NewK8sGatewayClass(class *gw.GatewayClass, config K8sGatewayClassConfig) *K8sGatewayClass

func (*K8sGatewayClass) IsValid

func (c *K8sGatewayClass) IsValid() bool

func (*K8sGatewayClass) SyncStatus

func (c *K8sGatewayClass) SyncStatus(ctx context.Context) error

func (*K8sGatewayClass) Validate

func (c *K8sGatewayClass) Validate(ctx context.Context) error

type K8sGatewayClassConfig

type K8sGatewayClassConfig struct {
	Logger hclog.Logger
	Client gatewayclient.Client
}

type K8sGatewayClasses

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

func NewK8sGatewayClasses

func NewK8sGatewayClasses(logger hclog.Logger, client gatewayclient.Client) *K8sGatewayClasses

func (*K8sGatewayClasses) Delete

func (g *K8sGatewayClasses) Delete(name string)

func (*K8sGatewayClasses) GetConfig

func (*K8sGatewayClasses) Upsert

func (g *K8sGatewayClasses) Upsert(ctx context.Context, class *K8sGatewayClass) error

type K8sGatewayConfig

type K8sGatewayConfig struct {
	ConsulNamespace string
	ConsulCA        string
	SDSHost         string
	SDSPort         int
	Config          apigwv1alpha1.GatewayClassConfig
	Logger          hclog.Logger
	Client          gatewayclient.Client
}

type K8sListener

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

func NewK8sListener

func NewK8sListener(gateway *gw.Gateway, listener gw.Listener, config K8sListenerConfig) *K8sListener

func (*K8sListener) CanBind

func (l *K8sListener) CanBind(route store.Route) (bool, error)

CanBind returns whether a route can bind to a gateway, if the route can bind to a listener on the gateway the return value is nil, if not, an error specifying why the route cannot bind is returned.

func (*K8sListener) Config

func (l *K8sListener) Config() store.ListenerConfig

func (*K8sListener) ID

func (l *K8sListener) ID() string

func (*K8sListener) IsValid

func (l *K8sListener) IsValid() bool

func (*K8sListener) OnRouteAdded

func (l *K8sListener) OnRouteAdded(_ store.Route)

func (*K8sListener) OnRouteRemoved

func (l *K8sListener) OnRouteRemoved(_ string)

func (*K8sListener) Status

func (l *K8sListener) Status() gw.ListenerStatus

func (*K8sListener) Validate

func (l *K8sListener) Validate(ctx context.Context) error

type K8sListenerConfig

type K8sListenerConfig struct {
	ConsulNamespace string
	Logger          hclog.Logger
	Client          gatewayclient.Client
}

type K8sRoute

type K8sRoute struct {
	Route
	// contains filtered or unexported fields
}

func NewK8sRoute

func NewK8sRoute(route Route, config K8sRouteConfig) *K8sRoute

func (*K8sRoute) CommonRouteSpec

func (r *K8sRoute) CommonRouteSpec() gw.CommonRouteSpec

func (*K8sRoute) Compare

func (r *K8sRoute) Compare(other store.Route) store.CompareResult

func (*K8sRoute) FilterParentStatuses

func (r *K8sRoute) FilterParentStatuses() []gw.RouteParentStatus

func (*K8sRoute) ID

func (r *K8sRoute) ID() string

func (*K8sRoute) IsValid

func (r *K8sRoute) IsValid() bool

func (*K8sRoute) MatchesHostname

func (r *K8sRoute) MatchesHostname(hostname *gw.Hostname) bool

func (*K8sRoute) MergedStatus

func (r *K8sRoute) MergedStatus() gw.RouteStatus

func (*K8sRoute) NeedsStatusUpdate

func (r *K8sRoute) NeedsStatusUpdate() bool

func (*K8sRoute) OnBindFailed

func (r *K8sRoute) OnBindFailed(err error, gateway store.Gateway)

func (*K8sRoute) OnBound

func (r *K8sRoute) OnBound(gateway store.Gateway)

func (*K8sRoute) OnGatewayRemoved

func (r *K8sRoute) OnGatewayRemoved(gateway store.Gateway)

func (*K8sRoute) ParentStatuses

func (r *K8sRoute) ParentStatuses() []gw.RouteParentStatus

func (*K8sRoute) Parents

func (r *K8sRoute) Parents() []gw.ParentRef

func (*K8sRoute) Resolve

func (r *K8sRoute) Resolve(listener store.Listener) *core.ResolvedRoute

func (*K8sRoute) SetStatus

func (r *K8sRoute) SetStatus(updated gw.RouteStatus)

func (*K8sRoute) SyncStatus

func (r *K8sRoute) SyncStatus(ctx context.Context) error

func (*K8sRoute) Validate

func (r *K8sRoute) Validate(ctx context.Context) error

type K8sRouteConfig

type K8sRouteConfig struct {
	ControllerName string
	Logger         hclog.Logger
	Client         gatewayclient.Client
	Resolver       service.BackendResolver
}

type ListenerConflictedStatus

type ListenerConflictedStatus struct {
	// This reason is used with the “Conflicted” condition when the Listener
	// conflicts with hostnames in other Listeners. For example, this reason would
	// be used when multiple Listeners on the same port use example.com in the
	// hostname field.
	//
	// [spec]
	HostnameConflict error
	// This reason is used with the “Conflicted” condition when multiple
	// Listeners are specified with the same Listener port number, but have
	// conflicting protocol specifications.
	//
	// [spec]
	ProtocolConflict error
	// This reason is used with the “Conflicted” condition when the route
	// resources selected for this Listener conflict with other specified properties
	// of the Listener (e.g. Protocol). For example, a Listener that specifies
	// “UDP” as the protocol but a route selector that resolves “TCPRoute”
	// objects.
	//
	// [spec]
	RouteConflict error
}

ListenerConflictedStatus - This condition indicates that the controller was unable to resolve conflicting specification requirements for this Listener. If a Listener is conflicted, its network port should not be configured on any network elements.

[spec]

func (ListenerConflictedStatus) Condition

func (s ListenerConflictedStatus) Condition(generation int64) meta.Condition

Condition returns the status condition of the ListenerConflictedStatus based off of the underlying errors that are set.

func (ListenerConflictedStatus) HasError

func (s ListenerConflictedStatus) HasError() bool

HasError returns whether any of the ListenerConflictedStatus errors are set.

type ListenerDetachedStatus

type ListenerDetachedStatus struct {
	// This reason is used with the “Detached” condition when the Listener
	// requests a port that cannot be used on the Gateway. This reason could be used
	// in a number of instances, including:
	//
	// - The port is already in use.
	//
	// - The port is not supported by the implementation.
	//
	// [spec]
	PortUnavailable error
	// This reason is used with the “Detached” condition when the controller
	// detects that an implementation-specific Listener extension is being
	// requested, but is not able to support the extension.
	//
	// [spec]
	UnsupportedExtension error
	// This reason is used with the “Detached” condition when the Listener could
	// not be attached to be Gateway because its protocol type is not supported.
	//
	// [spec]
	UnsupportedProtocol error
	// This reason is used with the “Detached” condition when the Listener could
	// not be attached to the Gateway because the requested address is not
	// supported. This reason could be used in a number of instances, including:
	//
	// - The address is already in use.
	//
	// - The type of address is not supported by the implementation.
	//
	// [spec]
	UnsupportedAddress error
}

ListenerDetachedStatus - This condition indicates that, even though the listener is syntactically and semantically valid, the controller is not able to configure it on the underlying Gateway infrastructure.

A Listener is specified as a logical requirement, but needs to be configured on a network endpoint (i.e. address and port) by a controller. The controller may be unable to attach the Listener if it specifies an unsupported requirement, or prerequisite resources are not available.

[spec]

func (ListenerDetachedStatus) Condition

func (s ListenerDetachedStatus) Condition(generation int64) meta.Condition

Condition returns the status condition of the ListenerDetachedStatus based off of the underlying errors that are set.

func (ListenerDetachedStatus) HasError

func (s ListenerDetachedStatus) HasError() bool

HasError returns whether any of the ListenerDetachedStatus errors are set.

type ListenerReadyStatus

type ListenerReadyStatus struct {
	// This reason is used with the “Ready” condition when the Listener is
	// syntactically or semantically invalid.
	//
	// [spec]
	Invalid error
	// This reason is used with the “Ready” condition when the Listener is not
	// yet not online and ready to accept client traffic.
	//
	// [spec]
	Pending error
}

ListenerReadyStatus - This condition indicates whether the Listener has been configured on the Gateway.

[spec]

func (ListenerReadyStatus) Condition

func (s ListenerReadyStatus) Condition(generation int64) meta.Condition

Condition returns the status condition of the ListenerReadyStatus based off of the underlying errors that are set.

func (ListenerReadyStatus) HasError

func (s ListenerReadyStatus) HasError() bool

HasError returns whether any of the ListenerReadyStatus errors are set.

type ListenerResolvedRefsStatus

type ListenerResolvedRefsStatus struct {
	// This reason is used with the “ResolvedRefs” condition when the Listener
	// has a TLS configuration with at least one TLS CertificateRef that is invalid
	// or cannot be resolved.
	//
	// [spec]
	InvalidCertificateRef error
	// This reason is used with the “ResolvedRefs” condition when an invalid or
	// unsupported Route kind is specified by the Listener.
	//
	// [spec]
	InvalidRouteKinds error
	// This reason is used with the “ResolvedRefs” condition when one of the
	// Listener’s Routes has a BackendRef to an object in another namespace, where
	// the object in the other namespace does not have a ReferencePolicy explicitly
	// allowing the reference.
	//
	// [spec]
	RefNotPermitted error
}

ListenerResolvedRefsStatus - This condition indicates whether the controller was able to resolve all the object references for the Listener.

[spec]

func (ListenerResolvedRefsStatus) Condition

func (s ListenerResolvedRefsStatus) Condition(generation int64) meta.Condition

Condition returns the status condition of the ListenerResolvedRefsStatus based off of the underlying errors that are set.

func (ListenerResolvedRefsStatus) HasError

func (s ListenerResolvedRefsStatus) HasError() bool

HasError returns whether any of the ListenerResolvedRefsStatus errors are set.

type ListenerStatus

type ListenerStatus struct {
	// This condition indicates that the controller was unable to resolve
	// conflicting specification requirements for this Listener. If a Listener is
	// conflicted, its network port should not be configured on any network
	// elements.
	Conflicted ListenerConflictedStatus
	// This condition indicates that, even though the listener is syntactically and
	// semantically valid, the controller is not able to configure it on the
	// underlying Gateway infrastructure.
	//
	// A Listener is specified as a logical requirement, but needs to be configured
	// on a network endpoint (i.e. address and port) by a controller. The controller
	// may be unable to attach the Listener if it specifies an unsupported
	// requirement, or prerequisite resources are not available.
	Detached ListenerDetachedStatus
	// This condition indicates whether the Listener has been configured on the
	// Gateway.
	Ready ListenerReadyStatus
	// This condition indicates whether the controller was able to resolve all the
	// object references for the Listener.
	ResolvedRefs ListenerResolvedRefsStatus
}

ListenerStatus - The status associated with a Listener.

func (ListenerStatus) Conditions

func (s ListenerStatus) Conditions(generation int64) []meta.Condition

Conditions returns the aggregated status conditions of the ListenerStatus.

func (ListenerStatus) Valid

func (s ListenerStatus) Valid() bool

Valid returns whether all of the required conditions for the ListenerStatus are satisfied.

type ManagerConfig

type ManagerConfig struct {
	ControllerName        string
	Client                gatewayclient.Client
	Consul                *api.Client
	ConsulCA              string
	SDSHost               string
	SDSPort               int
	Store                 store.Store
	Logger                hclog.Logger
	ConsulNamespaceMapper common.ConsulNamespaceMapper
}

type ReconcileManager

type ReconcileManager interface {
	UpsertGatewayClass(ctx context.Context, gc *gw.GatewayClass) error
	UpsertGateway(ctx context.Context, g *gw.Gateway) error
	UpsertHTTPRoute(ctx context.Context, r Route) error
	UpsertTCPRoute(ctx context.Context, r Route) error
	UpsertTLSRoute(ctx context.Context, r Route) error
	DeleteGatewayClass(ctx context.Context, name string) error
	DeleteGateway(ctx context.Context, name types.NamespacedName) error
	DeleteHTTPRoute(ctx context.Context, name types.NamespacedName) error
	DeleteTCPRoute(ctx context.Context, name types.NamespacedName) error
	DeleteTLSRoute(ctx context.Context, name types.NamespacedName) error
}

type Route

type Route interface {
	client.Object
	schema.ObjectKind
}

all kubernetes routes implement the following two interfaces

type RouteAcceptedStatus

type RouteAcceptedStatus struct {
	// This reason is used when a Route is rejected from binding to a Listener
	// because it does not match a Listener's allowed route kinds.
	//
	// [custom]
	InvalidRouteKind error
	// This reason is used when a Route is rejected from binding to a Gateway
	// because it does not match a Listener's namespace attachment policy.
	//
	// [custom]
	ListenerNamespacePolicy error
	// This reason is used when a Route is rejected from binding to a Listener
	// becasue it does not match a Listener's hostname.
	//
	// [custom]
	ListenerHostnameMismatch error
	// This reason is used when there is a generic binding error for a Route.
	//
	// [custom]
	BindError error
}

RouteAcceptedStatus - This condition indicates whether the route has been accepted or rejected by a Gateway, and why.

[spec]

func (RouteAcceptedStatus) Condition

func (s RouteAcceptedStatus) Condition(generation int64) meta.Condition

Condition returns the status condition of the RouteAcceptedStatus based off of the underlying errors that are set.

type RouteResolvedRefsStatus

type RouteResolvedRefsStatus struct {
	// This reason is used when multiple resolution errors occur of varying types.
	// See the condition message for more details.
	//
	// [custom]
	Errors error
	// This reason is used when a Route references Kubernetes services that the
	// controller cannot resolve.
	//
	// [custom]
	ServiceNotFound error
	// This reason is used when a Route references services that the controller
	// cannot resolve as services inside of Consul.
	//
	// [custom]
	ConsulServiceNotFound error
}

RouteResolvedRefsStatus - This condition indicates whether the controller was able to resolve all the object references for the Route.

[spec]

func (RouteResolvedRefsStatus) Condition

func (s RouteResolvedRefsStatus) Condition(generation int64) meta.Condition

Condition returns the status condition of the RouteResolvedRefsStatus based off of the underlying errors that are set.

func (RouteResolvedRefsStatus) HasError

func (s RouteResolvedRefsStatus) HasError() bool

HasError returns whether any of the RouteResolvedRefsStatus errors are set.

type RouteStatus

type RouteStatus struct {
	// This condition indicates whether the route has been accepted or rejected by a
	// Gateway, and why.
	Accepted RouteAcceptedStatus
	// This condition indicates whether the controller was able to resolve all the
	// object references for the Route.
	ResolvedRefs RouteResolvedRefsStatus
}

RouteStatus - The status associated with a Route with respect to a given parent.

func (RouteStatus) Conditions

func (s RouteStatus) Conditions(generation int64) []meta.Condition

Conditions returns the aggregated status conditions of the RouteStatus.

Directories

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

Jump to

Keyboard shortcuts

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