Documentation
¶
Index ¶
- Constants
- Variables
- func CreateDefaultDomainSecret(certPEM, keyPEM []byte) *corev1.Secret
- func DefaultDomainServer(name string) []client.Object
- func DefaultNginxIngressController() *v1alpha1.NginxIngressController
- func E2e(image, loadableProvisionedJson string) []client.Object
- func GenerateSelfSignedCert() (certPEM, keyPEM []byte, err error)
- func MarshalJson(obj client.Object) ([]byte, error)
- func NewNginxIngressController(name, ingressClassName string) *v1alpha1.NginxIngressController
- func Operator(latestImage string, publicZones, privateZones []string, cfg *OperatorConfig, ...) []client.Object
- func PrometheusClientAndServer(namespace, name string) prometheusResources
- func UncollisionedNs() *corev1.Namespace
- type ClientServerResources
- type DnsZoneCount
- type DnsZones
- type GRPCRouteKind
- func (GRPCRouteKind) ClientContents() string
- func (GRPCRouteKind) Listener(listenerName, tlsHost, keyvaultURI, serviceAccountName string) gatewayv1.Listener
- func (GRPCRouteKind) Name() string
- func (GRPCRouteKind) Route(namespace, name, gatewayName, listenerName, tlsHost, backendServiceName string, ...) client.Object
- func (GRPCRouteKind) RouteObjectName(baseName string) string
- func (GRPCRouteKind) ServerContents() string
- func (GRPCRouteKind) ServicePortName() string
- type GatewayClientServerArgs
- type GatewayClientServerResources
- type GatewayFilterTestResources
- func GatewayLabelFilterResources(cfg GatewayLabelFilterTestConfig) GatewayFilterTestResources
- func GatewayLabelFilterResourcesFor(kind RouteKind, cfg GatewayLabelFilterTestConfig) GatewayFilterTestResources
- func RouteLabelFilterResources(cfg GatewayLabelFilterTestConfig) GatewayFilterTestResources
- func RouteLabelFilterResourcesFor(kind RouteKind, cfg GatewayLabelFilterTestConfig) GatewayFilterTestResources
- type GatewayLabelFilterTestConfig
- type HTTPRouteKind
- func (HTTPRouteKind) ClientContents() string
- func (HTTPRouteKind) Listener(listenerName, tlsHost, keyvaultURI, serviceAccountName string) gatewayv1.Listener
- func (HTTPRouteKind) Name() string
- func (HTTPRouteKind) Route(namespace, name, gatewayName, listenerName, tlsHost, backendServiceName string, ...) client.Object
- func (HTTPRouteKind) RouteObjectName(baseName string) string
- func (HTTPRouteKind) ServerContents() string
- func (HTTPRouteKind) ServicePortName() string
- type ObjectsContainer
- type OperatorConfig
- type OperatorVersion
- type RouteKind
Constants ¶
const ( ManagedByKey = "app.kubernetes.io/managed-by" // ManagedByVal is the value for the ManagedByKey label on all resources directly managed by our e2e tester ManagedByVal = "app-routing-operator-e2e" )
const ( // IstioGatewayClassName is the GatewayClass name for Istio managed gateways IstioGatewayClassName = "istio" // AppRoutingIstioGatewayClassName is the GatewayClass name for App Routing meshless Istio gateways AppRoutingIstioGatewayClassName = "approuting-istio" // TLSCertKeyvaultURIOption is the TLS option key for specifying the KeyVault certificate URI TLSCertKeyvaultURIOption = "kubernetes.azure.com/tls-cert-keyvault-uri" // TLSCertServiceAccountOption is the TLS option key for specifying the ServiceAccount for workload identity TLSCertServiceAccountOption = "kubernetes.azure.com/tls-cert-service-account" )
const (
ManagedResourceNs = "app-routing-system"
)
Variables ¶
var ( // AllUsedOperatorVersions is a list of all the operator versions used today AllUsedOperatorVersions = []OperatorVersion{OperatorVersion0_2_5, OperatorVersionLatest} // AllDnsZoneCounts is a list of all the dns zone counts AllDnsZoneCounts = []DnsZoneCount{DnsZoneCountNone, DnsZoneCountOne, DnsZoneCountMultiple} NonZeroDnsZoneCounts = []DnsZoneCount{DnsZoneCountOne, DnsZoneCountMultiple} SingleStackIPFamilyPolicy = corev1.IPFamilyPolicySingleStack )
Functions ¶
func CreateDefaultDomainSecret ¶ added in v0.2.9
func DefaultDomainServer ¶ added in v0.2.14
func DefaultNginxIngressController ¶ added in v0.2.18
func DefaultNginxIngressController() *v1alpha1.NginxIngressController
DefaultNginxIngressController returns the default NIC that the operator creates. This must match the values in pkg/controller/nginxingress/default.go GetDefaultNginxIngressController
func GenerateSelfSignedCert ¶ added in v0.2.9
GenerateSelfSignedCert generates a self-signed TLS certificate and private key for testing
func MarshalJson ¶
MarshalJson converts an object to json
func NewNginxIngressController ¶
func NewNginxIngressController(name, ingressClassName string) *v1alpha1.NginxIngressController
func PrometheusClientAndServer ¶
func PrometheusClientAndServer(namespace, name string) prometheusResources
func UncollisionedNs ¶
UncollisionedNs returns a namespace with a guaranteed unique name after creating the namespace
Types ¶
type ClientServerResources ¶
type ClientServerResources struct {
Client *appsv1.Deployment
Server *appsv1.Deployment
Ingress *netv1.Ingress
Service *corev1.Service
AddedObjects []client.Object
}
func ClientAndServer ¶
func ClientAndServer(namespace, name, nameserver, keyvaultURI, host, tlsHost string) ClientServerResources
func CustomErrorsClientAndServer ¶
func CustomErrorsClientAndServer(namespace, name, nameserver, keyvaultURI, host, tlsHost, ingressClassName string, serviceName *string) ClientServerResources
func DefaultBackendClientAndServer ¶
func DefaultBackendClientAndServer(namespace, name, nameserver, keyvaultURI, ingressClassName, host, tlsHost string) ClientServerResources
func (ClientServerResources) Objects ¶
func (t ClientServerResources) Objects() []client.Object
type DnsZoneCount ¶
type DnsZoneCount uint
DnsZoneCount is enum for the number of dns zones but shouldn't be used directly. Use the exported fields of this type instead.
const ( // DnsZoneCountNone represents no dns zones DnsZoneCountNone DnsZoneCount = iota // DnsZoneCountOne represents one dns zone DnsZoneCountOne // DnsZoneCountMultiple represents multiple dns zones DnsZoneCountMultiple )
func (DnsZoneCount) String ¶
func (d DnsZoneCount) String() string
type DnsZones ¶
type DnsZones struct {
Public DnsZoneCount
Private DnsZoneCount
}
type GRPCRouteKind ¶ added in v0.2.23
type GRPCRouteKind struct{}
GRPCRouteKind is the RouteKind implementation for GRPCRoute. Listener mirrors HTTPRouteKind (HTTPS/443 + TLS terminate) — Istio terminates TLS at the gateway and forwards plaintext gRPC to the backend.
func (GRPCRouteKind) ClientContents ¶ added in v0.2.23
func (GRPCRouteKind) ClientContents() string
func (GRPCRouteKind) Listener ¶ added in v0.2.23
func (GRPCRouteKind) Listener(listenerName, tlsHost, keyvaultURI, serviceAccountName string) gatewayv1.Listener
func (GRPCRouteKind) Name ¶ added in v0.2.23
func (GRPCRouteKind) Name() string
func (GRPCRouteKind) Route ¶ added in v0.2.23
func (GRPCRouteKind) Route(namespace, name, gatewayName, listenerName, tlsHost, backendServiceName string, backendPort int32) client.Object
func (GRPCRouteKind) RouteObjectName ¶ added in v0.2.23
func (GRPCRouteKind) RouteObjectName(baseName string) string
func (GRPCRouteKind) ServerContents ¶ added in v0.2.23
func (GRPCRouteKind) ServerContents() string
func (GRPCRouteKind) ServicePortName ¶ added in v0.2.23
func (GRPCRouteKind) ServicePortName() string
type GatewayClientServerArgs ¶ added in v0.2.23
type GatewayClientServerArgs struct {
Namespace string
Name string
Nameserver string
KeyvaultURI string
TLSHost string
ServiceAccountName string
GatewayClassName string
}
GatewayClientServerArgs bundles arguments for GatewayClientAndServerFor to avoid a long positional argument list as more route kinds are added.
type GatewayClientServerResources ¶ added in v0.2.18
type GatewayClientServerResources struct {
Client *appsv1.Deployment
Server *appsv1.Deployment
Service *corev1.Service
Gateway *gatewayv1.Gateway
RouteObject client.Object
AddedObjects []client.Object
}
GatewayClientServerResources contains the Kubernetes resources needed for Gateway API e2e testing. RouteObject is the route (HTTPRoute / GRPCRoute / TLSRoute) attached to Gateway.
func GatewayClientAndServerFor ¶ added in v0.2.23
func GatewayClientAndServerFor(kind RouteKind, args GatewayClientServerArgs) GatewayClientServerResources
GatewayClientAndServerFor builds the gateway+route+client+server resource set for the given RouteKind. Listener protocol/TLS mode and the route object's GVK come from the kind.
func (*GatewayClientServerResources) Objects ¶ added in v0.2.18
func (g *GatewayClientServerResources) Objects() []client.Object
Objects returns all Kubernetes objects in this resource set
func (*GatewayClientServerResources) Route ¶ added in v0.2.23
func (g *GatewayClientServerResources) Route() client.Object
Route returns the route object (HTTPRoute / GRPCRoute / TLSRoute) for this resource set.
type GatewayFilterTestResources ¶ added in v0.2.18
type GatewayFilterTestResources struct {
Client *appsv1.Deployment
Server *appsv1.Deployment
Service *corev1.Service
LabeledGateway *gatewayv1.Gateway
UnlabeledGateway *gatewayv1.Gateway
LabeledRouteObj client.Object
UnlabeledRouteObj client.Object
AddedObjects []client.Object
}
GatewayFilterTestResources contains resources for testing gateway/route label selectors It includes two gateways - one labeled (reachable) and one unlabeled (unreachable)
func GatewayLabelFilterResources ¶ added in v0.2.18
func GatewayLabelFilterResources(cfg GatewayLabelFilterTestConfig) GatewayFilterTestResources
GatewayLabelFilterResources creates HTTPRoute-based resources for testing gateway label selectors. Wrapper around GatewayLabelFilterResourcesFor.
func GatewayLabelFilterResourcesFor ¶ added in v0.2.23
func GatewayLabelFilterResourcesFor(kind RouteKind, cfg GatewayLabelFilterTestConfig) GatewayFilterTestResources
GatewayLabelFilterResourcesFor builds two gateways (labeled vs unlabeled) each with a route of the given kind. Only the labeled gateway carries the filter label, exercising the *gateway* label selector path; both routes are unlabeled.
func RouteLabelFilterResources ¶ added in v0.2.18
func RouteLabelFilterResources(cfg GatewayLabelFilterTestConfig) GatewayFilterTestResources
RouteLabelFilterResources creates HTTPRoute-based resources for testing route label selectors. Wrapper around RouteLabelFilterResourcesFor.
func RouteLabelFilterResourcesFor ¶ added in v0.2.23
func RouteLabelFilterResourcesFor(kind RouteKind, cfg GatewayLabelFilterTestConfig) GatewayFilterTestResources
RouteLabelFilterResourcesFor builds two unlabeled gateways each with a route of the given kind. Only the labeled route carries the filter label, exercising the *route* label selector path.
func (*GatewayFilterTestResources) LabeledRouteObject ¶ added in v0.2.23
func (g *GatewayFilterTestResources) LabeledRouteObject() client.Object
LabeledRouteObject returns the labeled route object (HTTPRoute / GRPCRoute / TLSRoute).
func (*GatewayFilterTestResources) Objects ¶ added in v0.2.18
func (g *GatewayFilterTestResources) Objects() []client.Object
Objects returns all Kubernetes objects in this resource set
func (*GatewayFilterTestResources) UnlabeledRouteObject ¶ added in v0.2.23
func (g *GatewayFilterTestResources) UnlabeledRouteObject() client.Object
UnlabeledRouteObject returns the unlabeled route object.
type GatewayLabelFilterTestConfig ¶ added in v0.2.18
type GatewayLabelFilterTestConfig struct {
Namespace string
Name string
Nameserver string
KeyvaultURI string
LabeledHost string // Host for the labeled gateway (should be reachable)
UnlabeledHost string // Host for the unlabeled gateway (should be unreachable)
ServiceAccountName string
GatewayClassName string
FilterLabelKey string
FilterLabelValue string
}
GatewayLabelFilterTestConfig contains configuration for gateway label filter tests
type HTTPRouteKind ¶ added in v0.2.23
type HTTPRouteKind struct{}
HTTPRouteKind is the RouteKind implementation for HTTPRoute.
func (HTTPRouteKind) ClientContents ¶ added in v0.2.23
func (HTTPRouteKind) ClientContents() string
func (HTTPRouteKind) Listener ¶ added in v0.2.23
func (HTTPRouteKind) Listener(listenerName, tlsHost, keyvaultURI, serviceAccountName string) gatewayv1.Listener
func (HTTPRouteKind) Name ¶ added in v0.2.23
func (HTTPRouteKind) Name() string
func (HTTPRouteKind) Route ¶ added in v0.2.23
func (HTTPRouteKind) Route(namespace, name, gatewayName, listenerName, tlsHost, backendServiceName string, backendPort int32) client.Object
func (HTTPRouteKind) RouteObjectName ¶ added in v0.2.23
func (HTTPRouteKind) RouteObjectName(baseName string) string
func (HTTPRouteKind) ServerContents ¶ added in v0.2.23
func (HTTPRouteKind) ServerContents() string
func (HTTPRouteKind) ServicePortName ¶ added in v0.2.23
func (HTTPRouteKind) ServicePortName() string
type ObjectsContainer ¶ added in v0.2.19
type OperatorConfig ¶
type OperatorVersion ¶
type OperatorVersion uint
OperatorVersion is an enum for the different versions of the operator
const ( OperatorVersion0_2_1_Patch_7 OperatorVersion = iota // use iota to number with earlier versions being lower numbers OperatorVersion0_2_3_Patch_5 OperatorVersion0_2_5 // OperatorVersionLatest represents the latest version of the operator which is essentially whatever code changes this test is running against OperatorVersionLatest = math.MaxUint // this must always be the last/largest value in the enum because we order by value )
func (OperatorVersion) String ¶
func (o OperatorVersion) String() string
func (OperatorVersion) SupportsDalec ¶ added in v0.2.21
func (o OperatorVersion) SupportsDalec() bool
SupportsDalec reports whether this operator version supports the --enable-dalec-nginx flag. Update the threshold here when a new released version ships with dalec support.
type RouteKind ¶ added in v0.2.23
type RouteKind interface {
// Name is a short, file-system-safe identifier (e.g. "http", "grpc", "tls"), used to derive
// per-kind namespace prefixes, CR names, hostnames, etc.
Name() string
// RouteObjectName returns the route object name to use given a base name.
RouteObjectName(baseName string) string
// Listener returns the gateway listener spec for this kind. HTTP/GRPC use HTTPS/443 with
// TLS terminate; TLS uses TLS/443 passthrough.
Listener(listenerName, tlsHost, keyvaultURI, serviceAccountName string) gatewayv1.Listener
// Route builds the route object attaching to the named gateway+listener and forwarding to
// the named backend service.
Route(namespace, name, gatewayName, listenerName, tlsHost, backendServiceName string, backendPort int32) client.Object
// ClientContents returns the embedded Go source compiled into the client pod.
ClientContents() string
// ServerContents returns the embedded Go source compiled into the backend server pod.
ServerContents() string
// ServicePortName is the name of the backend Service port. Istio uses the port-name prefix
// to detect application protocol (e.g. "grpc" → HTTP/2 + gRPC framing, "http" → HTTP/1.1).
ServicePortName() string
}
RouteKind describes a Gateway API route type (HTTPRoute, GRPCRoute, TLSRoute, ...) so the gateway e2e suite can exercise different route kinds with the same surrounding scaffolding (Gateway, ExternalDNS, KV cert, namespaces). Today only HTTPRouteKind is implemented.