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
To enable keepalive connections for the `coffee` service, create the following `UpstreamSettingsPolicy`:
422
+
By default, the `keepAlive` directive is enabled with a value of 16. You can override this value or disable `keepAlive` entirely by configuring an `UpstreamSettingsPolicy`. To disable keepalive, set the connections field to 0.
423
+
424
+
The following example creates an `UpstreamSettingsPolicy` that configures keepalive connections for the `coffee` Service with a value of 32:
419
425
420
426
```yaml
421
427
kubectl apply -f - <<EOF
@@ -480,7 +486,54 @@ upstream default_coffee_80 {
480
486
}
481
487
```
482
488
483
-
Notice, that the `tea` upstream does not contain the `keepalive` directive, since the `upstream-keepalives` policy does not target the `tea` service:
489
+
To disable `keepAlive` directive lets create an `UpstreamSettingsPolicy` targeting the `tea` service with value 0:
490
+
491
+
```yaml
492
+
kubectl apply -f - <<EOF
493
+
apiVersion: gateway.nginx.org/v1alpha1
494
+
kind: UpstreamSettingsPolicy
495
+
metadata:
496
+
name: upstream-unset-keepAlive
497
+
spec:
498
+
targetRefs:
499
+
- group: core
500
+
kind: Service
501
+
name: tea
502
+
keepAlive:
503
+
connections: 0
504
+
EOF
505
+
```
506
+
507
+
Verify that the `UpstreamSettingsPolicy` is Accepted:
0 commit comments