Documentation ¶
Index ¶
- Constants
- Variables
- func CertificateAddedHandler(cert *certman.Certificate)
- func CertificateDeletedHandler(cert *certman.Certificate)
- func CertificateName(accessor Interface) string
- func CertificateSecretFilter(obj interface{}) bool
- func InitMetrics(provider tls.Provider)
- func IsDomainVerified(host string, dvs []v1.DomainVerification) bool
- func IsInvalidAccessObjectError(err error) bool
- func IsMissingGeneratedHostError(err error) bool
- func TLSSecretName(accessor Interface) string
- type CertificateReconciler
- type CreateOrUpdateTraffic
- type DeleteTraffic
- type DnsReconciler
- type Enqueue
- type HostReconciler
- type Ingress
- func (a *Ingress) AddTLS(host string, secret *corev1.Secret)
- func (a *Ingress) GetDNSTargets(ctx context.Context, dnsLookup dnsLookupFunc) (map[logicalcluster.Name]map[string]dns.Target, error)
- func (a *Ingress) GetHosts() []string
- func (a *Ingress) GetKind() string
- func (a *Ingress) GetLogicalCluster() logicalcluster.Name
- func (a *Ingress) GetNamespaceName() types.NamespacedName
- func (a *Ingress) GetSpec() interface{}
- func (a *Ingress) GetSyncTargets() []string
- func (a *Ingress) ProcessCustomHosts(_ context.Context, dvs *v1.DomainVerificationList, _ CreateOrUpdateTraffic, ...) error
- func (a *Ingress) RemoveTLS(hosts []string)
- func (a *Ingress) SetDNSLBHost(host string)
- func (a *Ingress) String() string
- func (a *Ingress) TMCEnabed() bool
- func (a *Ingress) Transform(old Interface) error
- type Interface
- type Pending
- type ReconcileStatus
- type Reconciler
- type Route
- func (a *Route) AddTLS(host string, secret *corev1.Secret)
- func (a *Route) GetDNSTargets(ctx context.Context, dnsLookup dnsLookupFunc) (map[logicalcluster.Name]map[string]dns.Target, error)
- func (a *Route) GetHosts() []string
- func (a *Route) GetKind() string
- func (a *Route) GetLogicalCluster() logicalcluster.Name
- func (a *Route) GetNamespaceName() types.NamespacedName
- func (a *Route) GetSpec() interface{}
- func (a *Route) GetSyncTargets() []string
- func (a *Route) ProcessCustomHosts(ctx context.Context, dvs *v1.DomainVerificationList, ...) error
- func (a *Route) RemoveTLS(hosts []string)
- func (a *Route) SetDNSLBHost(lbHost string)
- func (a *Route) String() string
- func (a *Route) TMCEnabed() bool
- func (a *Route) Transform(previous Interface) error
Constants ¶
View Source
const ( SHADOW_FINALIZER = "kuadrant.dev/shadow_cleanup" ANNOTATION_IS_GLBC_SHADOW = "kuadrant.dev/is_shadow_route" )
View Source
const ( ReconcileStatusStop ReconcileStatus = iota ReconcileStatusContinue ANNOTATION_TRAFFIC_KEY = "kuadrant.dev/traffic-key" ANNOTATION_TRAFFIC_KIND = "kuadrant.dev/traffic-kind" ANNOTATION_CERTIFICATE_STATE = "kuadrant.dev/certificate-status" ANNOTATION_HCG_HOST = "kuadrant.dev/host.generated" ANNOTATION_HEALTH_CHECK_PREFIX = "kuadrant.experimental/health-" ANNOTATION_HCG_CUSTOM_HOST_REPLACED = "kuadrant.dev/custom-hosts-status.removed" ANNOTATION_PENDING_CUSTOM_HOSTS = "kuadrant.dev/pendingCustomHosts" LABEL_HAS_PENDING_HOSTS = "kuadrant.dev/hasPendingCustomHosts" FINALIZER_CASCADE_CLEANUP = "kuadrant.dev/cascade-cleanup" )
Variables ¶
View Source
var ( ErrInvalidAccessObject = fmt.Errorf("not a valid traffic object type (expected: ingress or route)") ErrGeneratedHostMissing = fmt.Errorf("generated host annotation '%v' was expected but was not present", ANNOTATION_HCG_HOST) )
View Source
var ( IngressObjectTimeToAdmission = prometheus.NewHistogram( prometheus.HistogramOpts{ Name: "glbc_ingress_managed_object_time_to_admission", Help: "Duration of the ingress object admission", Buckets: []float64{ 1 * time.Second.Seconds(), 5 * time.Second.Seconds(), 10 * time.Second.Seconds(), 15 * time.Second.Seconds(), 30 * time.Second.Seconds(), 45 * time.Second.Seconds(), 1 * time.Minute.Seconds(), 2 * time.Minute.Seconds(), 5 * time.Minute.Seconds(), }, }) TlsCertificateRequestCount = prometheus.NewGaugeVec( prometheus.GaugeOpts{ Name: "glbc_tls_certificate_pending_request_count", Help: "GLBC TLS certificate pending request count", }, []string{ issuerLabel, }, ) // TlsCertificateRequestTotal is a prometheus counter metrics which holds the total // number of TLS certificate requests. TlsCertificateRequestTotal = prometheus.NewCounterVec( prometheus.CounterOpts{ Name: "glbc_tls_certificate_request_total", Help: "GLBC TLS certificate total number of requests", }, []string{ issuerLabel, resultLabel, }, ) // TlsCertificateIssuanceDuration is a prometheus metric which records the duration // of TLS certificate issuance. TlsCertificateIssuanceDuration = prometheus.NewHistogramVec( prometheus.HistogramOpts{ Name: "glbc_tls_certificate_issuance_duration_seconds", Help: "GLBC TLS certificate issuance duration", Buckets: []float64{ 1 * time.Second.Seconds(), 5 * time.Second.Seconds(), 10 * time.Second.Seconds(), 15 * time.Second.Seconds(), 30 * time.Second.Seconds(), 45 * time.Second.Seconds(), 1 * time.Minute.Seconds(), 2 * time.Minute.Seconds(), 5 * time.Minute.Seconds(), }, }, []string{ issuerLabel, resultLabel, }, ) // TlsCertificateRequestErrors is a prometheus counter metrics which holds the total // number of failed TLS certificate requests. TlsCertificateRequestErrors = prometheus.NewCounterVec( prometheus.CounterOpts{ Name: "glbc_tls_certificate_request_errors_total", Help: "GLBC TLS certificate total number of request errors", }, []string{ issuerLabel, }, ) )
Functions ¶
func CertificateAddedHandler ¶
func CertificateAddedHandler(cert *certman.Certificate)
CertificateAddedHandler is used as an event handler for certificates
func CertificateDeletedHandler ¶
func CertificateDeletedHandler(cert *certman.Certificate)
CertificateDeletedHandler is used as an event handler
func CertificateName ¶
func CertificateSecretFilter ¶
func CertificateSecretFilter(obj interface{}) bool
CertificateSecretFilter
func InitMetrics ¶
func IsDomainVerified ¶
func IsDomainVerified(host string, dvs []v1.DomainVerification) bool
IsDomainVerified will take the host and recursively remove subdomains searching for a matching domainverification that is verified. Until either a match is found, or the subdomains run out.
func TLSSecretName ¶
TLSSecretName returns the name for the secret in the end user namespace
Types ¶
type CertificateReconciler ¶
type CertificateReconciler struct { CreateCertificate func(ctx context.Context, mapper tls.CertificateRequest) error DeleteCertificate func(ctx context.Context, mapper tls.CertificateRequest) error GetCertificateSecret func(ctx context.Context, request tls.CertificateRequest) (*corev1.Secret, error) UpdateCertificate func(ctx context.Context, request tls.CertificateRequest) error GetCertificateStatus func(ctx context.Context, request tls.CertificateRequest) (tls.CertStatus, error) CopySecret func(ctx context.Context, workspace logicalcluster.Name, namespace string, s *corev1.Secret) error GetSecret func(ctx context.Context, name, namespace string, cluster logicalcluster.Name) (*corev1.Secret, error) DeleteSecret func(ctx context.Context, workspace logicalcluster.Name, namespace, name string) error Log logr.Logger }
func (*CertificateReconciler) GetName ¶
func (r *CertificateReconciler) GetName() string
func (*CertificateReconciler) Reconcile ¶
func (r *CertificateReconciler) Reconcile(ctx context.Context, accessor Interface) (ReconcileStatus, error)
type CreateOrUpdateTraffic ¶
type DnsReconciler ¶
type DnsReconciler struct { DeleteDNS func(ctx context.Context, accessor Interface) error GetDNS func(ctx context.Context, accessor Interface) (*v1.DNSRecord, error) CreateDNS func(ctx context.Context, dns *v1.DNSRecord) (*v1.DNSRecord, error) UpdateDNS func(ctx context.Context, dns *v1.DNSRecord) (*v1.DNSRecord, error) WatchHost func(ctx context.Context, key interface{}, host string) bool ForgetHost func(key interface{}, host string) ListHostWatchers func(key interface{}) []dns.RecordWatcher DNSLookup func(ctx context.Context, host string) ([]dns.HostAddress, error) Log logr.Logger }
func (*DnsReconciler) GetName ¶
func (r *DnsReconciler) GetName() string
func (*DnsReconciler) Reconcile ¶
func (r *DnsReconciler) Reconcile(ctx context.Context, accessor Interface) (ReconcileStatus, error)
type Enqueue ¶
type Enqueue bool
func CertificateUpdatedHandler ¶
func CertificateUpdatedHandler(oldCert, newCert *certman.Certificate) Enqueue
CertificateUpdatedHandler is used as an event handler for certificates
type HostReconciler ¶
type HostReconciler struct { ManagedDomain string Log logr.Logger KuadrantClient kuadrantclientv1.ClusterInterface GetDomainVerifications func(ctx context.Context, accessor Interface) (*v1.DomainVerificationList, error) CreateOrUpdateTraffic CreateOrUpdateTraffic DeleteTraffic DeleteTraffic }
func (*HostReconciler) GetName ¶
func (r *HostReconciler) GetName() string
func (*HostReconciler) Reconcile ¶
func (r *HostReconciler) Reconcile(ctx context.Context, accessor Interface) (ReconcileStatus, error)
type Ingress ¶
type Ingress struct {
*networkingv1.Ingress
}
func NewIngress ¶
func NewIngress(i *networkingv1.Ingress) *Ingress
func (*Ingress) GetDNSTargets ¶
func (*Ingress) GetLogicalCluster ¶
func (a *Ingress) GetLogicalCluster() logicalcluster.Name
func (*Ingress) GetNamespaceName ¶
func (a *Ingress) GetNamespaceName() types.NamespacedName
func (*Ingress) GetSyncTargets ¶
func (*Ingress) ProcessCustomHosts ¶
func (a *Ingress) ProcessCustomHosts(_ context.Context, dvs *v1.DomainVerificationList, _ CreateOrUpdateTraffic, _ DeleteTraffic) error
func (*Ingress) SetDNSLBHost ¶
type Interface ¶
type Interface interface { runtime.Object metav1.Object GetKind() string GetHosts() []string SetDNSLBHost(string) Transform(previous Interface) error GetDNSTargets(ctx context.Context, dnsLookup dnsLookupFunc) (map[logicalcluster.Name]map[string]dns.Target, error) GetLogicalCluster() logicalcluster.Name GetNamespaceName() types.NamespacedName AddTLS(host string, secret *corev1.Secret) RemoveTLS(host []string) ProcessCustomHosts(context.Context, *v1.DomainVerificationList, CreateOrUpdateTraffic, DeleteTraffic) error GetSyncTargets() []string GetSpec() interface{} TMCEnabed() bool }
type Pending ¶
type Pending struct {
Rules []networkingv1.IngressRule `json:"rules"`
}
type ReconcileStatus ¶
type ReconcileStatus int
type Reconciler ¶
type Route ¶
func (*Route) GetDNSTargets ¶
func (*Route) GetLogicalCluster ¶
func (a *Route) GetLogicalCluster() logicalcluster.Name
func (*Route) GetNamespaceName ¶
func (a *Route) GetNamespaceName() types.NamespacedName
func (*Route) GetSyncTargets ¶
func (*Route) ProcessCustomHosts ¶
func (a *Route) ProcessCustomHosts(ctx context.Context, dvs *v1.DomainVerificationList, createOrUpdate CreateOrUpdateTraffic, delete DeleteTraffic) error
func (*Route) SetDNSLBHost ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.