title: Why I can't access my application inside Kubernetes cluster through tomcat server?
body: <p>I'm running a kubernetes cluster with minikube on ubuntu server 20.04.1 LTS. When I launch the deployments I can access the Tomcat server from the cluster, but I can't open my application, I got the error message :</p>
  <pre><code>HTTP Status 404 – Not Found
  </code></pre>
  <p>Here is my docker-compose file :</p>
  <pre><code>    version: &quot;3&quot;
  
  #NETWORK
  networks:
    network1:
      driver: bridge
  volumes:
    dir-site:
      driver_opts:
        device: /smartclass_docker/site/
        type: bind
        o: bind
  # Declare services
  services:
    # service name
    server:
      container_name: server
      # Container image name
      image: repo/myimage
      ## Image used to build Dockerfile 
      build:
        #dockerfile: Dockerfile
        context: ./smart/
  
      # Container ports and host matching
      ports:
        - &quot;3306:3306&quot;
        - &quot;8080:8080&quot;
  
      ## Startup Policy
      restart driver: bridge
  volumes:
    dir-site:
      driver_opts:
        device: /smart/site/
        type: bind
        o: bind
  # Declaration of services
  services:
    # service name
    server:
      container_name: server
      # name of the image
      image: repo/myimage
      ## Use IMAGE BUILD DOCKERFILE
      build:
        #dockerfile: Dockerfile
        context: ./smart/
  
      # CONTAINER ports
      ports:
        - &quot;3306:3306&quot;
        - &quot;8080:8080&quot;
  
      ## Startup policy
      restart: always
  
      # connect to network1
      networks:
        - network1
      volumes:
              - /data/dockerStore/data/db_server_1:/var/lib/mysql/
  
      restart: always
  
      # connect to network1
      networks:
        - network1
      volumes:
              - /data/dockerStore/data/db_server_1:/var/lib/mysql/
  </code></pre>
  <p>Here is my kubernetes deployment file :</p>
  <pre><code>apiVersion: apps/v1
  kind: Deployment
  metadata:
    name: myapp
  spec:
    replicas: 3
    selector:
        matchLabels:
          app: myapp
    # type: LoadBalancer
    template:
      metadata:
        labels:
          app: myapp
      spec:
        containers:
        - name: myapp
          image: jksun12/vdsaipro
          command: [&quot;/run.sh&quot;]
          ports:
          - containerPort: 80
          - containerPort: 3306
          - containerPort: 9001
          - containerPort: 9002
     # volumeMounts:
     #     - name: myapp-pv-claim
     #       mountPath: /var/lib/mysql
     #   volumes:
     #   - name: myapp-pv-claim
     #     persistentVolumeClaim:
     #       claimName: myapp-pv-claim
  ---
  apiVersion: apps/v1
  kind: PersistentVolumeClaim
  metadata:
    name: myapp-pv-claim
    labels:
      app: myapp
  spec:
    accesModes:
      - ReadWriteMany
    resources:
      requests:
        storage: 4Gi
  </code></pre>
  <p>My application files are in the /smart directory, which is a subdirectory of the directory where I actually run docker-compose and build my main Dockerfile.
  How can I solve it ?
  Thanks</p>