@@ -191,6 +191,28 @@ type IngressControllerSpec struct {
191
191
// +optional
192
192
HTTPHeaders * IngressControllerHTTPHeaders `json:"httpHeaders,omitempty"`
193
193
194
+ // httpEmptyRequestsPolicy describes how HTTP connections should be
195
+ // handled if the connection times out before a request is received.
196
+ // Allowed values for this field are "Respond" and "Ignore". If the
197
+ // field is set to "Respond", the ingress controller sends an HTTP 400
198
+ // or 408 response, logs the connection (if access logging is enabled),
199
+ // and counts the connection in the appropriate metrics. If the field
200
+ // is set to "Ignore", the ingress controller closes the connection
201
+ // without sending a response, logging the connection, or incrementing
202
+ // metrics. The default value is "Respond".
203
+ //
204
+ // Typically, these connections come from load balancers' health probes
205
+ // or Web browsers' speculative connections ("preconnect") and can be
206
+ // safely ignored. However, these requests may also be caused by
207
+ // network errors, and so setting this field to "Ignore" may impede
208
+ // detection and diagnosis of problems. In addition, these requests may
209
+ // be caused by port scans, in which case logging empty requests may aid
210
+ // in detecting intrusion attempts.
211
+ //
212
+ // +optional
213
+ // +kubebuilder:default:="Respond"
214
+ HTTPEmptyRequestsPolicy HTTPEmptyRequestsPolicy `json:"httpEmptyRequestsPolicy,omitempty"`
215
+
194
216
// tuningOptions defines parameters for adjusting the performance of
195
217
// ingress controller pods. All fields are optional and will use their
196
218
// respective defaults if not set. See specific tuningOptions fields for
@@ -905,6 +927,17 @@ type IngressControllerCaptureHTTPCookieUnion struct {
905
927
NamePrefix string `json:"namePrefix"`
906
928
}
907
929
930
+ // LoggingPolicy indicates how an event should be logged.
931
+ // +kubebuilder:validation:Enum=Log;Ignore
932
+ type LoggingPolicy string
933
+
934
+ const (
935
+ // LoggingPolicyLog indicates that an event should be logged.
936
+ LoggingPolicyLog LoggingPolicy = "Log"
937
+ // LoggingPolicyIgnore indicates that an event should not be logged.
938
+ LoggingPolicyIgnore LoggingPolicy = "Ignore"
939
+ )
940
+
908
941
// AccessLogging describes how client requests should be logged.
909
942
type AccessLogging struct {
910
943
// destination is where access logs go.
@@ -949,6 +982,21 @@ type AccessLogging struct {
949
982
// +optional
950
983
// +kubebuilder:validation:MaxItems=1
951
984
HTTPCaptureCookies []IngressControllerCaptureHTTPCookie `json:"httpCaptureCookies,omitempty"`
985
+
986
+ // logEmptyRequests specifies how connections on which no request is
987
+ // received should be logged. Typically, these empty requests come from
988
+ // load balancers' health probes or Web browsers' speculative
989
+ // connections ("preconnect"), in which case logging these requests may
990
+ // be undesirable. However, these requests may also be caused by
991
+ // network errors, in which case logging empty requests may be useful
992
+ // for diagnosing the errors. In addition, these requests may be caused
993
+ // by port scans, in which case logging empty requests may aid in
994
+ // detecting intrusion attempts. Allowed values for this field are
995
+ // "Log" and "Ignore". The default value is "Log".
996
+ //
997
+ // +optional
998
+ // +kubebuilder:default:="Log"
999
+ LogEmptyRequests LoggingPolicy `json:"logEmptyRequests,omitempty"`
952
1000
}
953
1001
954
1002
// IngressControllerLogging describes what should be logged where.
@@ -1135,6 +1183,20 @@ type IngressControllerTuningOptions struct {
1135
1183
ThreadCount int32 `json:"threadCount,omitempty"`
1136
1184
}
1137
1185
1186
+ // HTTPEmptyRequestsPolicy indicates how HTTP connections for which no request
1187
+ // is received should be handled.
1188
+ // +kubebuilder:validation:Enum=Respond;Ignore
1189
+ type HTTPEmptyRequestsPolicy string
1190
+
1191
+ const (
1192
+ // HTTPEmptyRequestsPolicyRespond indicates that the ingress controller
1193
+ // should respond to empty requests.
1194
+ HTTPEmptyRequestsPolicyRespond HTTPEmptyRequestsPolicy = "Respond"
1195
+ // HTTPEmptyRequestsPolicyIgnore indicates that the ingress controller
1196
+ // should ignore empty requests.
1197
+ HTTPEmptyRequestsPolicyIgnore HTTPEmptyRequestsPolicy = "Ignore"
1198
+ )
1199
+
1138
1200
var (
1139
1201
// Available indicates the ingress controller deployment is available.
1140
1202
IngressControllerAvailableConditionType = "Available"
0 commit comments