1- package v1alpha1
1+ package v1alpha2
22
3- import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
3+ import (
4+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
5+
6+ "github.com/nginxinc/nginx-gateway-fabric/apis/v1alpha1"
7+ )
48
59// +genclient
610// +kubebuilder:object:root=true
711// +kubebuilder:storageversion
8- // +kubebuilder:resource:categories=nginx-gateway-fabric,scope=Cluster
12+ // +kubebuilder:resource:categories=nginx-gateway-fabric,scope=Namespaced
913// +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp`
1014
11- // NginxProxy is a configuration object that is attached to a GatewayClass parametersRef. It provides a way
12- // to configure global settings for all Gateways defined from the GatewayClass.
15+ // NginxProxy is a configuration object that can be referenced from a GatewayClass parametersRef
16+ // or a Gateway infrastructure.parametersRef. It provides a way to configure data plane settings.
17+ // If referenced from a GatewayClass, the settings apply to all Gateways attached to the GatewayClass.
18+ // If referenced from a Gateway, the settings apply to that Gateway alone. If both a Gateway and its GatewayClass
19+ // reference an NginxProxy, the settings are merged. Settings specified on the Gateway NginxProxy override those
20+ // set on the GatewayClass NginxProxy.
1321type NginxProxy struct { //nolint:govet // standard field alignment, don't change it
1422 metav1.TypeMeta `json:",inline"`
1523 metav1.ObjectMeta `json:"metadata,omitempty"`
@@ -50,14 +58,18 @@ type NginxProxySpec struct {
5058 // +optional
5159 Logging * NginxLogging `json:"logging,omitempty"`
5260 // DisableHTTP2 defines if http2 should be disabled for all servers.
53- // Default is false, meaning http2 will be enabled for all servers.
61+ // If not specified, or set to false, http2 will be enabled for all servers.
5462 //
5563 // +optional
56- DisableHTTP2 bool `json:"disableHTTP2,omitempty"`
64+ DisableHTTP2 * bool `json:"disableHTTP2,omitempty"`
5765}
5866
5967// Telemetry specifies the OpenTelemetry configuration.
6068type Telemetry struct {
69+ // DisabledFeatures specifies OpenTelemetry features to be disabled.
70+ //
71+ // +optional
72+ DisabledFeatures []DisableTelemetryFeature `json:"disabledFeatures,omitempty"`
6173 // Exporter specifies OpenTelemetry export parameters.
6274 //
6375 // +optional
@@ -78,7 +90,7 @@ type Telemetry struct {
7890 // +listType=map
7991 // +listMapKey=key
8092 // +kubebuilder:validation:MaxItems=64
81- SpanAttributes []SpanAttribute `json:"spanAttributes,omitempty"`
93+ SpanAttributes []v1alpha1. SpanAttribute `json:"spanAttributes,omitempty"`
8294}
8395
8496// TelemetryExporter specifies OpenTelemetry export parameters.
@@ -87,7 +99,7 @@ type TelemetryExporter struct {
8799 // Default: https://nginx.org/en/docs/ngx_otel_module.html#otel_exporter
88100 //
89101 // +optional
90- Interval * Duration `json:"interval,omitempty"`
102+ Interval * v1alpha1. Duration `json:"interval,omitempty"`
91103
92104 // BatchSize is the maximum number of spans to be sent in one batch per worker.
93105 // Default: https://nginx.org/en/docs/ngx_otel_module.html#otel_exporter
@@ -107,8 +119,9 @@ type TelemetryExporter struct {
107119 // Format: alphanumeric hostname with optional http scheme and optional port.
108120 //
109121 //nolint:lll
122+ // +optional
110123 // +kubebuilder:validation:Pattern=`^(?:http?:\/\/)?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*(?::\d{1,5})?$`
111- Endpoint string `json:"endpoint"`
124+ Endpoint * string `json:"endpoint,omitempty "`
112125}
113126
114127// RewriteClientIP specifies the configuration for rewriting the client's IP address.
@@ -249,3 +262,13 @@ const (
249262 // NginxLogLevelEmerg is the emerg level for NGINX error logs.
250263 NginxLogLevelEmerg NginxErrorLogLevel = "emerg"
251264)
265+
266+ // DisableTelemetryFeature is a telemetry feature that can be disabled.
267+ //
268+ // +kubebuilder:validation:Enum=DisableTracing
269+ type DisableTelemetryFeature string
270+
271+ const (
272+ // DisableTracing disables the OpenTelemetry tracing feature.
273+ DisableTracing DisableTelemetryFeature = "DisableTracing"
274+ )
0 commit comments