controllers

package
v0.11.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2024 License: Apache-2.0 Imports: 77 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LabelGatewayReference  = "kuadrant.io/gateway"
	LabelGatewayNSRef      = "kuadrant.io/gateway-namespace"
	LabelListenerReference = "kuadrant.io/listener-name"
)
View Source
const (
	ReadyConditionType string = "Ready"

	PolicyReasonUnknown string = "Unknown"
)
View Source
const DNSPolicyFinalizer = "kuadrant.io/dns-policy"
View Source
const (
	KuadrantReferenceGrantName = "kuadrant-authorization-rg"
)
View Source
const PolicyAffectedConditionPattern = "kuadrant.io/%sAffected" // Policy kinds are expected to be named XPolicy
View Source
const TLSPolicyFinalizer = "kuadrant.io/tls-policy"

Variables

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 KuadrantExtAuthProviderName = env.GetString("AUTH_PROVIDER", "kuadrant-authorization")
View Source
var NegativePolarityConditions []string
View Source
var (
	WASMFilterImageURL = env.GetString("RELATED_IMAGE_WASMSHIM", "oci://quay.io/kuadrant/wasm-shim:latest")
)

Functions

func AuthConfigName added in v0.10.0

func AuthConfigName(apKey client.ObjectKey) string

AuthConfigName returns the name of Authorino AuthConfig CR.

func EnvoyExtensionPolicyName added in v0.11.0

func EnvoyExtensionPolicyName(targetName string) string

func EnvoySecurityPolicyName added in v0.11.0

func EnvoySecurityPolicyName(targetName string) string

func FindRouteParentStatusFunc

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

func GetLimitador added in v0.8.0

func IstioAuthorizationPolicyName added in v0.10.0

func IstioAuthorizationPolicyName(gwName string, targetRef gatewayapiv1alpha2.LocalPolicyTargetReference) string

IstioAuthorizationPolicyName generates the name of an AuthorizationPolicy.

func LimitadorClusterEnvoyPatchPolicyName added in v0.11.0

func LimitadorClusterEnvoyPatchPolicyName(targetName string) string

func NewPolicyMachineryController

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

func PolicyAffectedConditionType

func PolicyAffectedConditionType(policyKind string) string

func WASMPluginName added in v0.10.0

func WASMPluginName(gw *gatewayapiv1.Gateway) string

Types

type AuthPolicyEnvoySecurityPolicyReconciler added in v0.11.0

type AuthPolicyEnvoySecurityPolicyReconciler struct {
	*reconcilers.BaseReconciler
}

AuthPolicyEnvoySecurityPolicyReconciler reconciles SecurityPolicy objects for auth

func (*AuthPolicyEnvoySecurityPolicyReconciler) Reconcile added in v0.11.0

func (*AuthPolicyEnvoySecurityPolicyReconciler) SetupWithManager added in v0.11.0

func (r *AuthPolicyEnvoySecurityPolicyReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

type AuthPolicyIstioAuthorizationPolicyReconciler added in v0.11.0

type AuthPolicyIstioAuthorizationPolicyReconciler struct {
	*reconcilers.BaseReconciler
}

AuthPolicyIstioAuthorizationPolicyReconciler reconciles IstioAuthorizationPolicy objects for auth

func (*AuthPolicyIstioAuthorizationPolicyReconciler) Reconcile added in v0.11.0

func (*AuthPolicyIstioAuthorizationPolicyReconciler) SetupWithManager added in v0.11.0

type AuthPolicyReconciler added in v0.2.0

type AuthPolicyReconciler struct {
	*reconcilers.BaseReconciler
	TargetRefReconciler reconcilers.TargetRefReconciler
	// AffectedPolicyMap tracks the affected policies to report their status.
	AffectedPolicyMap *kuadrant.AffectedPolicyMap
}

AuthPolicyReconciler reconciles a AuthPolicy object

func (*AuthPolicyReconciler) Reconcile added in v0.2.0

func (r *AuthPolicyReconciler) Reconcile(eventCtx context.Context, req ctrl.Request) (ctrl.Result, error)

func (*AuthPolicyReconciler) SetupWithManager added in v0.2.0

func (r *AuthPolicyReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

type DNSPolicyReconciler added in v0.7.0

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

DNSPolicyReconciler reconciles a DNSPolicy object

func (*DNSPolicyReconciler) Reconcile added in v0.7.0

func (r *DNSPolicyReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

func (*DNSPolicyReconciler) SetupWithManager added in v0.7.0

func (r *DNSPolicyReconciler) SetupWithManager(mgr ctrl.Manager) error

type DNSPolicyRefsConfig added in v0.7.0

type DNSPolicyRefsConfig struct{}

type EnvoyGatewayLimitadorClusterReconciler added in v0.11.0

type EnvoyGatewayLimitadorClusterReconciler struct {
	*reconcilers.BaseReconciler
}

EnvoyGatewayLimitadorClusterReconciler reconciles an EnvoyGateway EnvoyPatchPolicy object to setup limitador's cluster on the gateway. It is a requirement for the wasm module to work. https://gateway.envoyproxy.io/latest/api/extension_types/#envoypatchpolicy

func (*EnvoyGatewayLimitadorClusterReconciler) Reconcile added in v0.11.0

For more details, check Reconcile and its Result here: - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.10.0/pkg/reconcile

func (*EnvoyGatewayLimitadorClusterReconciler) SetupWithManager added in v0.11.0

func (r *EnvoyGatewayLimitadorClusterReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

type EnvoyGatewayWasmReconciler added in v0.11.0

type EnvoyGatewayWasmReconciler struct {
	*reconcilers.BaseReconciler
}

EnvoyGatewayWasmReconciler reconciles an EnvoyGateway EnvoyExtensionPolicy object for the kuadrant's wasm module

func (*EnvoyGatewayWasmReconciler) Reconcile added in v0.11.0

func (r *EnvoyGatewayWasmReconciler) Reconcile(eventCtx context.Context, req ctrl.Request) (ctrl.Result, error)

For more details, check Reconcile and its Result here: - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.10.0/pkg/reconcile

func (*EnvoyGatewayWasmReconciler) SetupWithManager added in v0.11.0

func (r *EnvoyGatewayWasmReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

type EnvoySecurityPolicyReferenceGrantReconciler added in v0.11.0

type EnvoySecurityPolicyReferenceGrantReconciler struct {
	*reconcilers.BaseReconciler
}

EnvoySecurityPolicyReferenceGrantReconciler reconciles ReferenceGrant objects for auth

func (*EnvoySecurityPolicyReferenceGrantReconciler) Reconcile added in v0.11.0

func (*EnvoySecurityPolicyReferenceGrantReconciler) SetupWithManager added in v0.11.0

SetupWithManager sets up the controller with the Manager.

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 GatewayKuadrantReconciler added in v0.4.0

type GatewayKuadrantReconciler struct {
	*reconcilers.BaseReconciler
}

GatewayKuadrantReconciler is responsible of assiging gateways to a kuadrant instances Currently only one kuadrant instance is allowed per cluster This controller will annotate every gateway in the cluster with the namespace of the kuadrant instance TODO: After the RFC defined, we might want to get the gw to label/annotate from Kuadrant.Spec or manual labeling/annotation

func (*GatewayKuadrantReconciler) Reconcile added in v0.4.0

func (r *GatewayKuadrantReconciler) Reconcile(eventCtx context.Context, req ctrl.Request) (ctrl.Result, error)

For more details, check Reconcile and its Result here: - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.10.0/pkg/reconcile

func (*GatewayKuadrantReconciler) SetupWithManager added in v0.4.0

func (r *GatewayKuadrantReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

type GatewayWrapper

type GatewayWrapper struct {
	*gatewayapiv1.Gateway
}

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

func NewGatewayWrapper

func NewGatewayWrapper(gateway *gatewayapiv1.Gateway) *GatewayWrapper

func (GatewayWrapper) GetAddresses

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

type HTTPRouteParentRefsEventMapper added in v0.4.0

type HTTPRouteParentRefsEventMapper struct {
	Logger logr.Logger
	Client client.Client
}

HTTPRouteParentRefsEventMapper is an EventHandler that maps HTTPRoute events to policy events, by going through the parentRefs of the route and finding all policies that target one of its parent resources, thus yielding events for those policies.

func (*HTTPRouteParentRefsEventMapper) MapToAuthPolicy added in v0.4.0

func (m *HTTPRouteParentRefsEventMapper) MapToAuthPolicy(obj client.Object) []reconcile.Request

func (*HTTPRouteParentRefsEventMapper) MapToRateLimitPolicy added in v0.4.0

func (m *HTTPRouteParentRefsEventMapper) MapToRateLimitPolicy(obj client.Object) []reconcile.Request

type KuadrantReconciler added in v0.1.0

type KuadrantReconciler struct {
	*reconcilers.BaseReconciler
	RestMapper meta.RESTMapper
}

KuadrantReconciler reconciles a Kuadrant object

func (*KuadrantReconciler) Reconcile added in v0.1.0

func (r *KuadrantReconciler) Reconcile(eventCtx context.Context, req ctrl.Request) (ctrl.Result, error)

Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state. For more details, check Reconcile and its Result here: - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.10.0/pkg/reconcile

func (*KuadrantReconciler) SetupWithManager added in v0.1.0

func (r *KuadrantReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

type LimitadorClusterEnvoyFilterReconciler added in v0.4.0

type LimitadorClusterEnvoyFilterReconciler struct {
	*reconcilers.BaseReconciler
}

LimitadorClusterEnvoyFilterReconciler reconciles a EnvoyFilter object with limitador's cluster

func (*LimitadorClusterEnvoyFilterReconciler) Reconcile added in v0.4.0

For more details, check Reconcile and its Result here: - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.10.0/pkg/reconcile

func (*LimitadorClusterEnvoyFilterReconciler) SetupWithManager added in v0.4.0

func (r *LimitadorClusterEnvoyFilterReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

type RateLimitPolicyEnforcedStatusReconciler added in v0.8.0

type RateLimitPolicyEnforcedStatusReconciler struct {
	*reconcilers.BaseReconciler
}

func (*RateLimitPolicyEnforcedStatusReconciler) Reconcile added in v0.8.0

func (*RateLimitPolicyEnforcedStatusReconciler) SetupWithManager added in v0.8.0

func (r *RateLimitPolicyEnforcedStatusReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

type RateLimitPolicyReconciler added in v0.2.0

type RateLimitPolicyReconciler struct {
	*reconcilers.BaseReconciler
	TargetRefReconciler reconcilers.TargetRefReconciler
}

RateLimitPolicyReconciler reconciles a RateLimitPolicy object

func (*RateLimitPolicyReconciler) Reconcile added in v0.2.0

func (r *RateLimitPolicyReconciler) Reconcile(eventCtx context.Context, req ctrl.Request) (ctrl.Result, error)

Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state. TODO(user): Modify the Reconcile function to compare the state specified by the RateLimitPolicy object against the actual cluster state, and then perform operations to make the cluster state reflect the state specified by the user.

For more details, check Reconcile and its Result here: - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.10.0/pkg/reconcile

func (*RateLimitPolicyReconciler) SetupWithManager added in v0.2.0

func (r *RateLimitPolicyReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

type RateLimitingIstioWASMPluginReconciler added in v0.10.0

type RateLimitingIstioWASMPluginReconciler struct {
	*reconcilers.BaseReconciler
}

RateLimitingIstioWASMPluginReconciler reconciles a WASMPlugin object for rate limiting

func (*RateLimitingIstioWASMPluginReconciler) Reconcile added in v0.10.0

For more details, check Reconcile and its Result here: - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.10.0/pkg/reconcile

func (*RateLimitingIstioWASMPluginReconciler) SetupWithManager added in v0.10.0

func (r *RateLimitingIstioWASMPluginReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

type TLSPolicyReconciler added in v0.7.0

type TLSPolicyReconciler struct {
	*reconcilers.BaseReconciler
	TargetRefReconciler reconcilers.TargetRefReconciler
	RestMapper          meta.RESTMapper
}

TLSPolicyReconciler reconciles a TLSPolicy object

func (*TLSPolicyReconciler) Reconcile added in v0.7.0

func (r *TLSPolicyReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

func (*TLSPolicyReconciler) SetupWithManager added in v0.7.0

func (r *TLSPolicyReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

type TargetStatusReconciler added in v0.7.0

type TargetStatusReconciler struct {
	*reconcilers.BaseReconciler
}

TargetStatusReconciler reconciles a the status stanzas of objects targeted by Kuadrant policies

func (*TargetStatusReconciler) Reconcile added in v0.7.0

func (r *TargetStatusReconciler) Reconcile(eventCtx context.Context, req ctrl.Request) (ctrl.Result, error)

func (*TargetStatusReconciler) SetupWithManager added in v0.7.0

func (r *TargetStatusReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

type TopologyFileReconciler added in v0.10.0

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

func NewTopologyFileReconciler added in v0.10.0

func NewTopologyFileReconciler(client *dynamic.DynamicClient, namespace string) *TopologyFileReconciler

func (*TopologyFileReconciler) Reconcile added in v0.10.0

Jump to

Keyboard shortcuts

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