Documentation
¶
Index ¶
- Constants
- type GatewayReconcileResult
- type Instance
- type Reconciler
- func (r *Reconciler) DeleteTLSRoute(ctx context.Context, instance *Instance, targetCluster *clusters.Cluster) error
- func (r *Reconciler) IsTLSRouteReady(ctx context.Context, instance *Instance, targetCluster *clusters.Cluster) (bool, error)
- func (r *Reconciler) ReconcileGateway(ctx context.Context, instance *Instance, targetCluster *clusters.Cluster) (GatewayReconcileResult, error)
- func (r *Reconciler) ReconcileTLSRoute(ctx context.Context, instance *Instance, targetCluster *clusters.Cluster) error
Constants ¶
const ( DefaultGatewayName = "default" DefaultGatewayNamespace = "openmcp-system" DNSAnnotationKey = "dns.openmcp.cloud/base-domain" RequeueInterval = 20 * time.Second )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GatewayReconcileResult ¶
type GatewayReconcileResult struct {
// HostName is the hostname that was created for the instance and can be used for DNS records.
HostName string
// TLSPort is the port under which the gateway accepts TLS traffic.
TLSPort int32
// Result is the result of the reconciliation.
reconcile.Result
}
GatewayReconcileResult is the result of a gateway reconciliation. If Result.Requeue is not set, the gateway is ready and the HostName can be used.
type Instance ¶
type Instance struct {
// Namespace in which the TLSRoute will be created.
Namespace string
// Name of the TLSRoute.
Name string
// SubDomainPrefix is the prefix for the subdomain that will be created for the instance.
SubDomainPrefix string
// BackendName is the name of the backend service to which the TLSRoute will route traffic.
BackendName string
// BackendPort is the port of the backend service to which the TLSRoute will route traffic.
BackendPort int32
}
Instance represents a service instance for that the TLSRoute will be managed.
type Reconciler ¶
type Reconciler struct {
}
Reconciler is a reconciler for managing DNS records using Gateway API resources.
func (*Reconciler) DeleteTLSRoute ¶
func (r *Reconciler) DeleteTLSRoute(ctx context.Context, instance *Instance, targetCluster *clusters.Cluster) error
DeleteTLSRoute deletes the TLSRoute for the given instance.
func (*Reconciler) IsTLSRouteReady ¶
func (r *Reconciler) IsTLSRouteReady(ctx context.Context, instance *Instance, targetCluster *clusters.Cluster) (bool, error)
IsTLSRouteReady checks if the TLSRoute for the given instance is accepted by the default gateway.
func (*Reconciler) ReconcileGateway ¶
func (r *Reconciler) ReconcileGateway(ctx context.Context, instance *Instance, targetCluster *clusters.Cluster) (GatewayReconcileResult, error)
ReconcileGateway ensures that the default gateway exists and retrieves the base domain from its annotations. It returns the full hostname for the given instance that can be used for DNS records. If the default gateway is not found, it will requeue after a predefined interval.
func (*Reconciler) ReconcileTLSRoute ¶
func (r *Reconciler) ReconcileTLSRoute(ctx context.Context, instance *Instance, targetCluster *clusters.Cluster) error
ReconcileTLSRoute ensures that a TLSRoute exists for the given instance, pointing to the default gateway.