<p>I am converting a docker-compose file to kubernetes using kompose running the follwing command:</p>

<p>$kompose convert -f docker-compose.yml -o kubernetes_image.yaml</p>

<p>After the command finish the ouput is the following.</p>

<pre><code>WARN Volume mount on the host "/usr/docker/adpater/dbdata" isn't supported - ignoring path on the host
INFO Network integration is detected at Source, shall be converted to equivalent NetworkPolicy at Destination
WARN Volume mount on the host "/usr/docker/adpater/license.json" isn't supported - ignoring path on the host
WARN Volume mount on the host "/usr/docker/adpater/certificates/ssl.crt" isn't supported - ignoring path on the host
WARN Volume mount on the host "/usr/docker/adpater/certificates/ssl.key" isn't supported - ignoring path on the host
WARN Volume mount on the host "/usr/docker/adpater/server.xml" isn't supported - ignoring path on the host
INFO Network integration is detected at Source, shall be converted to equivalent NetworkPolicy at Destination
</code></pre>

<p>To push the converted file to kubernetes I run the follwoing command:</p>

<p>$kubectl apply -f kubernetes_image.yaml</p>

<pre><code>NAME                      READY   STATUS             RESTARTS   AGE
mysql-557dd849c8-bsdq7    1/1     Running            1          17h
tomcat-7cd65d4556-spjbl   0/1     CrashLoopBackOff   76         18h
</code></pre>

<p>if I run: 
$ kubectl describe pod tomcat-7cd65d4556-spjbl
I get the following message: </p>

<pre><code>Last State:     Terminated
      Reason:       ContainerCannotRun
      Message:      OCI runtime create failed: container_linux.go:349: starting container process caused "process_linux.go:449: container init caused \"rootfs_linux.go:58: mounting \\\"/usr/docker/adapter/server.xml\\\" to rootfs \\\"/var/lib/docker/overlay2/a6df90a0ef4cbe8b2a3fa5352be5f304cd7b648fb1381492308f0a7fceb931cc/merged\\\" at \\\"/var/lib/docker/overlay2/a6df90a0ef4cbe8b2a3fa5352be5f304cd7b648fb1381492308f0a7fceb931cc/merged/usr/local/tomcat/conf/server.xml\\\" caused \\\"not a directory\\\"\"": unknown: Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type
      Exit Code:    127
      Started:      Sun, 31 May 2020 13:35:00 +0100
      Finished:     Sun, 31 May 2020 13:35:00 +0100
    Ready:          False
    Restart Count:  75
    Environment:    &lt;none&gt;
    Mounts:
      /run/secrets/rji_license.json from tomcat-hostpath0 (rw)
      /usr/local/tomcat/conf/server.xml from tomcat-hostpath3 (rw)
      /usr/local/tomcat/conf/ssl.crt from tomcat-hostpath1 (rw)
      /usr/local/tomcat/conf/ssl.key from tomcat-hostpath2 (rw)
      /var/run/secrets/kubernetes.io/serviceaccount from default-token-8dhnk (ro)
</code></pre>

<p>This is my docker-compose.yml file: </p>

<hr>

<pre><code>version: '3.6'

networks:
  integration:

services:
  mysql:
    environment:
      MYSQL_USER: 'integrationdb'
      MYSQL_PASSWORD: 'password'
      MYSQL_ROOT_PASSWORD: 'password'
    image: db:poc
    networks:
    - integration
    ports:
    - '3306:3306'
    restart: always
    volumes:
       - ./dbdata:/var/lib/mysql
  tomcat:
    image: adapter:poc
    networks:
    - integration
    ports:
    - '8080:8080'
    - '8443:8443'
    restart: always
    volumes:
      - ./license.json:/run/secrets/rji_license.json
      - ./certificates/ssl.crt:/usr/local/tomcat/conf/ssl.crt
      - ./certificates/ssl.key:/usr/local/tomcat/conf/ssl.key
      - ./server.xml:/usr/local/tomcat/conf/server.xml
</code></pre>

<p>Versions of the tools:</p>

<pre><code>kompose: 1.21.0 (992df58d8)

docker: 19.03.9

kubectl:Major:"1", Minor:"18"
</code></pre>

<p>I think my challange here is whithin this type of volumes or files, I dont know how can I migrate or convert them to kubernetes and put the tomcat pod running fine.
Could someone give me a hand?</p>

<pre><code> volumes:
          - ./license.json:/run/secrets/rji_license.json
          - ./certificates/ssl.crt:/usr/local/tomcat/conf/ssl.crt
          - ./certificates/ssl.key:/usr/local/tomcat/conf/ssl.key
          - ./server.xml:/usr/local/tomcat/conf/server.xml
</code></pre>

<p>thanks in advance.</p>

rdinis
<p>When Kompose warns you:</p>

<pre class="lang-none prettyprint-override"><code>WARN Volume mount on the host "/usr/docker/adpater/license.json" isn't supported - ignoring path on the host
</code></pre>

<p>It means that it can't translate this fragment of the <code>docker-compose.yml</code> file into Kubernetes syntax:</p>

<pre class="lang-yaml prettyprint-override"><code>volumes:
    - ./license.json:/run/secrets/rji_license.json
</code></pre>

<p>In native Kubernetes, you'd need to provide this content in ConfigMap or Secret objects, and then <a href="https://kubernetes.io/docs/tasks/configure-pod-container/configure-pod-configmap/#populate-a-volume-with-data-stored-in-a-configmap" rel="nofollow noreferrer">mount the file into the pod</a>.  You can't directly access content on the system from which you're launching the containers.</p>

<p>You can't really get around directly working with the Kubernetes YAML files here.  You could run <a href="https://kompose.io/user-guide/#kompose-convert" rel="nofollow noreferrer"><code>kompose convert</code></a> to generate the skeleton files, but then you'll need to edit those to add the ConfigMaps, PersistentVolumeClaims (for the database storage), and relevant volume and mount declarations, and then run <code>kubectl apply -f</code> to actually run them.  I'd check the Kubernetes YAML files into source control, and maintain them in parallel with your Docker Compose setup.</p>
