Hi everyone,
I’m developing an ASP.NET application that includes endpoints for oAuth2 and a Discord.NET bot. The app be deployed in a k8s cluster with at least 4 pods, and this setup cannot be changed.
My question: how can I ensure the Discord.NET bot runs on only one pod, and if the container with the bot crashes or disconnects, the bot automatically starts on another pod?
Has anyone implemented a similar scenario using the leader election pattern or other approaches? What are the best practices for solving this?
Thanks in advance for any advice!