Skip to content

Commit f19125b

Browse files
Merge pull request #278648 from ninpan-ms/ninpan/pod
Add pod overrides config for SCG
2 parents fd14f78 + 8f0c82b commit f19125b

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

articles/spring-apps/enterprise/how-to-configure-enterprise-spring-cloud-gateway.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -817,6 +817,46 @@ The following list shows the supported add-on configurations for the add-on key
817817
}
818818
```
819819
820+
- Pod configuration
821+
- Key name: `PodOverrides`, which is used to specify overrides for the default pod configuration.
822+
- Value type: Object
823+
- Properties
824+
- `Containers`: This array contains the configuration for individual containers within the pod. Only the container named `gateway` is supported currently.
825+
- `Name`: Specifies the name of the container. The container should be named `gateway`.
826+
- `Lifecycle`: `PreStop` is a lifecycle hook that's executed when a container is about to be terminated. This hook enables you to perform any necessary cleanup before the container stops.
827+
- `TerminationGracePeriodSeconds`: Specifies the amount of time Kubernetes waits for a pod to terminate gracefully before forcibly killing it.
828+
- Example:
829+
830+
```json
831+
{
832+
"PodOverrides": {
833+
"Containers": [
834+
{
835+
{
836+
"Name": "gateway",
837+
"Lifecycle": {
838+
"PreStop": {
839+
"Exec": {
840+
"Command": [
841+
"/bin/sh",
842+
"-c",
843+
"sleep 20"
844+
]
845+
}
846+
}
847+
}
848+
}
849+
}
850+
],
851+
"TerminationGracePeriodSeconds": 120
852+
}
853+
}
854+
```
855+
856+
When a pod containing this container is being terminated, the `PreStop` hook executes the command `/bin/sh -c 'sleep 20'`, causing the container to sleep for 20 seconds. This pause gives the container some time to complete any ongoing tasks or cleanup before it actually stops.
857+
858+
The `TerminationGracePeriodSeconds` setting provides a total of 120 seconds for the pod to terminate gracefully, including the time taken by any lifecycle hooks, such as `PreStop`.
859+
820860
Use the following steps to update the add-on configuration.
821861
822862
### [Azure portal](#tab/Azure-portal)

0 commit comments

Comments
 (0)