I was trying to deploy my application in one environment. The pod is going in crash back loop with the below error:
"mdc":{},"timestamp":"2021-06-01 09:38:03.582","level":"ERROR","logger":"org.springframework.boot.diagnostics.LoggingFailureAnalysisReporter","message":"\n\n***\nAPPLICATION FAILED TO START\n***\n\nDescription:\n\nField bac in com.anjana.ms.anjana.ouseph.resources.services.implementation.anjanaValidator required a bean of type 'anjana.wrapper.IBAC' that could not be found.\n\nThe injection point has the following annotations:\n\t- @javax.inject.Inject()\n\n\nAction:\n\nConsider defining a bean of type 'anjana.wrapper.IBAC' in your configuration.\n","exception":""}
The application is getting successfully deployed in another environment, Why does it show two different behaviors in different environments, Jenkins build and Junits are running successfully.
Your spring-boot application cannot start successfully that's why kubernetes tries to restart and make it work but fails again..
A CrashloopBackOff
means that you have a pod starting, crashing, starting again, and then crashing again.
You have a misconfiguration in your application, checkout similar problems like this https://stackoverflow.com/questions/42907553/field-required-a-bean-of-type-that-could-not-be-found-error-spring-restful-ap