diff --git a/apis/v1alpha1/backendpolicy_types.go b/apis/v1alpha1/backendpolicy_types.go index 70a689bcc8..86e5a492e7 100644 --- a/apis/v1alpha1/backendpolicy_types.go +++ b/apis/v1alpha1/backendpolicy_types.go @@ -31,16 +31,25 @@ import ( // implementation specific may be represented with similar implementation // specific custom resources. type BackendPolicy struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:",inline"` + // +optional metav1.ObjectMeta `json:"metadata,omitempty"` - Spec BackendPolicySpec `json:"spec,omitempty"` + // Spec defines the desired state of BackendPolicy. + // + // +optional + Spec BackendPolicySpec `json:"spec,omitempty"` + + // Status defines the current state of BackendPolicy. + // + // +optional + // +kubebuilder:default={conditions: {{type: "Admitted", status: "False", message: "Waiting for controller", reason: "Waiting", lastTransitionTime: "1970-01-01T00:00:00Z"}}} Status BackendPolicyStatus `json:"status,omitempty"` } // +kubebuilder:object:root=true -// BackendPolicyList contains a list of BackendPolicy +// BackendPolicyList contains a list of BackendPolicy. type BackendPolicyList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata,omitempty"` @@ -55,33 +64,43 @@ type BackendPolicySpec struct { // the oldest BackendPolicy. // // Support: Core + // + // +kubebuilder:validation:MinItems=1 // +kubebuilder:validation:MaxItems=16 BackendRefs []BackendRef `json:"backendRefs"` // TLS is the TLS configuration for these backends. // // Support: Extended + // // +optional - TLS *BackendTLSConfig `json:"tls,omitempty"` + TLS BackendTLSConfig `json:"tls,omitempty"` } // BackendRef identifies an API object within a known namespace that defaults // group to core and resource to services if unspecified. type BackendRef struct { // Group is the group of the referent. + // + // +kubebuilder:validation:MinLength=1 // +kubebuilder:validation:MaxLength=253 Group string `json:"group"` // Kind is the kind of the referent. + // + // +kubebuilder:validation:MinLength=1 // +kubebuilder:validation:MaxLength=253 - Kind string `json:"kind,omitempty"` + Kind string `json:"kind"` // Name is the name of the referent. + // + // +kubebuilder:validation:MinLength=1 // +kubebuilder:validation:MaxLength=253 Name string `json:"name"` // Port is the port of the referent. If unspecified, this policy applies to // all ports on the backend. + // // +optional Port *PortNumber `json:"port,omitempty"` } @@ -102,26 +121,28 @@ type BackendTLSConfig struct { // Support: Extended // // +optional - CertificateAuthorityRef *LocalObjectReference `json:"certificateAuthorityRef,omitempty"` + CertificateAuthorityRef LocalObjectReference `json:"certificateAuthorityRef,omitempty"` // Options are a list of key/value pairs to give extended options to the // provider. // // Support: Implementation-specific. + // // +optional Options map[string]string `json:"options,omitempty"` } // BackendPolicyStatus defines the observed state of BackendPolicy. Conditions -// that are related to a specific Route or Gateway should be placed on the +// that are related to a specific Route or Gateway must be placed on the // Route(s) using backends configured by this BackendPolicy. type BackendPolicyStatus struct { // Conditions describe the current conditions of the BackendPolicy. // // +listType=map // +listMapKey=type + // +kubebuilder:validation:MinItems=1 // +kubebuilder:validation:MaxItems=8 - Conditions []metav1.Condition `json:"conditions,omitempty"` + Conditions []metav1.Condition `json:"conditions"` } // BackendPolicyConditionType is a type of condition associated with a diff --git a/apis/v1alpha1/gateway_types.go b/apis/v1alpha1/gateway_types.go index d27ef1c515..551c177df7 100644 --- a/apis/v1alpha1/gateway_types.go +++ b/apis/v1alpha1/gateway_types.go @@ -34,18 +34,25 @@ import ( // This ensures that a GatewayClass associated with a Gateway(s) is not // deleted while in use. type Gateway struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:",inline"` + // +optional metav1.ObjectMeta `json:"metadata,omitempty"` + // Spec defines the desired state of Gateway. + // + // +optional Spec GatewaySpec `json:"spec,omitempty"` + // Status defines the current state of Gateway. + // + // +optional // +kubebuilder:default={conditions: {{type: "Scheduled", status: "False", reason:"NotReconciled", message:"Waiting for controller", lastTransitionTime: "1970-01-01T00:00:00Z"}}} Status GatewayStatus `json:"status,omitempty"` } // +kubebuilder:object:root=true -// GatewayList contains a list of Gateway +// GatewayList contains a list of Gateway. type GatewayList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata,omitempty"` @@ -61,6 +68,7 @@ type GatewayList struct { type GatewaySpec struct { // GatewayClassName used for this Gateway. This is the name of a // GatewayClass resource. + // // +kubebuilder:validation:MinLength=1 // +kubebuilder:validation:MaxLength=253 GatewayClassName string `json:"gatewayClassName"` @@ -293,8 +301,9 @@ type TLSOverridePolicy struct { // // Support: Core // + // +optional // +kubebuilder:default=Deny - Certificate TLSRouteOverrideType `json:"certificate"` + Certificate TLSRouteOverrideType `json:"certificate,omitempty"` } // GatewayTLSConfig describes a TLS configuration. @@ -319,6 +328,7 @@ type GatewayTLSConfig struct { // // Support: Core // + // +optional // +kubebuilder:default=Terminate Mode TLSModeType `json:"mode,omitempty"` @@ -349,6 +359,7 @@ type GatewayTLSConfig struct { // // Support: Core // + // +optional // +kubebuilder:default={certificate:Deny} RouteOverride TLSOverridePolicy `json:"routeOverride,omitempty"` @@ -363,7 +374,7 @@ type GatewayTLSConfig struct { // Support: Implementation-specific. // // +optional - Options map[string]string `json:"options"` + Options map[string]string `json:"options,omitempty"` } // TLSModeType type defines behavior of gateway with TLS protocol. @@ -391,8 +402,10 @@ type RouteBindingSelector struct { // default. // // Support: Core - // +kubebuilder:default={from: "Same"} - Namespaces *RouteNamespaces `json:"namespaces,omitempty"` + // + // +optional + // +kubebuilder:default={from: Same} + Namespaces RouteNamespaces `json:"namespaces,omitempty"` // Selector specifies a set of route labels used for selecting // routes to associate with the Gateway. If this Selector is defined, // only routes matching the Selector are associated with the Gateway. @@ -418,10 +431,11 @@ type RouteBindingSelector struct { // // Support: Core // + // +optional // +kubebuilder:default=networking.x-k8s.io // +kubebuilder:validation:MinLength=1 // +kubebuilder:validation:MaxLength=253 - Group string `json:"group,omitempty"` + Group *string `json:"group,omitempty"` // Kind is the kind of the route resource to select. // // Kind MUST correspond to kinds of routes that are compatible with the @@ -436,8 +450,8 @@ type RouteBindingSelector struct { } // RouteSelectType specifies where Routes should be selected by a Gateway. +// // +kubebuilder:validation:Enum=All;Selector;Same -// +kubebuilder:default=Same type RouteSelectType string const ( @@ -462,6 +476,9 @@ type RouteNamespaces struct { // * Same: Only Routes in the same namespace may be used by this Gateway. // // Support: Core + // + // +optional + // +kubebuilder:default=Same From RouteSelectType `json:"from,omitempty"` // Selector must be specified when From is set to "Selector". In that case, @@ -480,6 +497,7 @@ type GatewayAddress struct { // // Support: Extended // + // +optional // +kubebuilder:default=IPAddress Type AddressType `json:"type,omitempty"` @@ -540,7 +558,7 @@ type GatewayStatus struct { // // +optional // +kubebuilder:validation:MaxItems=16 - Addresses []GatewayAddress `json:"addresses"` + Addresses []GatewayAddress `json:"addresses,omitempty"` // Conditions describe the current conditions of the Gateway. // @@ -554,6 +572,7 @@ type GatewayStatus struct { // * "Scheduled" // * "Ready" // + // +optional // +listType=map // +listMapKey=type // +kubebuilder:validation:MaxItems=8 diff --git a/apis/v1alpha1/gatewayclass_types.go b/apis/v1alpha1/gatewayclass_types.go index 0bb214a8a4..e57af61e33 100644 --- a/apis/v1alpha1/gatewayclass_types.go +++ b/apis/v1alpha1/gatewayclass_types.go @@ -33,15 +33,19 @@ import ( // for creating Gateway resources. // // GatewayClass is a Cluster level resource. -// -// Support: Core. type GatewayClass struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:",inline"` + // +optional metav1.ObjectMeta `json:"metadata,omitempty"` - // Spec for this GatewayClass. + // Spec defines the desired state of GatewayClass. + // + // +optional Spec GatewayClassSpec `json:"spec,omitempty"` - // Status of the GatewayClass. + + // Status defines the current state of GatewayClass. + // + // +optional // +kubebuilder:default={conditions: {{type: "Admitted", status: "False", message: "Waiting for controller", reason: "Waiting", lastTransitionTime: "1970-01-01T00:00:00Z"}}} Status GatewayClassStatus `json:"status,omitempty"` } @@ -77,7 +81,7 @@ type GatewayClassSpec struct { // Support: Custom // // +optional - ParametersRef *LocalObjectReference `json:"parametersRef,omitempty"` + ParametersRef LocalObjectReference `json:"parametersRef,omitempty"` } // GatewayClassConditionType is the type of status conditions. This @@ -115,6 +119,7 @@ type GatewayClassStatus struct { // Conditions is the current status from the controller for // this GatewayClass. // + // +optional // +listType=map // +listMapKey=type // +kubebuilder:validation:MaxItems=8 diff --git a/apis/v1alpha1/httproute_types.go b/apis/v1alpha1/httproute_types.go index 895f3c4404..3db386f10b 100644 --- a/apis/v1alpha1/httproute_types.go +++ b/apis/v1alpha1/httproute_types.go @@ -27,16 +27,24 @@ import ( // HTTPRoute is the Schema for the HTTPRoute resource. type HTTPRoute struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:",inline"` + // +optional metav1.ObjectMeta `json:"metadata,omitempty"` - Spec HTTPRouteSpec `json:"spec,omitempty"` + // Spec defines the desired state of HTTPRoute. + // + // +optional + Spec HTTPRouteSpec `json:"spec,omitempty"` + + // Status defines the current state of HTTPRoute. + // + // +optional Status HTTPRouteStatus `json:"status,omitempty"` } // +kubebuilder:object:root=true -// HTTPRouteList contains a list of HTTPRoute +// HTTPRouteList contains a list of HTTPRoute. type HTTPRouteList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata,omitempty"` @@ -46,6 +54,8 @@ type HTTPRouteList struct { // HTTPRouteSpec defines the desired state of HTTPRoute type HTTPRouteSpec struct { // Gateways defines which Gateways can use this Route. + // + // +optional // +kubebuilder:default={allow: "SameNamespace"} Gateways RouteGateways `json:"gateways,omitempty"` @@ -104,9 +114,10 @@ type HTTPRouteSpec struct { // Rules are a list of HTTP matchers, filters and actions. // - // +kubebuilder:validation:MinItems=1 + // +optional // +kubebuilder:validation:MaxItems=16 - Rules []HTTPRouteRule `json:"rules"` + // +kubebuilder:default={{matches: {{path: {type: "Prefix", value: "/"}}}}} + Rules []HTTPRouteRule `json:"rules,omitempty"` } // RouteTLSConfig describes a TLS configuration defined at the Route level. @@ -119,10 +130,10 @@ type RouteTLSConfig struct { // string for both the group and kind, the resource defaults to "secrets". // An implementation may support other resources (for example, resource // "mycertificates" in group "networking.acme.io"). + // // Support: Core (Kubernetes Secrets) // Support: Implementation-specific (Other resource types) // - // +required CertificateRef LocalObjectReference `json:"certificateRef"` } @@ -172,8 +183,10 @@ type HTTPRouteRule struct { // a Route with a creation timestamp of "2020-09-08 01:02:04". // * The Route appearing first in alphabetical order (namespace/name) for // example, foo/bar is given precedence over foo/baz. - // +kubebuilder:default={{path:{ type: "Prefix", value: "/"}}} + // + // +optional // +kubebuilder:validation:MaxItems=8 + // +kubebuilder:default={{path:{ type: "Prefix", value: "/"}}} Matches []HTTPRouteMatch `json:"matches,omitempty"` // Filters define the filters that are applied to requests that match @@ -260,6 +273,7 @@ type HTTPPathMatch struct { // Please read the implementation's documentation to determine the supported // dialect. // + // +optional // +kubebuilder:default=Prefix Type PathMatchType `json:"type,omitempty"` @@ -284,6 +298,7 @@ type HTTPHeaderMatch struct { // // HTTP Header name matching MUST be case-insensitive (RFC 2616 - section 4.2). // + // +optional // +kubebuilder:default=Exact Type HeaderMatchType `json:"type,omitempty"` @@ -318,13 +333,14 @@ type HTTPRouteMatch struct { // Path specifies a HTTP request path matcher. If this field is not // specified, a default prefix match on the "/" path is provided. // + // +optional // +kubebuilder:default={type: "Prefix", value: "/"} Path HTTPPathMatch `json:"path,omitempty"` // Headers specifies a HTTP request header matcher. // // +optional - Headers *HTTPHeaderMatch `json:"headers"` + Headers HTTPHeaderMatch `json:"headers,omitempty"` // ExtensionRef is an optional, implementation-specific extension to the // "match" behavior. For example, resource "myroutematcher" in group @@ -381,14 +397,14 @@ type HTTPRouteFilter struct { // Support: Core // // +optional - RequestHeaderModifier *HTTPRequestHeaderFilter `json:"requestHeaderModifier,omitempty"` + RequestHeaderModifier HTTPRequestHeaderFilter `json:"requestHeaderModifier,omitempty"` // RequestMirror defines a schema for a filter that mirrors requests. // // Support: Extended // // +optional - RequestMirror *HTTPRequestMirrorFilter `json:"requestMirror,omitempty"` + RequestMirror HTTPRequestMirrorFilter `json:"requestMirror,omitempty"` // ExtensionRef is an optional, implementation-specific extension to the // "filter" behavior. For example, resource "myroutefilter" in group @@ -398,7 +414,7 @@ type HTTPRouteFilter struct { // Support: Implementation-specific // // +optional - ExtensionRef *LocalObjectReference `json:"extensionRef,omitempty"` + ExtensionRef LocalObjectReference `json:"extensionRef,omitempty"` } // HTTPRouteFilterType identifies a type of HTTPRoute filter. @@ -447,6 +463,7 @@ type HTTPRequestHeaderFilter struct { // my-header: bar // // Support: Extended + // // +optional Set map[string]string `json:"set,omitempty"` @@ -467,6 +484,7 @@ type HTTPRequestHeaderFilter struct { // my-header: bar // // Support: Extended + // // +optional Add map[string]string `json:"add,omitempty"` @@ -489,6 +507,7 @@ type HTTPRequestHeaderFilter struct { // my-header2: bar // // Support: Extended + // // +optional // +kubebuilder:validation:MaxItems=16 Remove []string `json:"remove,omitempty"` @@ -524,7 +543,7 @@ type HTTPRequestMirrorFilter struct { // Support: Custom // // +optional - BackendRef *LocalObjectReference `json:"backendRef,omitempty"` + BackendRef LocalObjectReference `json:"backendRef,omitempty"` // Port specifies the destination port number to use for the // backend referenced by the ServiceName or BackendRef field. @@ -573,7 +592,7 @@ type HTTPRouteForwardTo struct { // Support: Custom // // +optional - BackendRef *LocalObjectReference `json:"backendRef,omitempty"` + BackendRef LocalObjectReference `json:"backendRef,omitempty"` // Port specifies the destination port number to use for the // backend referenced by the ServiceName or BackendRef field. @@ -596,10 +615,11 @@ type HTTPRouteForwardTo struct { // // Support: Core // + // +optional // +kubebuilder:default=1 // +kubebuilder:validation:Minimum=0 // +kubebuilder:validation:Maximum=1000000 - Weight int32 `json:"weight,omitempty"` + Weight *int32 `json:"weight,omitempty"` // Filters defined at this-level should be executed if and only if the // request is being forwarded to the backend defined here. diff --git a/apis/v1alpha1/local_object_reference_types.go b/apis/v1alpha1/local_object_reference_types.go index 287502dac5..c902a3b6ed 100644 --- a/apis/v1alpha1/local_object_reference_types.go +++ b/apis/v1alpha1/local_object_reference_types.go @@ -19,14 +19,19 @@ package v1alpha1 // LocalObjectReference identifies an API object within a known namespace. type LocalObjectReference struct { // Group is the group of the referent. + // // +kubebuilder:validation:MinLength=1 // +kubebuilder:validation:MaxLength=253 Group string `json:"group"` + // Kind is kind of the referent. + // // +kubebuilder:validation:MinLength=1 // +kubebuilder:validation:MaxLength=253 Kind string `json:"kind"` + // Name is the name of the referent. + // // +kubebuilder:validation:MinLength=1 // +kubebuilder:validation:MaxLength=253 Name string `json:"name"` diff --git a/apis/v1alpha1/shared_types.go b/apis/v1alpha1/shared_types.go index 88adececb1..0684492b40 100644 --- a/apis/v1alpha1/shared_types.go +++ b/apis/v1alpha1/shared_types.go @@ -62,13 +62,18 @@ type RouteGateways struct { // * All: Gateways in any namespace can use this route. // * FromList: Only Gateways specified in GatewayRefs may use this route. // * SameNamespace: Only Gateways in the same namespace may use this route. + // + // +optional // +kubebuilder:validation:Enum=All;FromList;SameNamespace // +kubebuilder:default=SameNamespace Allow GatewayAllowType `json:"allow,omitempty"` + // GatewayRefs must be specified when Allow is set to "FromList". In that // case, only Gateways referenced in this list will be allowed to use this // route. This field is ignored for other values of "Allow". + // // +optional + // +kubebuilder:validation:MaxItems=16 GatewayRefs []GatewayReference `json:"gatewayRefs,omitempty"` } @@ -81,10 +86,13 @@ type PortNumber int32 // GatewayReference identifies a Gateway in a specified namespace. type GatewayReference struct { // Name is the name of the referent. + // // +kubebuilder:validation:MinLength=1 // +kubebuilder:validation:MaxLength=253 Name string `json:"name"` + // Namespace is the namespace of the referent. + // // +kubebuilder:validation:MinLength=1 // +kubebuilder:validation:MaxLength=253 Namespace string `json:"namespace"` @@ -130,13 +138,17 @@ type RouteForwardTo struct { // Support: Custom // // +optional - BackendRef *LocalObjectReference `json:"backendRef,omitempty"` + BackendRef LocalObjectReference `json:"backendRef,omitempty"` // Port specifies the destination port number to use for the // backend referenced by the ServiceName or BackendRef field. + // If unspecified, the destination port in the request is used + // when forwarding to a backendRef or serviceName. // // Support: Core - Port PortNumber `json:"port"` + // + // +optional + Port *PortNumber `json:"port,omitempty"` // Weight specifies the proportion of HTTP requests forwarded to the backend // referenced by the ServiceName or BackendRef field. This is computed as @@ -152,10 +164,11 @@ type RouteForwardTo struct { // // Support: Extended // + // +optional // +kubebuilder:default=1 // +kubebuilder:validation:Minimum=0 // +kubebuilder:validation:Maximum=1000000 - Weight int32 `json:"weight,omitempty"` + Weight *int32 `json:"weight,omitempty"` } // RouteConditionType is a type of condition for a route. @@ -173,6 +186,7 @@ type RouteGatewayStatus struct { // GatewayRef is a reference to a Gateway object that is associated with // the route. GatewayRef GatewayReference `json:"gatewayRef"` + // Conditions describes the status of the route with respect to the // Gateway. For example, the "Admitted" condition indicates whether the // route has been admitted or rejected by the Gateway, and why. Note diff --git a/apis/v1alpha1/tcproute_types.go b/apis/v1alpha1/tcproute_types.go index 1e33e253a5..9c8d670ecb 100644 --- a/apis/v1alpha1/tcproute_types.go +++ b/apis/v1alpha1/tcproute_types.go @@ -26,10 +26,18 @@ import ( // TCPRoute is the Schema for the TCPRoute resource. type TCPRoute struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:",inline"` + // +optional metav1.ObjectMeta `json:"metadata,omitempty"` - Spec TCPRouteSpec `json:"spec,omitempty"` + // Spec defines the desired state of TCPRoute. + // + // +optional + Spec TCPRouteSpec `json:"spec,omitempty"` + + // Status defines the current state of TCPRoute. + // + // +optional Status TCPRouteStatus `json:"status,omitempty"` } @@ -43,6 +51,7 @@ type TCPRouteSpec struct { // Gateways defines which Gateways can use this Route. // + // +optional // +kubebuilder:default={allow: "SameNamespace"} Gateways RouteGateways `json:"gateways,omitempty"` } @@ -86,7 +95,7 @@ type TCPRouteMatch struct { // Support: custom // // +optional - ExtensionRef *LocalObjectReference `json:"extensionRef,omitempty"` + ExtensionRef LocalObjectReference `json:"extensionRef,omitempty"` } // +kubebuilder:object:root=true diff --git a/apis/v1alpha1/tlsroute_types.go b/apis/v1alpha1/tlsroute_types.go index 5b2758bd23..834f89111a 100644 --- a/apis/v1alpha1/tlsroute_types.go +++ b/apis/v1alpha1/tlsroute_types.go @@ -31,14 +31,22 @@ import ( // If you need to forward traffic to a single target for a TLS listener, you // could chose to use a TCPRoute with a TLS listener. type TLSRoute struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:",inline"` + // +optional metav1.ObjectMeta `json:"metadata,omitempty"` - Spec TLSRouteSpec `json:"spec,omitempty"` + // Spec defines the desired state of TLSRoute. + // + // +optional + Spec TLSRouteSpec `json:"spec,omitempty"` + + // Status defines the current state of TLSRoute. + // + // +optional Status TLSRouteStatus `json:"status,omitempty"` } -// TLSRouteSpec defines the desired state of TLSRoute +// TLSRouteSpec defines the desired state of TLSRoute. type TLSRouteSpec struct { // Rules are a list of TLS matchers and actions. // @@ -47,6 +55,8 @@ type TLSRouteSpec struct { Rules []TLSRouteRule `json:"rules"` // Gateways defines which Gateways can use this Route. + // + // +optional // +kubebuilder:default={allow: "SameNamespace"} Gateways RouteGateways `json:"gateways,omitempty"` } @@ -105,6 +115,7 @@ type TLSRouteMatch struct { // +optional // +kubebuilder:validation:MaxItems=16 SNIs []Hostname `json:"snis,omitempty"` + // ExtensionRef is an optional, implementation-specific extension to the // "match" behavior. For example, resource "mytlsroutematcher" in group // "networking.acme.io". If the referent cannot be found, the rule is not @@ -116,7 +127,7 @@ type TLSRouteMatch struct { // Support: custom // // +optional - ExtensionRef *LocalObjectReference `json:"extensionRef,omitempty"` + ExtensionRef LocalObjectReference `json:"extensionRef,omitempty"` } // +kubebuilder:object:root=true diff --git a/apis/v1alpha1/udproute_types.go b/apis/v1alpha1/udproute_types.go index 128f84b8ad..a44820d172 100644 --- a/apis/v1alpha1/udproute_types.go +++ b/apis/v1alpha1/udproute_types.go @@ -26,10 +26,18 @@ import ( // UDPRoute is the Schema for the UDPRoute resource. type UDPRoute struct { - metav1.TypeMeta `json:",inline"` + metav1.TypeMeta `json:",inline"` + // +optional metav1.ObjectMeta `json:"metadata,omitempty"` - Spec UDPRouteSpec `json:"spec,omitempty"` + // Spec defines the desired state of UDPRoute. + // + // +optional + Spec UDPRouteSpec `json:"spec,omitempty"` + + // Status defines the current state of UDPRoute. + // + // +optional Status UDPRouteStatus `json:"status,omitempty"` } @@ -42,6 +50,8 @@ type UDPRouteSpec struct { Rules []UDPRouteRule `json:"rules"` // Gateways defines which Gateways can use this Route. + // + // +optional // +kubebuilder:default={allow: "SameNamespace"} Gateways RouteGateways `json:"gateways,omitempty"` } @@ -85,7 +95,7 @@ type UDPRouteMatch struct { // Support: custom // // +optional - ExtensionRef *LocalObjectReference `json:"extensionRef,omitempty"` + ExtensionRef LocalObjectReference `json:"extensionRef,omitempty"` } // +kubebuilder:object:root=true diff --git a/apis/v1alpha1/zz_generated.deepcopy.go b/apis/v1alpha1/zz_generated.deepcopy.go index 87d0fd3266..737bff325f 100644 --- a/apis/v1alpha1/zz_generated.deepcopy.go +++ b/apis/v1alpha1/zz_generated.deepcopy.go @@ -94,11 +94,7 @@ func (in *BackendPolicySpec) DeepCopyInto(out *BackendPolicySpec) { (*in)[i].DeepCopyInto(&(*out)[i]) } } - if in.TLS != nil { - in, out := &in.TLS, &out.TLS - *out = new(BackendTLSConfig) - (*in).DeepCopyInto(*out) - } + in.TLS.DeepCopyInto(&out.TLS) } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackendPolicySpec. @@ -156,11 +152,7 @@ func (in *BackendRef) DeepCopy() *BackendRef { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *BackendTLSConfig) DeepCopyInto(out *BackendTLSConfig) { *out = *in - if in.CertificateAuthorityRef != nil { - in, out := &in.CertificateAuthorityRef, &out.CertificateAuthorityRef - *out = new(LocalObjectReference) - **out = **in - } + out.CertificateAuthorityRef = in.CertificateAuthorityRef if in.Options != nil { in, out := &in.Options, &out.Options *out = make(map[string]string, len(*in)) @@ -227,7 +219,7 @@ func (in *GatewayClass) DeepCopyInto(out *GatewayClass) { *out = *in out.TypeMeta = in.TypeMeta in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) + out.Spec = in.Spec in.Status.DeepCopyInto(&out.Status) } @@ -284,11 +276,7 @@ func (in *GatewayClassList) DeepCopyObject() runtime.Object { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *GatewayClassSpec) DeepCopyInto(out *GatewayClassSpec) { *out = *in - if in.ParametersRef != nil { - in, out := &in.ParametersRef, &out.ParametersRef - *out = new(LocalObjectReference) - **out = **in - } + out.ParametersRef = in.ParametersRef } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GatewayClassSpec. @@ -534,11 +522,7 @@ func (in *HTTPRequestMirrorFilter) DeepCopyInto(out *HTTPRequestMirrorFilter) { *out = new(string) **out = **in } - if in.BackendRef != nil { - in, out := &in.BackendRef, &out.BackendRef - *out = new(LocalObjectReference) - **out = **in - } + out.BackendRef = in.BackendRef } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HTTPRequestMirrorFilter. @@ -581,21 +565,9 @@ func (in *HTTPRoute) DeepCopyObject() runtime.Object { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *HTTPRouteFilter) DeepCopyInto(out *HTTPRouteFilter) { *out = *in - if in.RequestHeaderModifier != nil { - in, out := &in.RequestHeaderModifier, &out.RequestHeaderModifier - *out = new(HTTPRequestHeaderFilter) - (*in).DeepCopyInto(*out) - } - if in.RequestMirror != nil { - in, out := &in.RequestMirror, &out.RequestMirror - *out = new(HTTPRequestMirrorFilter) - (*in).DeepCopyInto(*out) - } - if in.ExtensionRef != nil { - in, out := &in.ExtensionRef, &out.ExtensionRef - *out = new(LocalObjectReference) - **out = **in - } + in.RequestHeaderModifier.DeepCopyInto(&out.RequestHeaderModifier) + in.RequestMirror.DeepCopyInto(&out.RequestMirror) + out.ExtensionRef = in.ExtensionRef } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HTTPRouteFilter. @@ -616,9 +588,10 @@ func (in *HTTPRouteForwardTo) DeepCopyInto(out *HTTPRouteForwardTo) { *out = new(string) **out = **in } - if in.BackendRef != nil { - in, out := &in.BackendRef, &out.BackendRef - *out = new(LocalObjectReference) + out.BackendRef = in.BackendRef + if in.Weight != nil { + in, out := &in.Weight, &out.Weight + *out = new(int32) **out = **in } if in.Filters != nil { @@ -676,11 +649,7 @@ func (in *HTTPRouteList) DeepCopyObject() runtime.Object { func (in *HTTPRouteMatch) DeepCopyInto(out *HTTPRouteMatch) { *out = *in out.Path = in.Path - if in.Headers != nil { - in, out := &in.Headers, &out.Headers - *out = new(HTTPHeaderMatch) - (*in).DeepCopyInto(*out) - } + in.Headers.DeepCopyInto(&out.Headers) if in.ExtensionRef != nil { in, out := &in.ExtensionRef, &out.ExtensionRef *out = new(LocalObjectReference) @@ -854,12 +823,13 @@ func (in *LocalObjectReference) DeepCopy() *LocalObjectReference { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *RouteBindingSelector) DeepCopyInto(out *RouteBindingSelector) { *out = *in - if in.Namespaces != nil { - in, out := &in.Namespaces, &out.Namespaces - *out = new(RouteNamespaces) - (*in).DeepCopyInto(*out) - } + in.Namespaces.DeepCopyInto(&out.Namespaces) in.Selector.DeepCopyInto(&out.Selector) + if in.Group != nil { + in, out := &in.Group, &out.Group + *out = new(string) + **out = **in + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RouteBindingSelector. @@ -880,9 +850,15 @@ func (in *RouteForwardTo) DeepCopyInto(out *RouteForwardTo) { *out = new(string) **out = **in } - if in.BackendRef != nil { - in, out := &in.BackendRef, &out.BackendRef - *out = new(LocalObjectReference) + out.BackendRef = in.BackendRef + if in.Port != nil { + in, out := &in.Port, &out.Port + *out = new(PortNumber) + **out = **in + } + if in.Weight != nil { + in, out := &in.Weight, &out.Weight + *out = new(int32) **out = **in } } @@ -1056,11 +1032,7 @@ func (in *TCPRouteList) DeepCopyObject() runtime.Object { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *TCPRouteMatch) DeepCopyInto(out *TCPRouteMatch) { *out = *in - if in.ExtensionRef != nil { - in, out := &in.ExtensionRef, &out.ExtensionRef - *out = new(LocalObjectReference) - **out = **in - } + out.ExtensionRef = in.ExtensionRef } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TCPRouteMatch. @@ -1079,9 +1051,7 @@ func (in *TCPRouteRule) DeepCopyInto(out *TCPRouteRule) { if in.Matches != nil { in, out := &in.Matches, &out.Matches *out = make([]TCPRouteMatch, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } + copy(*out, *in) } if in.ForwardTo != nil { in, out := &in.ForwardTo, &out.ForwardTo @@ -1223,11 +1193,7 @@ func (in *TLSRouteMatch) DeepCopyInto(out *TLSRouteMatch) { *out = make([]Hostname, len(*in)) copy(*out, *in) } - if in.ExtensionRef != nil { - in, out := &in.ExtensionRef, &out.ExtensionRef - *out = new(LocalObjectReference) - **out = **in - } + out.ExtensionRef = in.ExtensionRef } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TLSRouteMatch. @@ -1370,11 +1336,7 @@ func (in *UDPRouteList) DeepCopyObject() runtime.Object { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *UDPRouteMatch) DeepCopyInto(out *UDPRouteMatch) { *out = *in - if in.ExtensionRef != nil { - in, out := &in.ExtensionRef, &out.ExtensionRef - *out = new(LocalObjectReference) - **out = **in - } + out.ExtensionRef = in.ExtensionRef } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UDPRouteMatch. @@ -1393,9 +1355,7 @@ func (in *UDPRouteRule) DeepCopyInto(out *UDPRouteRule) { if in.Matches != nil { in, out := &in.Matches, &out.Matches *out = make([]UDPRouteMatch, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } + copy(*out, *in) } if in.ForwardTo != nil { in, out := &in.ForwardTo, &out.ForwardTo diff --git a/config/crd/bases/networking.x-k8s.io_backendpolicies.yaml b/config/crd/bases/networking.x-k8s.io_backendpolicies.yaml index fb094a2c92..4d593a1101 100644 --- a/config/crd/bases/networking.x-k8s.io_backendpolicies.yaml +++ b/config/crd/bases/networking.x-k8s.io_backendpolicies.yaml @@ -32,7 +32,7 @@ spec: metadata: type: object spec: - description: BackendPolicySpec defines desired policy for a backend. + description: Spec defines the desired state of BackendPolicy. properties: backendRefs: description: "BackendRefs define which backends this policy should be applied to. This policy can only apply to backends within the same namespace. If more than one BackendPolicy targets the same backend, precedence must be given to the oldest BackendPolicy. \n Support: Core" @@ -42,14 +42,17 @@ spec: group: description: Group is the group of the referent. maxLength: 253 + minLength: 1 type: string kind: description: Kind is the kind of the referent. maxLength: 253 + minLength: 1 type: string name: description: Name is the name of the referent. maxLength: 253 + minLength: 1 type: string port: description: Port is the port of the referent. If unspecified, this policy applies to all ports on the backend. @@ -59,9 +62,11 @@ spec: type: integer required: - group + - kind - name type: object maxItems: 16 + minItems: 1 type: array tls: description: "TLS is the TLS configuration for these backends. \n Support: Extended" @@ -99,7 +104,14 @@ spec: - backendRefs type: object status: - description: BackendPolicyStatus defines the observed state of BackendPolicy. Conditions that are related to a specific Route or Gateway should be placed on the Route(s) using backends configured by this BackendPolicy. + default: + conditions: + - lastTransitionTime: "1970-01-01T00:00:00Z" + message: Waiting for controller + reason: Waiting + status: "False" + type: Admitted + description: Status defines the current state of BackendPolicy. properties: conditions: description: Conditions describe the current conditions of the BackendPolicy. @@ -145,10 +157,13 @@ spec: - type type: object maxItems: 8 + minItems: 1 type: array x-kubernetes-list-map-keys: - type x-kubernetes-list-type: map + required: + - conditions type: object type: object served: true diff --git a/config/crd/bases/networking.x-k8s.io_gatewayclasses.yaml b/config/crd/bases/networking.x-k8s.io_gatewayclasses.yaml index 3bdf118f62..ac483b4168 100644 --- a/config/crd/bases/networking.x-k8s.io_gatewayclasses.yaml +++ b/config/crd/bases/networking.x-k8s.io_gatewayclasses.yaml @@ -25,7 +25,7 @@ spec: name: v1alpha1 schema: openAPIV3Schema: - description: "GatewayClass describes a class of Gateways available to the user for creating Gateway resources. \n GatewayClass is a Cluster level resource. \n Support: Core." + description: "GatewayClass describes a class of Gateways available to the user for creating Gateway resources. \n GatewayClass is a Cluster level resource." properties: apiVersion: description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' @@ -36,7 +36,7 @@ spec: metadata: type: object spec: - description: Spec for this GatewayClass. + description: Spec defines the desired state of GatewayClass. properties: controller: description: "Controller is a domain/path string that indicates the controller that is managing Gateways of this class. \n Example: \"acme.io/gateway-controller\". \n This field is not mutable and cannot be empty. \n The format of this field is DOMAIN \"/\" PATH, where DOMAIN and PATH are valid Kubernetes names (https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names). \n Support: Core" @@ -76,7 +76,7 @@ spec: reason: Waiting status: "False" type: Admitted - description: Status of the GatewayClass. + description: Status defines the current state of GatewayClass. properties: conditions: default: diff --git a/config/crd/bases/networking.x-k8s.io_gateways.yaml b/config/crd/bases/networking.x-k8s.io_gateways.yaml index 4b784f5053..4f9511d0d2 100644 --- a/config/crd/bases/networking.x-k8s.io_gateways.yaml +++ b/config/crd/bases/networking.x-k8s.io_gateways.yaml @@ -36,7 +36,7 @@ spec: metadata: type: object spec: - description: "GatewaySpec defines the desired state of Gateway. \n Not all possible combinations of options specified in the Spec are valid. Some invalid configurations can be caught synchronously via a webhook, but there are many cases that will require asynchronous signaling via the GatewayStatus block." + description: Spec defines the desired state of Gateway. properties: addresses: description: "Addresses requested for this gateway. This is optional and behavior can depend on the GatewayClass. If a value is set in the spec and the requested address is invalid, the GatewayClass MUST indicate this in the associated entry in GatewayStatus.Addresses. \n If no Addresses are specified, the GatewayClass may schedule the Gateway in an implementation-defined manner, assigning an appropriate set of Addresses. \n The GatewayClass MUST bind all Listeners to every GatewayAddress that it assigns to the Gateway. \n Support: Core" @@ -102,6 +102,7 @@ spec: description: "Namespaces indicates in which namespaces Routes should be selected for this Gateway. This is restricted to the namespace of this Gateway by default. \n Support: Core" properties: from: + default: Same description: "From indicates where Routes will be selected for this Gateway. Possible values are: * All: Routes in all namespaces may be used by this Gateway. * Selector: Routes in namespaces selected by the selector may be used by this Gateway. * Same: Only Routes in the same namespace may be used by this Gateway. \n Support: Core" enum: - All @@ -222,8 +223,6 @@ spec: - Allow - Deny type: string - required: - - certificate type: object type: object required: @@ -246,7 +245,7 @@ spec: reason: NotReconciled status: "False" type: Scheduled - description: GatewayStatus defines the observed state of Gateway. + description: Status defines the current state of Gateway. properties: addresses: description: "Addresses lists the IP addresses that have actually been bound to the Gateway. These addresses may differ from the addresses in the Spec, e.g. if the Gateway automatically assigns an address from a reserved pool. \n These addresses should all be of type \"IPAddress\"." diff --git a/config/crd/bases/networking.x-k8s.io_httproutes.yaml b/config/crd/bases/networking.x-k8s.io_httproutes.yaml index d9d1faed63..a87231b8f6 100644 --- a/config/crd/bases/networking.x-k8s.io_httproutes.yaml +++ b/config/crd/bases/networking.x-k8s.io_httproutes.yaml @@ -34,7 +34,7 @@ spec: metadata: type: object spec: - description: HTTPRouteSpec defines the desired state of HTTPRoute + description: Spec defines the desired state of HTTPRoute. properties: gateways: default: @@ -68,6 +68,7 @@ spec: - name - namespace type: object + maxItems: 16 type: array type: object hostnames: @@ -80,6 +81,11 @@ spec: maxItems: 16 type: array rules: + default: + - matches: + - path: + type: Prefix + value: / description: Rules are a list of HTTP matchers, filters and actions. items: description: HTTPRouteRule defines semantics for matching an HTTP request based on conditions, optionally executing additional processing steps, and forwarding the request to an API object. @@ -410,13 +416,12 @@ spec: type: array type: object maxItems: 16 - minItems: 1 type: array tls: description: "TLS defines the TLS certificate to use for Hostnames defined in this Route. This configuration only takes effect if the AllowRouteOverride field is set to true in the associated Gateway resource. \n Collisions can happen if multiple HTTPRoutes define a TLS certificate for the same hostname. In such a case, conflict resolution guiding principles apply, specificallly, if hostnames are same and two different certificates are specified then the certificate in the oldest resource wins. \n Please note that HTTP Route-selection takes place after the TLS Handshake (ClientHello). Due to this, TLS certificate defined here will take precedence even if the request has the potential to match multiple routes (in case multiple HTTPRoutes share the same hostname). \n Support: Core" properties: certificateRef: - description: 'CertificateRef refers to a Kubernetes object that contains a TLS certificate and private key. This certificate MUST be used for TLS handshakes for the domain this RouteTLSConfig is associated with. If an entry in this list omits or specifies the empty string for both the group and kind, the resource defaults to "secrets". An implementation may support other resources (for example, resource "mycertificates" in group "networking.acme.io"). Support: Core (Kubernetes Secrets) Support: Implementation-specific (Other resource types)' + description: "CertificateRef refers to a Kubernetes object that contains a TLS certificate and private key. This certificate MUST be used for TLS handshakes for the domain this RouteTLSConfig is associated with. If an entry in this list omits or specifies the empty string for both the group and kind, the resource defaults to \"secrets\". An implementation may support other resources (for example, resource \"mycertificates\" in group \"networking.acme.io\"). \n Support: Core (Kubernetes Secrets) Support: Implementation-specific (Other resource types)" properties: group: description: Group is the group of the referent. @@ -441,11 +446,9 @@ spec: required: - certificateRef type: object - required: - - rules type: object status: - description: HTTPRouteStatus defines the observed state of HTTPRoute. + description: Status defines the current state of HTTPRoute. properties: gateways: description: "Gateways is a list of Gateways that are associated with the route, and the status of the route with respect to each Gateway. When a Gateway selects this route, the controller that manages the Gateway must add an entry to this list when the controller first sees the route and should update the entry as appropriate when the route is modified. \n A minimum of 1 and a maximum of 100 Gateways will be represented in this list. If the list is full, additional Gateways may be using this Route that are not included in the list. An empty list means the route has not been admitted by any Gateway." diff --git a/config/crd/bases/networking.x-k8s.io_tcproutes.yaml b/config/crd/bases/networking.x-k8s.io_tcproutes.yaml index 3e2a684540..ac06d48bc5 100644 --- a/config/crd/bases/networking.x-k8s.io_tcproutes.yaml +++ b/config/crd/bases/networking.x-k8s.io_tcproutes.yaml @@ -30,7 +30,7 @@ spec: metadata: type: object spec: - description: TCPRouteSpec defines the desired state of TCPRoute + description: Spec defines the desired state of TCPRoute. properties: gateways: default: @@ -64,6 +64,7 @@ spec: - name - namespace type: object + maxItems: 16 type: array type: object rules: @@ -100,7 +101,7 @@ spec: - name type: object port: - description: "Port specifies the destination port number to use for the backend referenced by the ServiceName or BackendRef field. \n Support: Core" + description: "Port specifies the destination port number to use for the backend referenced by the ServiceName or BackendRef field. If unspecified, the destination port in the request is used when forwarding to a backendRef or serviceName. \n Support: Core" format: int32 maximum: 65535 minimum: 1 @@ -116,8 +117,6 @@ spec: maximum: 1000000 minimum: 0 type: integer - required: - - port type: object maxItems: 16 minItems: 1 @@ -163,7 +162,7 @@ spec: - rules type: object status: - description: TCPRouteStatus defines the observed state of TCPRoute + description: Status defines the current state of TCPRoute. properties: gateways: description: "Gateways is a list of Gateways that are associated with the route, and the status of the route with respect to each Gateway. When a Gateway selects this route, the controller that manages the Gateway must add an entry to this list when the controller first sees the route and should update the entry as appropriate when the route is modified. \n A minimum of 1 and a maximum of 100 Gateways will be represented in this list. If the list is full, additional Gateways may be using this Route that are not included in the list. An empty list means the route has not been admitted by any Gateway." diff --git a/config/crd/bases/networking.x-k8s.io_tlsroutes.yaml b/config/crd/bases/networking.x-k8s.io_tlsroutes.yaml index dc002979c8..2a18fe70ce 100644 --- a/config/crd/bases/networking.x-k8s.io_tlsroutes.yaml +++ b/config/crd/bases/networking.x-k8s.io_tlsroutes.yaml @@ -30,7 +30,7 @@ spec: metadata: type: object spec: - description: TLSRouteSpec defines the desired state of TLSRoute + description: Spec defines the desired state of TLSRoute. properties: gateways: default: @@ -64,6 +64,7 @@ spec: - name - namespace type: object + maxItems: 16 type: array type: object rules: @@ -100,7 +101,7 @@ spec: - name type: object port: - description: "Port specifies the destination port number to use for the backend referenced by the ServiceName or BackendRef field. \n Support: Core" + description: "Port specifies the destination port number to use for the backend referenced by the ServiceName or BackendRef field. If unspecified, the destination port in the request is used when forwarding to a backendRef or serviceName. \n Support: Core" format: int32 maximum: 65535 minimum: 1 @@ -116,8 +117,6 @@ spec: maximum: 1000000 minimum: 0 type: integer - required: - - port type: object maxItems: 16 minItems: 1 @@ -172,7 +171,7 @@ spec: - rules type: object status: - description: TLSRouteStatus defines the observed state of TLSRoute + description: Status defines the current state of TLSRoute. properties: gateways: description: "Gateways is a list of Gateways that are associated with the route, and the status of the route with respect to each Gateway. When a Gateway selects this route, the controller that manages the Gateway must add an entry to this list when the controller first sees the route and should update the entry as appropriate when the route is modified. \n A minimum of 1 and a maximum of 100 Gateways will be represented in this list. If the list is full, additional Gateways may be using this Route that are not included in the list. An empty list means the route has not been admitted by any Gateway." diff --git a/config/crd/bases/networking.x-k8s.io_udproutes.yaml b/config/crd/bases/networking.x-k8s.io_udproutes.yaml index 222ace17a0..cab09c8973 100644 --- a/config/crd/bases/networking.x-k8s.io_udproutes.yaml +++ b/config/crd/bases/networking.x-k8s.io_udproutes.yaml @@ -30,7 +30,7 @@ spec: metadata: type: object spec: - description: UDPRouteSpec defines the desired state of UDPRoute. + description: Spec defines the desired state of UDPRoute. properties: gateways: default: @@ -64,6 +64,7 @@ spec: - name - namespace type: object + maxItems: 16 type: array type: object rules: @@ -100,7 +101,7 @@ spec: - name type: object port: - description: "Port specifies the destination port number to use for the backend referenced by the ServiceName or BackendRef field. \n Support: Core" + description: "Port specifies the destination port number to use for the backend referenced by the ServiceName or BackendRef field. If unspecified, the destination port in the request is used when forwarding to a backendRef or serviceName. \n Support: Core" format: int32 maximum: 65535 minimum: 1 @@ -116,8 +117,6 @@ spec: maximum: 1000000 minimum: 0 type: integer - required: - - port type: object maxItems: 16 minItems: 1 @@ -163,7 +162,7 @@ spec: - rules type: object status: - description: UDPRouteStatus defines the observed state of UDPRoute. + description: Status defines the current state of UDPRoute. properties: gateways: description: "Gateways is a list of Gateways that are associated with the route, and the status of the route with respect to each Gateway. When a Gateway selects this route, the controller that manages the Gateway must add an entry to this list when the controller first sees the route and should update the entry as appropriate when the route is modified. \n A minimum of 1 and a maximum of 100 Gateways will be represented in this list. If the list is full, additional Gateways may be using this Route that are not included in the list. An empty list means the route has not been admitted by any Gateway." diff --git a/docs-src/guidelines.md b/docs-src/guidelines.md index 434afb200b..f177f3b39f 100644 --- a/docs-src/guidelines.md +++ b/docs-src/guidelines.md @@ -83,3 +83,12 @@ We expect there will be varying levels of conformance among the different providers in the early days of this API. Users can use the results of the conformance tests to understand areas where there may be differences in behavior from the spec. + +## API Conventions + +Service APIs follow Kubernetes API [conventions][1]. These conventions +are intended to ease client development and ensure that configuration +mechanisms can consistently be implemented across a diverse set of use +cases. + +[1]: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md diff --git a/docs-src/spec.md b/docs-src/spec.md index 6854437153..d3c4602417 100644 --- a/docs-src/spec.md +++ b/docs-src/spec.md @@ -69,6 +69,7 @@ Kubernetes meta/v1.ObjectMeta +(Optional) Refer to the Kubernetes API documentation for the fields of the metadata field. @@ -83,6 +84,8 @@ BackendPolicySpec +(Optional) +

Spec defines the desired state of BackendPolicy.



@@ -131,6 +134,8 @@ BackendPolicyStatus @@ -180,6 +185,7 @@ Kubernetes meta/v1.ObjectMeta @@ -194,6 +200,8 @@ GatewaySpec
+(Optional) +

Status defines the current state of BackendPolicy.

+(Optional) Refer to the Kubernetes API documentation for the fields of the metadata field. +(Optional) +

Spec defines the desired state of Gateway.



@@ -290,6 +298,8 @@ GatewayStatus @@ -300,7 +310,6 @@ GatewayStatus

GatewayClass describes a class of Gateways available to the user for creating Gateway resources.

GatewayClass is a Cluster level resource.

-

Support: Core.

+(Optional) +

Status defines the current state of Gateway.

@@ -337,6 +346,7 @@ Kubernetes meta/v1.ObjectMeta @@ -351,7 +361,8 @@ GatewayClassSpec
+(Optional) Refer to the Kubernetes API documentation for the fields of the metadata field. -

Spec for this GatewayClass.

+(Optional) +

Spec defines the desired state of GatewayClass.



@@ -407,7 +418,8 @@ GatewayClassStatus @@ -452,6 +464,7 @@ Kubernetes meta/v1.ObjectMeta @@ -466,6 +479,8 @@ HTTPRouteSpec
-

Status of the GatewayClass.

+(Optional) +

Status defines the current state of GatewayClass.

+(Optional) Refer to the Kubernetes API documentation for the fields of the metadata field. +(Optional) +

Spec defines the desired state of HTTPRoute.



@@ -479,6 +494,7 @@ RouteGateways @@ -557,6 +573,7 @@ hostname).

@@ -573,6 +590,8 @@ HTTPRouteStatus @@ -617,6 +636,7 @@ Kubernetes meta/v1.ObjectMeta @@ -631,6 +651,8 @@ TCPRouteSpec
+(Optional)

Gateways defines which Gateways can use this Route.

+(Optional)

Rules are a list of HTTP matchers, filters and actions.

+(Optional) +

Status defines the current state of HTTPRoute.

+(Optional) Refer to the Kubernetes API documentation for the fields of the metadata field. +(Optional) +

Spec defines the desired state of TCPRoute.



@@ -657,6 +679,7 @@ RouteGateways @@ -673,6 +696,8 @@ TCPRouteStatus @@ -721,6 +746,7 @@ Kubernetes meta/v1.ObjectMeta @@ -735,6 +761,8 @@ TLSRouteSpec
+(Optional)

Gateways defines which Gateways can use this Route.

+(Optional) +

Status defines the current state of TCPRoute.

+(Optional) Refer to the Kubernetes API documentation for the fields of the metadata field. +(Optional) +

Spec defines the desired state of TLSRoute.



@@ -761,6 +789,7 @@ RouteGateways @@ -777,6 +806,8 @@ TLSRouteStatus @@ -821,6 +852,7 @@ Kubernetes meta/v1.ObjectMeta @@ -835,6 +867,8 @@ UDPRouteSpec
+(Optional)

Gateways defines which Gateways can use this Route.

+(Optional) +

Status defines the current state of TLSRoute.

+(Optional) Refer to the Kubernetes API documentation for the fields of the metadata field. +(Optional) +

Spec defines the desired state of UDPRoute.



@@ -861,6 +895,7 @@ RouteGateways @@ -877,6 +912,8 @@ UDPRouteStatus @@ -1005,7 +1042,7 @@ BackendTLSConfig

BackendPolicyStatus defines the observed state of BackendPolicy. Conditions -that are related to a specific Route or Gateway should be placed on the +that are related to a specific Route or Gateway must be placed on the Route(s) using backends configured by this BackendPolicy.

+(Optional)

Gateways defines which Gateways can use this Route.

+(Optional) +

Status defines the current state of UDPRoute.

@@ -1183,6 +1220,7 @@ AddressType @@ -1343,6 +1381,7 @@ status condition will be true.

@@ -1637,6 +1676,7 @@ assigns an address from a reserved pool.

@@ -2420,6 +2466,7 @@ the request to an API object.

@@ -2605,6 +2653,7 @@ hostname).

@@ -3269,6 +3318,7 @@ RouteNamespaces @@ -3442,6 +3496,7 @@ int32 @@ -3869,6 +3926,7 @@ RouteGateways @@ -3965,6 +4023,7 @@ TLSRouteOverrideType
+(Optional)

Type of the Address. This is either “IPAddress” or “NamedAddress”.

Support: Extended

+(Optional)

Conditions is the current status from the controller for this GatewayClass.

+(Optional)

Conditions describe the current conditions of the Gateway.

Implementations should prefer to express Gateway conditions using the GatewayConditionType and GatewayConditionReason @@ -1699,6 +1739,7 @@ TLSModeType

+(Optional)

Mode defines the TLS behavior for the TLS session initiated by the client. There are two possible modes: - Terminate: The TLS session between the downstream client @@ -1745,6 +1786,7 @@ TLSOverridePolicy

+(Optional)

RouteOverride dictates if TLS settings can be configured via Routes or not.

CertificateRef must be defined even if routeOverride.certificate is @@ -1801,6 +1843,7 @@ HeaderMatchType

+(Optional)

Type specifies how to match against the value of the header.

Support: core (Exact) Support: custom (RegularExpression, ImplementationSpecific)

@@ -1857,6 +1900,7 @@ PathMatchType
+(Optional)

Type specifies how to match against the path Value.

Support: core (Exact, Prefix) Support: custom (RegularExpression, ImplementationSpecific)

@@ -2280,6 +2324,7 @@ int32
+(Optional)

Weight specifies the proportion of HTTP requests forwarded to the backend referenced by the ServiceName or BackendRef field. This is computed as weight/(sum of all weights in this ForwardTo list). For non-zero values, @@ -2350,6 +2395,7 @@ HTTPPathMatch

+(Optional)

Path specifies a HTTP request path matcher. If this field is not specified, a default prefix match on the “/” path is provided.

+(Optional)

Matches define conditions used for matching the rule against incoming HTTP requests. Each match is independent, i.e. this rule will be matched @@ -2527,6 +2574,7 @@ RouteGateways

+(Optional)

Gateways defines which Gateways can use this Route.

+(Optional)

Rules are a list of HTTP matchers, filters and actions.

+(Optional)

Namespaces indicates in which namespaces Routes should be selected for this Gateway. This is restricted to the namespace of this Gateway by default.

@@ -3301,6 +3351,7 @@ string
+(Optional)

Group is the group of the route resource to select. Omitting the value or specifying the empty string indicates the networking.x-k8s.io API group. For example, use the following to select an HTTPRoute:

@@ -3429,8 +3480,11 @@ PortNumber
+(Optional)

Port specifies the destination port number to use for the -backend referenced by the ServiceName or BackendRef field.

+backend referenced by the ServiceName or BackendRef field. +If unspecified, the destination port in the request is used +when forwarding to a backendRef or serviceName.

Support: Core

+(Optional)

Weight specifies the proportion of HTTP requests forwarded to the backend referenced by the ServiceName or BackendRef field. This is computed as weight/(sum of all weights in this ForwardTo list). For non-zero values, @@ -3541,6 +3596,7 @@ GatewayAllowType

+(Optional)

Allow indicates which Gateways will be allowed to use this route. Possible values are: * All: Gateways in any namespace can use this route. @@ -3593,6 +3649,7 @@ RouteSelectType

+(Optional)

From indicates where Routes will be selected for this Gateway. Possible values are: * All: Routes in all namespaces may be used by this Gateway. @@ -3730,8 +3787,8 @@ this RouteTLSConfig is associated with. If an entry in this list omits or specifies the empty string for both the group and kind, the resource defaults to “secrets”. An implementation may support other resources (for example, resource -“mycertificates” in group “networking.acme.io”). -Support: Core (Kubernetes Secrets) +“mycertificates” in group “networking.acme.io”).

+

Support: Core (Kubernetes Secrets) Support: Implementation-specific (Other resource types)

+(Optional)

Gateways defines which Gateways can use this Route.

+(Optional)

Certificate dictates if TLS certificates can be configured via Routes. If set to ‘Allow’, a TLS certificate for a hostname defined in a Route takes precedence over the certificate defined in @@ -4131,7 +4190,7 @@ sent.

TLSRoute)

-

TLSRouteSpec defines the desired state of TLSRoute

+

TLSRouteSpec defines the desired state of TLSRoute.

@@ -4164,6 +4223,7 @@ RouteGateways @@ -4335,6 +4395,7 @@ RouteGateways diff --git a/docs/guidelines/index.html b/docs/guidelines/index.html index 445c3aec61..b8598d4875 100644 --- a/docs/guidelines/index.html +++ b/docs/guidelines/index.html @@ -292,6 +292,13 @@ +
  • + + API Conventions + + +
  • + @@ -662,6 +669,13 @@ +
  • + + API Conventions + + +
  • + @@ -752,6 +766,11 @@

    Conformance expectations

    different providers in the early days of this API. Users can use the results of the conformance tests to understand areas where there may be differences in behavior from the spec.

    +

    API Conventions

    +

    Service APIs follow Kubernetes API conventions. These conventions +are intended to ease client development and ensure that configuration +mechanisms can consistently be implemented across a diverse set of use +cases.

    diff --git a/docs/spec/index.html b/docs/spec/index.html index 61271eff61..e507645b9e 100644 --- a/docs/spec/index.html +++ b/docs/spec/index.html @@ -636,6 +636,7 @@

    BackendPolicy

    @@ -650,6 +651,8 @@

    BackendPolicy

    +(Optional)

    Gateways defines which Gateways can use this Route.

    +(Optional)

    Gateways defines which Gateways can use this Route.

    +(Optional) Refer to the Kubernetes API documentation for the fields of the metadata field. +(Optional) +

    Spec defines the desired state of BackendPolicy.



    @@ -698,6 +701,8 @@

    BackendPolicy

    @@ -747,6 +752,7 @@

    Gateway

    @@ -761,6 +767,8 @@

    Gateway

    +(Optional) +

    Status defines the current state of BackendPolicy.

    +(Optional) Refer to the Kubernetes API documentation for the fields of the metadata field. +(Optional) +

    Spec defines the desired state of Gateway.



    @@ -857,6 +865,8 @@

    Gateway

    @@ -867,7 +877,6 @@

    GatewayClass

    GatewayClass describes a class of Gateways available to the user for creating Gateway resources.

    GatewayClass is a Cluster level resource.

    -

    Support: Core.

    +(Optional) +

    Status defines the current state of Gateway.

    @@ -904,6 +913,7 @@

    GatewayClass

    @@ -918,7 +928,8 @@

    GatewayClass

    +(Optional) Refer to the Kubernetes API documentation for the fields of the metadata field. -

    Spec for this GatewayClass.

    +(Optional) +

    Spec defines the desired state of GatewayClass.



    @@ -974,7 +985,8 @@

    GatewayClass

    @@ -1019,6 +1031,7 @@

    HTTPRoute

    @@ -1033,6 +1046,8 @@

    HTTPRoute

    -

    Status of the GatewayClass.

    +(Optional) +

    Status defines the current state of GatewayClass.

    +(Optional) Refer to the Kubernetes API documentation for the fields of the metadata field. +(Optional) +

    Spec defines the desired state of HTTPRoute.



    @@ -1046,6 +1061,7 @@

    HTTPRoute

    @@ -1124,6 +1140,7 @@

    HTTPRoute

    @@ -1140,6 +1157,8 @@

    HTTPRoute

    @@ -1184,6 +1203,7 @@

    TCPRoute

    @@ -1198,6 +1218,8 @@

    TCPRoute

    +(Optional)

    Gateways defines which Gateways can use this Route.

    +(Optional)

    Rules are a list of HTTP matchers, filters and actions.

    +(Optional) +

    Status defines the current state of HTTPRoute.

    +(Optional) Refer to the Kubernetes API documentation for the fields of the metadata field. +(Optional) +

    Spec defines the desired state of TCPRoute.



    @@ -1224,6 +1246,7 @@

    TCPRoute

    @@ -1240,6 +1263,8 @@

    TCPRoute

    @@ -1288,6 +1313,7 @@

    TLSRoute

    @@ -1302,6 +1328,8 @@

    TLSRoute

    +(Optional)

    Gateways defines which Gateways can use this Route.

    +(Optional) +

    Status defines the current state of TCPRoute.

    +(Optional) Refer to the Kubernetes API documentation for the fields of the metadata field. +(Optional) +

    Spec defines the desired state of TLSRoute.



    @@ -1328,6 +1356,7 @@

    TLSRoute

    @@ -1344,6 +1373,8 @@

    TLSRoute

    @@ -1388,6 +1419,7 @@

    UDPRoute

    @@ -1402,6 +1434,8 @@

    UDPRoute

    +(Optional)

    Gateways defines which Gateways can use this Route.

    +(Optional) +

    Status defines the current state of TLSRoute.

    +(Optional) Refer to the Kubernetes API documentation for the fields of the metadata field. +(Optional) +

    Spec defines the desired state of UDPRoute.



    @@ -1428,6 +1462,7 @@

    UDPRoute

    @@ -1444,6 +1479,8 @@

    UDPRoute

    @@ -1572,7 +1609,7 @@

    BackendPolicyStatus

    BackendPolicyStatus defines the observed state of BackendPolicy. Conditions -that are related to a specific Route or Gateway should be placed on the +that are related to a specific Route or Gateway must be placed on the Route(s) using backends configured by this BackendPolicy.

    +(Optional)

    Gateways defines which Gateways can use this Route.

    +(Optional) +

    Status defines the current state of UDPRoute.

    @@ -1750,6 +1787,7 @@

    GatewayAddress

    @@ -1910,6 +1948,7 @@

    GatewayClassStatus

    @@ -2204,6 +2243,7 @@

    GatewayStatus

    @@ -2987,6 +3033,7 @@

    HTTPRouteRule

    @@ -3172,6 +3220,7 @@

    HTTPRouteSpec

    @@ -3836,6 +3885,7 @@

    RouteBindingSelector

    @@ -4009,6 +4063,7 @@

    RouteForwardTo

    @@ -4436,6 +4493,7 @@

    TCPRouteSpec

    @@ -4532,6 +4590,7 @@

    TLSOverridePolicy

    +(Optional)

    Type of the Address. This is either “IPAddress” or “NamedAddress”.

    Support: Extended

    +(Optional)

    Conditions is the current status from the controller for this GatewayClass.

    +(Optional)

    Conditions describe the current conditions of the Gateway.

    Implementations should prefer to express Gateway conditions using the GatewayConditionType and GatewayConditionReason @@ -2266,6 +2306,7 @@

    GatewayTLSConfig

    +(Optional)

    Mode defines the TLS behavior for the TLS session initiated by the client. There are two possible modes: - Terminate: The TLS session between the downstream client @@ -2312,6 +2353,7 @@

    GatewayTLSConfig

    +(Optional)

    RouteOverride dictates if TLS settings can be configured via Routes or not.

    CertificateRef must be defined even if routeOverride.certificate is @@ -2368,6 +2410,7 @@

    HTTPHeaderMatch

    +(Optional)

    Type specifies how to match against the value of the header.

    Support: core (Exact) Support: custom (RegularExpression, ImplementationSpecific)

    @@ -2424,6 +2467,7 @@

    HTTPPathMatch

    +(Optional)

    Type specifies how to match against the path Value.

    Support: core (Exact, Prefix) Support: custom (RegularExpression, ImplementationSpecific)

    @@ -2847,6 +2891,7 @@

    HTTPRouteForwardTo

    +(Optional)

    Weight specifies the proportion of HTTP requests forwarded to the backend referenced by the ServiceName or BackendRef field. This is computed as weight/(sum of all weights in this ForwardTo list). For non-zero values, @@ -2917,6 +2962,7 @@

    HTTPRouteMatch

    +(Optional)

    Path specifies a HTTP request path matcher. If this field is not specified, a default prefix match on the “/” path is provided.

    +(Optional)

    Matches define conditions used for matching the rule against incoming HTTP requests. Each match is independent, i.e. this rule will be matched @@ -3094,6 +3141,7 @@

    HTTPRouteSpec

    +(Optional)

    Gateways defines which Gateways can use this Route.

    +(Optional)

    Rules are a list of HTTP matchers, filters and actions.

    +(Optional)

    Namespaces indicates in which namespaces Routes should be selected for this Gateway. This is restricted to the namespace of this Gateway by default.

    @@ -3868,6 +3918,7 @@

    RouteBindingSelector

    +(Optional)

    Group is the group of the route resource to select. Omitting the value or specifying the empty string indicates the networking.x-k8s.io API group. For example, use the following to select an HTTPRoute:

    @@ -3996,8 +4047,11 @@

    RouteForwardTo

    +(Optional)

    Port specifies the destination port number to use for the -backend referenced by the ServiceName or BackendRef field.

    +backend referenced by the ServiceName or BackendRef field. +If unspecified, the destination port in the request is used +when forwarding to a backendRef or serviceName.

    Support: Core

    +(Optional)

    Weight specifies the proportion of HTTP requests forwarded to the backend referenced by the ServiceName or BackendRef field. This is computed as weight/(sum of all weights in this ForwardTo list). For non-zero values, @@ -4108,6 +4163,7 @@

    RouteGateways

    +(Optional)

    Allow indicates which Gateways will be allowed to use this route. Possible values are: * All: Gateways in any namespace can use this route. @@ -4160,6 +4216,7 @@

    RouteNamespaces

    +(Optional)

    From indicates where Routes will be selected for this Gateway. Possible values are: * All: Routes in all namespaces may be used by this Gateway. @@ -4297,8 +4354,8 @@

    RouteTLSConfig If an entry in this list omits or specifies the empty string for both the group and kind, the resource defaults to “secrets”. An implementation may support other resources (for example, resource -“mycertificates” in group “networking.acme.io”). -Support: Core (Kubernetes Secrets) +“mycertificates” in group “networking.acme.io”).

    +

    Support: Core (Kubernetes Secrets) Support: Implementation-specific (Other resource types)

    +(Optional)

    Gateways defines which Gateways can use this Route.

    +(Optional)

    Certificate dictates if TLS certificates can be configured via Routes. If set to ‘Allow’, a TLS certificate for a hostname defined in a Route takes precedence over the certificate defined in @@ -4698,7 +4757,7 @@

    TLSRouteSpec TLSRoute)

    -

    TLSRouteSpec defines the desired state of TLSRoute

    +

    TLSRouteSpec defines the desired state of TLSRoute.

    @@ -4731,6 +4790,7 @@

    TLSRouteSpec

    @@ -4902,6 +4962,7 @@

    UDPRouteSpec

    +(Optional)

    Gateways defines which Gateways can use this Route.

    +(Optional)

    Gateways defines which Gateways can use this Route.