Kompose feature similar to docker-compose links

9/5/2018

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?

-- Allan Moreira Leite
docker
docker-compose
kompose
kubernetes

1 Answer

9/11/2018

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.

-- Allan Moreira Leite
Source: StackOverflow