|
| 1 | +package v1alpha1 |
| 2 | + |
| 3 | +import ( |
| 4 | + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" |
| 5 | + gatewayv1 "sigs.k8s.io/gateway-api/apis/v1" |
| 6 | +) |
| 7 | + |
| 8 | +// +genclient |
| 9 | +// +kubebuilder:object:root=true |
| 10 | +// +kubebuilder:storageversion |
| 11 | +// +kubebuilder:subresource:status |
| 12 | +// +kubebuilder:resource:categories=nginx-gateway-fabric,shortName=pspolicy |
| 13 | +// +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp` |
| 14 | +// +kubebuilder:metadata:labels="gateway.networking.k8s.io/policy=inherited" |
| 15 | + |
| 16 | +// ProxySettingsPolicy is an Inherited Attached Policy. It provides a way to configure the behavior of the connection |
| 17 | +// between NGINX Gateway Fabric and the upstream applications (backends). |
| 18 | +type ProxySettingsPolicy struct { |
| 19 | + metav1.TypeMeta `json:",inline"` |
| 20 | + metav1.ObjectMeta `json:"metadata,omitempty"` |
| 21 | + |
| 22 | + // Spec defines the desired state of the ProxySettingsPolicy. |
| 23 | + Spec ProxySettingsPolicySpec `json:"spec"` |
| 24 | + |
| 25 | + // Status defines the state of the ProxySettingsPolicy. |
| 26 | + Status gatewayv1.PolicyStatus `json:"status,omitempty"` |
| 27 | +} |
| 28 | + |
| 29 | +// +kubebuilder:object:root=true |
| 30 | + |
| 31 | +// ProxySettingsPolicyList contains a list of ProxySettingsPolicies. |
| 32 | +type ProxySettingsPolicyList struct { |
| 33 | + metav1.TypeMeta `json:",inline"` |
| 34 | + metav1.ListMeta `json:"metadata,omitempty"` |
| 35 | + Items []ProxySettingsPolicy `json:"items"` |
| 36 | +} |
| 37 | + |
| 38 | +// ProxySettingsPolicySpec defines the desired state of the ProxySettingsPolicy. |
| 39 | +type ProxySettingsPolicySpec struct { |
| 40 | + Buffering *ProxyBuffering `json:"buffering,omitempty"` |
| 41 | + TargetRefs []gatewayv1.LocalPolicyTargetReference `json:"targetRefs"` |
| 42 | +} |
| 43 | + |
| 44 | +// ProxyBuffering contains the settings for proxy buffering. |
| 45 | +type ProxyBuffering struct { |
| 46 | + // Disable enables or disables buffering of responses from the proxied server. |
| 47 | + // If Disable is true, buffering is disabled. If Disable is false, or if Disable is not set, buffering is enabled. |
| 48 | + // Directive: https://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_buffering |
| 49 | + // |
| 50 | + // +optional |
| 51 | + Disable *bool `json:"disable,omitempty"` |
| 52 | + |
| 53 | + // BufferSize sets the size of the buffer used for reading the first part of the response received from |
| 54 | + // the proxied server. This part usually contains a small response header. |
| 55 | + // Default: https://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_buffer_size |
| 56 | + // Directive: https://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_buffer_size |
| 57 | + // |
| 58 | + // +optional |
| 59 | + BufferSize *Size `json:"bufferSize,omitempty"` |
| 60 | + |
| 61 | + // Buffers sets the number and size of buffers used for reading a response from the proxied server, |
| 62 | + // for a single connection. |
| 63 | + // Default: https://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_buffers |
| 64 | + // Directive: https://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_buffers |
| 65 | + // |
| 66 | + // +optional |
| 67 | + Buffers *ProxyBuffers `json:"buffers,omitempty"` |
| 68 | + |
| 69 | + // BusyBuffersSize sets the total size of buffers that can be busy sending a response to the client, |
| 70 | + // while the response is not yet fully read. |
| 71 | + // Default: https://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_busy_buffers_size |
| 72 | + // Directive: https://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_busy_buffers_size |
| 73 | + // |
| 74 | + // +optional |
| 75 | + BusyBuffersSize *Size `json:"busyBuffersSize,omitempty"` |
| 76 | +} |
| 77 | + |
| 78 | +// ProxyBuffers defines the number and size of the proxy buffers. |
| 79 | +type ProxyBuffers struct { |
| 80 | + Size Size `json:"size"` |
| 81 | + Number int32 `json:"number"` |
| 82 | +} |
0 commit comments