You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/proposals/gateway-settings.md
+26-26
Original file line number
Diff line number
Diff line change
@@ -5,26 +5,26 @@
5
5
6
6
## Summary
7
7
8
-
This Enhancement Proposal introduces the `GatewaySettings` API, which allows Cluster Operators to define configuration at the GatewayClass level for all Gateways under that Class. This configuration is attached via the GatewayClass `parametersRef` field.
8
+
This Enhancement Proposal introduces the `NginxProxy` API, which allows Cluster Operators to define configuration at the GatewayClass level for all Gateways (proxies) under that Class. This configuration is attached via the GatewayClass `parametersRef` field.
9
9
10
10
## Goals
11
11
12
12
- Define the Gateway settings.
13
-
- Define an API for the Gateway settings.
13
+
- Define an API for the NginxProxy CRD.
14
14
15
15
## Non-Goals
16
16
17
-
- Provide implementation details for implementing the Gateway settings.
17
+
- Provide implementation details for implementing the NginxProxy configuration.
18
18
19
19
## Introduction
20
20
21
21
### Gateway Settings
22
22
23
-
Gateway Settings are NGINX directives or configuration attached at the GatewayClass level that should be solely controlled by the Cluster Operator and should not be changed by the Application Developers. All Gateways attached to this GatewayClass will inherit these settings.
23
+
Gateway settings are NGINX directives or configuration attached at the GatewayClass level that should be solely controlled by the Cluster Operator and should not be changed by the Application Developers. All Gateways attached to this GatewayClass will inherit these settings.
24
24
25
-
These settings apply to the `main`, `http`, and/or `stream` contexts of the NGINX config.
25
+
These settings apply to the `main`, `http`, and/or `stream` contexts of the NGINX config. The `NginxProxy` CRD will contain these settings.
26
26
27
-
To begin, the Gateway Settings config will include the following NGINX directives (focusing on OpenTelemetry tracing):
27
+
To begin, the `NginxProxy` CRD will include the following NGINX directives (focusing on OpenTelemetry tracing):
@@ -34,11 +34,11 @@ In the future, this config will be extended to support other directives, such as
34
34
35
35
## API, Customer Driven Interfaces, and User Experience
36
36
37
-
The `GatewaySettings` API is a CRD that is a part of the `gateway.nginx.org` Group. It will be referenced in the `parametersRef` field of a GatewayClass. It will live at the cluster scope.
37
+
The `NginxProxy` API is a CRD that is a part of the `gateway.nginx.org` Group. It will be referenced in the `parametersRef` field of a GatewayClass. It will live at the cluster scope.
38
38
39
39
This is a dynamic configuration that can be changed by a user at any time, and NGF will propagate those changes to NGINX. This is something we need to clearly document in our public documentation about this feature, so that users know that all Gateways under the Class can be updated by these settings.
40
40
41
-
For example, a `GatewaySettings` named `gw-settings` would be referenced as follows:
41
+
For example, an `NginxProxy` named `proxy-settings` would be referenced as follows:
// Spec defines the desired state of the GatewaySettings.
69
-
Spec GatewaySettingsSpec `json:"spec"`
68
+
// Spec defines the desired state of the NginxProxy.
69
+
Spec NginxProxySpec `json:"spec"`
70
70
}
71
71
72
-
type GatewaySettingsSpec struct {
72
+
type NginxProxySpec struct {
73
73
// Telemetry specifies the OpenTelemetry configuration.
74
74
//
75
75
// +optional
@@ -128,9 +128,9 @@ type Duration string
128
128
129
129
#### GatewayClass
130
130
131
-
There are two Conditions on the GatewayClass status to consider when using the `parametersRef`. The first is a `ResolvedRefs` Condition. If the `GatewaySettings` reference cannot be found, then this Condition is set to `False`.
131
+
There are two Conditions on the GatewayClass status to consider when using the `parametersRef`. The first is a `ResolvedRefs` Condition. If the `NginxProxy` reference cannot be found, then this Condition is set to `False`.
132
132
133
-
NGINX Gateway Fabric must set this Condition on the GatewayClass affected by a `GatewaySettings`.
133
+
NGINX Gateway Fabric must set this Condition on the GatewayClass affected by an `NginxProxy`.
134
134
Below is an example of what this Condition may look like:
135
135
136
136
```yaml
@@ -144,13 +144,13 @@ Conditions:
144
144
145
145
Some additional rules:
146
146
147
-
- This Condition should be added when the affected object starts being affected by a `GatewaySettings`.
148
-
- When the `GatewaySettings` affecting that object is removed, the Condition should be removed.
149
-
- The Observed Generation is the generation of the GatewayClass, not the generation of the `GatewaySettings`.
147
+
- This Condition should be added when the affected object starts being affected by an `NginxProxy`.
148
+
- When the `NginxProxy` affecting that object is removed, the Condition should be removed.
149
+
- The Observed Generation is the generation of the GatewayClass, not the generation of the `NginxProxy`.
150
150
151
-
The other condition is the existing `Accepted` condition on the GatewayClass. There is an existing reason for this Condition, `InvalidParameters`, that sets `Accepted` to `False` when the `parametersRef` fields are invalid. However, this could lead to downstream problems. For example, if a GatewayClass is `Accepted`, and then `GatewaySettings` are updated to something invalid, then marking the GatewayClass as `not Accepted` would result in the entire downstream configuration tree being nullified. This is a large disruption.
151
+
The other condition is the existing `Accepted` condition on the GatewayClass. There is an existing reason for this Condition, `InvalidParameters`, that sets `Accepted` to `False` when the `parametersRef` fields are invalid. However, this could lead to downstream problems. For example, if a GatewayClass is `Accepted`, and then `NginxProxy` are updated to something invalid, then marking the GatewayClass as `not Accepted` would result in the entire downstream configuration tree being nullified. This is a large disruption.
152
152
153
-
The proposition is to instead keep the GatewayClass as `Accepted` even if the `GatewaySettings` are invalid, but still set the reason to `InvalidParameters` and include a detailed message about the issue. In this case, default values will be reverted to for the settings, and downstream configuration will remain intact. There may be impact by reverting to defaults, but this impact is likely less than the impact of completely nullifying all Gateways/Routes/etc. that live under the GatewayClass if we instead marked it as `not Accepted`
153
+
The proposition is to instead keep the GatewayClass as `Accepted` even if the `NginxProxy` are invalid, but still set the reason to `InvalidParameters` and include a detailed message about the issue. In this case, default values will be reverted to for the settings, and downstream configuration will remain intact. There may be impact by reverting to defaults, but this impact is likely less than the impact of completely nullifying all Gateways/Routes/etc. that live under the GatewayClass if we instead marked it as `not Accepted`.
154
154
155
155
If this scenario occurs, we must be clear about what happened. Log an error, an event, and write the status. We should also set the generation to the last known good state of the resource.
156
156
@@ -165,16 +165,16 @@ If this scenario occurs, we must be clear about what happened. Log an error, an
165
165
166
166
## Security Considerations
167
167
168
-
Validating all fields in the `GatewaySettings` is critical to ensuring that the NGINX config generated by NGINX Gateway Fabric is correct and secure.
168
+
Validating all fields in the `NginxProxy` is critical to ensuring that the NGINX config generated by NGINX Gateway Fabric is correct and secure.
169
169
170
-
All fields in the `GatewaySettings` will be validated with Open API Schema. If the Open API Schema validation rules are not sufficient, we will use [CEL](https://kubernetes.io/docs/tasks/extend-kubernetes/custom-resources/custom-resource-definitions/#validation-rules).
170
+
All fields in the `NginxProxy` will be validated with Open API Schema. If the Open API Schema validation rules are not sufficient, we will use [CEL](https://kubernetes.io/docs/tasks/extend-kubernetes/custom-resources/custom-resource-definitions/#validation-rules).
171
171
172
-
RBAC via the Kubernetes API server will ensure that only authorized users can update the CRD containing Gateway Settings.
172
+
RBAC via the Kubernetes API server will ensure that only authorized users can update the CRD.
173
173
174
174
## Alternatives
175
175
176
176
- ParametersRef with ConfigMap: A ConfigMap is another resource type where a user can provide configuration options. However, unlike CRDs, ConfigMaps do not have built-in schema validation, versioning, or conversion webhooks.
177
-
- Direct Policy: A Direct Policy may also work for Gateway Settings. It can be attached to a Gateway and scoped to Cluster Operators through RBAC. It would allow Cluster Operators to apply settings for specific Gateways, instead of all Gateways.
177
+
- Direct Policy: A Direct Policy may also work for Gateway settings. It can be attached to a Gateway and scoped to Cluster Operators through RBAC. It would allow Cluster Operators to apply settings for specific Gateways, instead of all Gateways.
0 commit comments