The pods deployed to AKS gets terminated due to reschduling, low priority evictions as well as during scaled in. We can add a termination grase period and pre stop sleep time as shown below in Linux and Windows containers to allow, sufficient time to ingress services to get updated about terminating pods. However, Windows nanoserver does not support PowerShell. Therefore, we need to use a specific mechanism to pre stop hook for nanoserver images. For nanoserver images shutdown signal is correctly get sent to the dotnet app. So we can just setup a sllep time for pre stop hook as necessary.
Wednesday, 2 April 2025
Windows Nanoserver Image Pre Stop Hook to Avoid 502 for Requests
Labels:
502,
aks,
Azure,
container,
docker,
dotnet,
graceful,
IHostedService,
kubernetes,
shut down,
SIGINT,
SIGKILL,
SIGTERM,
stop,
terminate,
windows
Subscribe to:
Posts (Atom)
Popular Posts
-
Setting up an Azure File Share capacity alert is useful to know when you reach at least 80% of allocated quota for the file share . This w...
-
Dynamic block allows to create nested multi level block structures in terraform code. Conditional usage of such blocks are really useful in...
-
We have discueed, that we have to use an environment variable to handle input parameter default values, if we are using trigger for workflo...
-
Applications implemented with IHostedService in dotnet, deployed to Azure Kubernetes Services (AKS) as containers in pods get terminated w...
-
In Azure DevOps YAML pipelines there are several functions available for you to use. replace is such a useful function, which you can use t...