API that is written in JAVA spring-boot was deployed in K8s with two pods and Its been 3 weeks that API is successfully running. But, last day it stoped working and produced 503 server unavailable.
K8s admin told us that Pods got recreating multiple time whole the day. Though it is started working after restarting my build from Drone, i want to know
Which scenario can make Pods not working?
Why K8S is recreating Pods again and again?
If it is the memory issue, as i have developed this API in JAVA, doesn't JAVA's garbage collection work here
if you are using java 8, you might want to add some controls over the Heap size when starting app as follow:
-XX:+PrintFlagsFinal -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap
This is java 8+ feature so you might need to check java documentation
Hope this helps