Search code examples
dockerkubernetesdocker-composekompose

Kompose feature similar to docker-compose links


We are doing a POC using docker for integration tests. We have a container with the image of an api and another container with one mongodb.

The api container must access mongodb via db-mongo-dev-company.aws.local, so I put the following entry in docker-compose:

links: - "mongodb: db-mongo-dev-company.aws.local"

It works perfectly with "docker-compose up".

The problem is that kompose does not have support for the feature "links", according to the following link:

https://github.com/kubernetes/kompose/blob/master/docs/conversion.md

We can't find an alternative to make this link, do you have any idea?


Solution

  • To solve this situation, I simply changed the url in the properties of the api project.

    Example: I Have a file named bootstrap.yaml in src/main/resources that is looking for the spring cloud. In the DockerFile, after i pull the image of the api, i replace the file by another bootstrap.yaml file with another properties, changing the url of the mongodb.