controllers

package
v1.0.0-rc4 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2024 License: Apache-2.0 Imports: 70 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KuadrantAppName                = "kuadrant"
	PolicyAffectedConditionPattern = "kuadrant.io/%sAffected" // Policy kinds are expected to be named XPolicy
)
View Source
const (
	DNSRecordKind             = "DNSRecord"
	StateDNSPolicyAcceptedKey = "DNSPolicyValid"
	StateDNSPolicyErrorsKey   = "DNSPolicyErrors"

	PolicyConditionSubResourcesHealthy gatewayapiv1alpha2.PolicyConditionType   = "SubResourcesHealthy"
	PolicyReasonSubResourcesHealthy    gatewayapiv1alpha2.PolicyConditionReason = "SubResourcesHealthy"
)
View Source
const (
	LabelListenerReference = "kuadrant.io/listener-name"
)
View Source
const (
	ReadyConditionType string = "Ready"
)
View Source
const (
	TLSPolicyAcceptedKey = "TLSPolicyValid"
)
View Source
const (
	TopologyConfigMapName = "topology"
)

Variables

View Source
var (
	StateAuthPolicyValid                  = "AuthPolicyValid"
	StateEffectiveAuthPolicies            = "EffectiveAuthPolicies"
	StateModifiedAuthConfigs              = "ModifiedAuthConfigs"
	StateIstioAuthClustersModified        = "IstioAuthClustersModified"
	StateEnvoyGatewayAuthClustersModified = "EnvoyGatewayAuthClustersModified"

	ErrMissingAuthorino                  = fmt.Errorf("missing authorino object in the topology")
	ErrMissingStateEffectiveAuthPolicies = fmt.Errorf("missing auth effective policies stored in the reconciliation state")
)
View Source
var (
	AppLabelKey   = "app"
	AppLabelValue = KuadrantAppName
)
View Source
var (
	WASMFilterImageURL = env.GetString("RELATED_IMAGE_WASMSHIM", "oci://quay.io/kuadrant/wasm-shim:latest")

	StateIstioExtensionsModified        = "IstioExtensionsModified"
	StateEnvoyGatewayExtensionsModified = "EnvoyGatewayExtensionsModified"
)
View Source
var (
	DNSRecordResource  = kuadrantdnsv1alpha1.GroupVersion.WithResource("dnsrecords")
	DNSRecordGroupKind = schema.GroupKind{Group: kuadrantdnsv1alpha1.GroupVersion.Group, Kind: DNSRecordKind}
)
View Source
var (
	ErrNoRoutes    = fmt.Errorf("no routes attached to any gateway listeners")
	ErrNoAddresses = fmt.Errorf("no valid status addresses to use on gateway")
)
View Source
var (
	StateRateLimitPolicyValid                  = "RateLimitPolicyValid"
	StateEffectiveRateLimitPolicies            = "EffectiveRateLimitPolicies"
	StateLimitadorLimitsModified               = "LimitadorLimitsModified"
	StateIstioRateLimitClustersModified        = "IstioRateLimitClustersModified"
	StateEnvoyGatewayRateLimitClustersModified = "EnvoyGatewayRateLimitClustersModified"

	ErrMissingLimitador                       = fmt.Errorf("missing limitador object in the topology")
	ErrMissingLimitadorServiceInfo            = fmt.Errorf("missing limitador service info in the limitador object")
	ErrMissingStateEffectiveRateLimitPolicies = fmt.Errorf("missing rate limit effective policies stored in the reconciliation state")
)
View Source
var (
	CertManagerCertificatesResource  = certmanagerv1.SchemeGroupVersion.WithResource("certificates")
	CertManagerIssuersResource       = certmanagerv1.SchemeGroupVersion.WithResource("issuers")
	CertMangerClusterIssuersResource = certmanagerv1.SchemeGroupVersion.WithResource("clusterissuers")

	CertManagerCertificateKind   = schema.GroupKind{Group: certmanager.GroupName, Kind: certmanagerv1.CertificateKind}
	CertManagerIssuerKind        = schema.GroupKind{Group: certmanager.GroupName, Kind: certmanagerv1.IssuerKind}
	CertManagerClusterIssuerKind = schema.GroupKind{Group: certmanager.GroupName, Kind: certmanagerv1.ClusterIssuerKind}
)
View Source
var (
	ConfigMapGroupKind = schema.GroupKind{Group: corev1.GroupName, Kind: "ConfigMap"}
)
View Source
var (
	ConsolePluginImageURL = env.GetString("RELATED_IMAGE_CONSOLEPLUGIN", "quay.io/kuadrant/console-plugin:latest")
)
View Source
var ErrMissingKuadrant = fmt.Errorf("missing kuadrant object in topology")
View Source
var NegativePolarityConditions []string

Functions

func AuthClusterName

func AuthClusterName(gatewayName string) string

func AuthConfigNameForPath

func AuthConfigNameForPath(pathID string) string

func AuthObjectLabels

func AuthObjectLabels() labels.Set

func CommonLabels

func CommonLabels() map[string]string

func FindRouteParentStatusFunc

func FindRouteParentStatusFunc(route *gatewayapiv1.HTTPRoute, gatewayKey client.ObjectKey, controllerName gatewayapiv1.GatewayController) func(gatewayapiv1.RouteParentStatus) bool

func GetAuthorinoFromTopology

func GetAuthorinoFromTopology(topology *machinery.Topology) (*authorinooperatorv1beta1.Authorino, error)

func GetKuadrantFromTopology

func GetKuadrantFromTopology(topology *machinery.Topology) (*kuadrantv1beta1.Kuadrant, error)

func GetLimitadorFromTopology

func GetLimitadorFromTopology(topology *machinery.Topology) (*limitadorv1alpha1.Limitador, error)

func IsPolicyAccepted

func IsPolicyAccepted(ctx context.Context, p machinery.Policy, s *sync.Map) bool

func IsTLSPolicyValid

func IsTLSPolicyValid(ctx context.Context, s *sync.Map, policy *kuadrantv1.TLSPolicy) (bool, error)

func KuadrantManagedObjectLabels

func KuadrantManagedObjectLabels() labels.Set

func LimitNameToLimitadorIdentifier

func LimitNameToLimitadorIdentifier(rlpKey k8stypes.NamespacedName, uniqueLimitName string) string

func LimitsNamespaceFromRoute

func LimitsNamespaceFromRoute(route *gatewayapiv1.HTTPRoute) string

func LinkDNSPolicyToDNSRecord

func LinkDNSPolicyToDNSRecord(objs controller.Store) machinery.LinkFunc

func LinkListenerToCertificateFunc

func LinkListenerToCertificateFunc(objs controller.Store) machinery.LinkFunc

func LinkListenerToDNSRecord

func LinkListenerToDNSRecord(objs controller.Store) machinery.LinkFunc

func LinkTLSPolicyToClusterIssuerFunc

func LinkTLSPolicyToClusterIssuerFunc(objs controller.Store) machinery.LinkFunc

func LinkTLSPolicyToIssuerFunc

func LinkTLSPolicyToIssuerFunc(objs controller.Store) machinery.LinkFunc

func NewDNSWorkflow

func NewDNSWorkflow(client *dynamic.DynamicClient, scheme *runtime.Scheme) *controller.Workflow

func NewDataPlanePoliciesWorkflow

func NewDataPlanePoliciesWorkflow(client *dynamic.DynamicClient, isIstioInstalled, isEnvoyGatewayInstalled bool) *controller.Workflow

func NewPolicyMachineryController

func NewPolicyMachineryController(manager ctrlruntime.Manager, client *dynamic.DynamicClient, logger logr.Logger) *controller.Controller

func NewTLSWorkflow

func NewTLSWorkflow(client *dynamic.DynamicClient, scheme *runtime.Scheme, isCertManagerInstalled bool) *controller.Workflow

func PolicyAffectedCondition

func PolicyAffectedCondition(policyKind string, policies []machinery.Policy) metav1.Condition

func PolicyAffectedConditionType

func PolicyAffectedConditionType(policyKind string) string

func RateLimitClusterName

func RateLimitClusterName(gatewayName string) string

func RateLimitObjectLabels

func RateLimitObjectLabels() labels.Set

Types

type AuthConfigsReconciler

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

func (*AuthConfigsReconciler) Reconcile

func (r *AuthConfigsReconciler) Reconcile(ctx context.Context, _ []controller.ResourceEvent, topology *machinery.Topology, _ error, state *sync.Map) error

func (*AuthConfigsReconciler) Subscription

func (r *AuthConfigsReconciler) Subscription() controller.Subscription

AuthConfigsReconciler subscribes to events with potential to change Authorino AuthConfig custom resources

type AuthPolicyStatusUpdater

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

func (*AuthPolicyStatusUpdater) Subscription

AuthPolicyStatusUpdater reconciles to events with impact to change the status of AuthPolicy resources

func (*AuthPolicyStatusUpdater) UpdateStatus

func (r *AuthPolicyStatusUpdater) UpdateStatus(ctx context.Context, _ []controller.ResourceEvent, topology *machinery.Topology, _ error, state *sync.Map) error

type AuthPolicyValidator

type AuthPolicyValidator struct{}

func (*AuthPolicyValidator) Subscription

func (r *AuthPolicyValidator) Subscription() controller.Subscription

AuthPolicyValidator subscribes to events with potential to flip the validity of auth policies

func (*AuthPolicyValidator) Validate

func (r *AuthPolicyValidator) Validate(ctx context.Context, _ []controller.ResourceEvent, topology *machinery.Topology, _ error, state *sync.Map) error

type AuthorinoReconciler

type AuthorinoReconciler struct {
	Client *dynamic.DynamicClient
}

func NewAuthorinoReconciler

func NewAuthorinoReconciler(client *dynamic.DynamicClient) *AuthorinoReconciler

func (*AuthorinoReconciler) Reconcile

func (r *AuthorinoReconciler) Reconcile(ctx context.Context, _ []controller.ResourceEvent, topology *machinery.Topology, _ error, _ *sync.Map) error

func (*AuthorinoReconciler) Subscription

func (r *AuthorinoReconciler) Subscription() *controller.Subscription

type BootOptionsBuilder

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

func NewBootOptionsBuilder

func NewBootOptionsBuilder(manager ctrlruntime.Manager, client *dynamic.DynamicClient, logger logr.Logger) *BootOptionsBuilder

NewBootOptionsBuilder is used to return a list of controller.ControllerOption and a controller.ReconcileFunc that depend on if external dependent CRDs are installed at boot time

func (*BootOptionsBuilder) Reconciler

type CertTarget

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

type ConsolePluginReconciler

type ConsolePluginReconciler struct {
	*reconcilers.BaseReconciler
	// contains filtered or unexported fields
}

func NewConsolePluginReconciler

func NewConsolePluginReconciler(mgr ctrlruntime.Manager, namespace string) *ConsolePluginReconciler

func (*ConsolePluginReconciler) Run

func (*ConsolePluginReconciler) Subscription

func (r *ConsolePluginReconciler) Subscription() *controller.Subscription

type DNSPoliciesValidator

type DNSPoliciesValidator struct{}

func NewDNSPoliciesValidator

func NewDNSPoliciesValidator() *DNSPoliciesValidator

func (*DNSPoliciesValidator) Subscription

func (r *DNSPoliciesValidator) Subscription() controller.Subscription

type DNSPolicyStatusUpdater

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

func NewDNSPolicyStatusUpdater

func NewDNSPolicyStatusUpdater(client *dynamic.DynamicClient) *DNSPolicyStatusUpdater

func (*DNSPolicyStatusUpdater) Subscription

type EffectiveAuthPolicies

type EffectiveAuthPolicies map[string]EffectiveAuthPolicy

type EffectiveAuthPolicy

type EffectiveAuthPolicy struct {
	Path []machinery.Targetable
	Spec kuadrantv1.AuthPolicy
}

type EffectiveAuthPolicyReconciler

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

func (*EffectiveAuthPolicyReconciler) Reconcile

func (*EffectiveAuthPolicyReconciler) Subscription

EffectiveAuthPolicyReconciler subscribe to the same events as rate limit because they are used together to compose gateway extension resources

type EffectiveDNSPoliciesReconciler

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

func NewEffectiveDNSPoliciesReconciler

func NewEffectiveDNSPoliciesReconciler(client *dynamic.DynamicClient, scheme *runtime.Scheme) *EffectiveDNSPoliciesReconciler

func (*EffectiveDNSPoliciesReconciler) Subscription

type EffectiveRateLimitPolicies

type EffectiveRateLimitPolicies map[string]EffectiveRateLimitPolicy

type EffectiveRateLimitPolicy

type EffectiveRateLimitPolicy struct {
	Path []machinery.Targetable
	Spec kuadrantv1.RateLimitPolicy
}

type EffectiveRateLimitPolicyReconciler

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

func (*EffectiveRateLimitPolicyReconciler) Reconcile

func (*EffectiveRateLimitPolicyReconciler) Subscription

EffectiveRateLimitPolicyReconciler subscribe to the same events as auth because they are used together to compose gateway extension resources

type EffectiveTLSPoliciesReconciler

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

func NewEffectiveTLSPoliciesReconciler

func NewEffectiveTLSPoliciesReconciler(client *dynamic.DynamicClient, scheme *runtime.Scheme) *EffectiveTLSPoliciesReconciler

func (*EffectiveTLSPoliciesReconciler) Reconcile

func (*EffectiveTLSPoliciesReconciler) Subscription

type EnvoyGatewayAuthClusterReconciler

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

EnvoyGatewayAuthClusterReconciler reconciles Envoy Gateway EnvoyPatchPolicy custom resources for auth

func (*EnvoyGatewayAuthClusterReconciler) Reconcile

func (*EnvoyGatewayAuthClusterReconciler) Subscription

EnvoyGatewayAuthClusterReconciler subscribes to events with potential impact on the Envoy Gateway EnvoyPatchPolicy custom resources for auth

type EnvoyGatewayExtensionReconciler

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

EnvoyGatewayExtensionReconciler reconciles Envoy Gateway EnvoyExtensionPolicy custom resources

func (*EnvoyGatewayExtensionReconciler) Reconcile

func (*EnvoyGatewayExtensionReconciler) Subscription

EnvoyGatewayExtensionReconciler subscribes to events with potential impact on the Envoy Gateway EnvoyExtensionPolicy custom resources

type EnvoyGatewayJanitor

type EnvoyGatewayJanitor struct {
	Client *dynamic.DynamicClient
}

func NewEnvoyGatewayJanitor

func NewEnvoyGatewayJanitor(client *dynamic.DynamicClient) *EnvoyGatewayJanitor

func (*EnvoyGatewayJanitor) Subscription

func (r *EnvoyGatewayJanitor) Subscription() *controller.Subscription

type EnvoyGatewayRateLimitClusterReconciler

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

EnvoyGatewayRateLimitClusterReconciler reconciles Envoy Gateway EnvoyPatchPolicy custom resources for rate limiting

func (*EnvoyGatewayRateLimitClusterReconciler) Reconcile

func (*EnvoyGatewayRateLimitClusterReconciler) Subscription

EnvoyGatewayRateLimitClusterReconciler subscribes to events with potential impact on the Envoy Gateway EnvoyPatchPolicy custom resources for rate limiting

type EventLogger

type EventLogger struct{}

func NewEventLogger

func NewEventLogger() *EventLogger

func (*EventLogger) Log

func (e *EventLogger) Log(ctx context.Context, resourceEvents []controller.ResourceEvent, _ *machinery.Topology, err error, _ *sync.Map) error

type GatewayPolicyDiscoverabilityReconciler

type GatewayPolicyDiscoverabilityReconciler struct {
	Client *dynamic.DynamicClient
}

func NewGatewayPolicyDiscoverabilityReconciler

func NewGatewayPolicyDiscoverabilityReconciler(client *dynamic.DynamicClient) *GatewayPolicyDiscoverabilityReconciler

func (*GatewayPolicyDiscoverabilityReconciler) Subscription

type GatewayWrapper

type GatewayWrapper struct {
	*gatewayapiv1.Gateway
	// contains filtered or unexported fields
}

GatewayWrapper is a wrapper for gateway to implement interface from the builder

func NewGatewayWrapper

func NewGatewayWrapper(gateway *gatewayapiv1.Gateway) *GatewayWrapper

func (*GatewayWrapper) GetAddresses

func (g *GatewayWrapper) GetAddresses() []builder.TargetAddress

func (*GatewayWrapper) RemoveExcludedStatusAddresses

func (g *GatewayWrapper) RemoveExcludedStatusAddresses(p *kuadrantv1.DNSPolicy) error

type HTTPRoutePolicyDiscoverabilityReconciler

type HTTPRoutePolicyDiscoverabilityReconciler struct {
	Client *dynamic.DynamicClient
}

func NewHTTPRoutePolicyDiscoverabilityReconciler

func NewHTTPRoutePolicyDiscoverabilityReconciler(client *dynamic.DynamicClient) *HTTPRoutePolicyDiscoverabilityReconciler

func (*HTTPRoutePolicyDiscoverabilityReconciler) Subscription

type IstioAuthClusterReconciler

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

IstioAuthClusterReconciler reconciles Istio EnvoyFilter custom resources for auth

func (*IstioAuthClusterReconciler) Reconcile

func (*IstioAuthClusterReconciler) Subscription

IstioAuthClusterReconciler subscribes to events with potential impact on the Istio EnvoyFilter custom resources for auth

type IstioExtensionReconciler

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

IstioExtensionReconciler reconciles Istio WasmPlugin custom resources

func (*IstioExtensionReconciler) Reconcile

func (r *IstioExtensionReconciler) Reconcile(ctx context.Context, _ []controller.ResourceEvent, topology *machinery.Topology, _ error, state *sync.Map) error

func (*IstioExtensionReconciler) Subscription

IstioExtensionReconciler subscribes to events with potential impact on the Istio WasmPlugin custom resources

type IstioExtensionsJanitor

type IstioExtensionsJanitor struct {
	Client *dynamic.DynamicClient
}

func NewIstioExtensionsJanitor

func NewIstioExtensionsJanitor(client *dynamic.DynamicClient) *IstioExtensionsJanitor

func (*IstioExtensionsJanitor) Subscription

func (r *IstioExtensionsJanitor) Subscription() *controller.Subscription

type IstioRateLimitClusterReconciler

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

IstioRateLimitClusterReconciler reconciles Istio EnvoyFilter custom resources for rate limiting

func (*IstioRateLimitClusterReconciler) Reconcile

func (*IstioRateLimitClusterReconciler) Subscription

IstioRateLimitClusterReconciler subscribes to events with potential impact on the Istio EnvoyFilter custom resources for rate limiting

type KuadrantStatusUpdater

type KuadrantStatusUpdater struct {
	Client     *dynamic.DynamicClient
	HasGateway bool
}

func NewKuadrantStatusUpdater

func NewKuadrantStatusUpdater(client *dynamic.DynamicClient, isIstioInstalled, isEnvoyGatewayInstalled bool) *KuadrantStatusUpdater

func (*KuadrantStatusUpdater) Reconcile

func (*KuadrantStatusUpdater) Subscription

func (r *KuadrantStatusUpdater) Subscription() *controller.Subscription

type LimitadorLimitsReconciler

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

func (*LimitadorLimitsReconciler) Reconcile

func (r *LimitadorLimitsReconciler) Reconcile(ctx context.Context, _ []controller.ResourceEvent, topology *machinery.Topology, _ error, state *sync.Map) error

func (*LimitadorLimitsReconciler) Subscription

LimitadorLimitsReconciler reconciles to events with impact to change the state of the Limitador custom resources regarding the definitions for the effective rate limit policies

type LimitadorReconciler

type LimitadorReconciler struct {
	Client *dynamic.DynamicClient
}

func NewLimitadorReconciler

func NewLimitadorReconciler(client *dynamic.DynamicClient) *LimitadorReconciler

func (*LimitadorReconciler) Reconcile

func (r *LimitadorReconciler) Reconcile(ctx context.Context, _ []controller.ResourceEvent, topology *machinery.Topology, _ error, _ *sync.Map) error

func (*LimitadorReconciler) Subscription

func (r *LimitadorReconciler) Subscription() *controller.Subscription

type RateLimitPolicyStatusUpdater

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

func (*RateLimitPolicyStatusUpdater) Subscription

RateLimitPolicyStatusUpdater subscribe to events with potential impact on the status of RateLimitPolicy resources

func (*RateLimitPolicyStatusUpdater) UpdateStatus

func (r *RateLimitPolicyStatusUpdater) UpdateStatus(ctx context.Context, _ []controller.ResourceEvent, topology *machinery.Topology, _ error, state *sync.Map) error

type RateLimitPolicyValidator

type RateLimitPolicyValidator struct{}

func (*RateLimitPolicyValidator) Subscription

RateLimitPolicyValidator subscribes to events with potential to flip the validity of rate limit policies

func (*RateLimitPolicyValidator) Validate

type TLSPoliciesValidator

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

func NewTLSPoliciesValidator

func NewTLSPoliciesValidator(isCertManagerInstalled bool) *TLSPoliciesValidator

func (*TLSPoliciesValidator) Subscription

func (t *TLSPoliciesValidator) Subscription() *controller.Subscription

func (*TLSPoliciesValidator) Validate

type TLSPolicyStatusUpdater

type TLSPolicyStatusUpdater struct {
	Client *dynamic.DynamicClient
}

func NewTLSPolicyStatusUpdater

func NewTLSPolicyStatusUpdater(client *dynamic.DynamicClient) *TLSPolicyStatusUpdater

func (*TLSPolicyStatusUpdater) Subscription

func (t *TLSPolicyStatusUpdater) Subscription() *controller.Subscription

func (*TLSPolicyStatusUpdater) UpdateStatus

func (t *TLSPolicyStatusUpdater) UpdateStatus(ctx context.Context, _ []controller.ResourceEvent, topology *machinery.Topology, _ error, s *sync.Map) error

type TopologyReconciler

type TopologyReconciler struct {
	Client    *dynamic.DynamicClient
	Namespace string
}

func NewTopologyReconciler

func NewTopologyReconciler(client *dynamic.DynamicClient, namespace string) *TopologyReconciler

func (*TopologyReconciler) Reconcile

func (r *TopologyReconciler) Reconcile(ctx context.Context, _ []controller.ResourceEvent, topology *machinery.Topology, _ error, _ *sync.Map) error

Jump to

Keyboard shortcuts

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