The following docker-compose.yaml works perfectly after running with the docker-compose up command. I can also see that my app has successfully started in tomcat manager app.
version: '3'
services:
mysql:
image: suji165475/vignesh:latest
ports:
- "3306:3306"
tomcat:
image: suji165475/vignesh:tomcatserver
container_name: tomcat7hope
ports:
- "8080:8080"
Now since I want to run this on kubernetes, I converted this to kubernetes using kompose convert which gave me 4 kubernetes yaml files :
1.tomcatservice.yaml
2.mysqlservice.yaml
3.tomcatdeployment.yaml
4.mysqldeployment.yaml
I changed the spec type to NodePort in tomcatservice.yaml.
this time the problem is that the app has not started in tomcat's manager app and starting it gives me Application at context path /data-core-0.0.1-SNAPSHOT could not be started Encountered exception org.apache.catalina.LifecycleException: Failed to start component
It's so strange because the same app ran succesfully using docker-compose up. Do i have to change anything else in the kubernetes yaml files??
I feel like i have missed out on something!! please help