Ability to set Hostname and Network name through .gitlab-ci
Release notes
You can’t set the Hostname and Network Name, this causes problems with MySQL authentication with network-resolve enabled. A solution would be to implement two variable that set the Hostname and Network Name, like:
$CI_HOSTNAME
$CI_NETWORK_NAME
And have them set the container-name, plus it creates and ties the container to a network with the name of choosing (container-name and network are features in the docker-compose.yml).
Problem to solve
It is quite common for micro services to all have individual MySQL users that are tide to their host name and network name. For MySQL authencation with name-resolve to work MySQL should be able to resolve the domain for an IP and get the same domain back when it does a lookup on that IP. This way Gitlab-CI can also be used to check if micro service have their authentication and authorizations correct that are depending on network-resolve. I am sure there are other use cases out there, but this is the problem here.
Proposal
Create to variables that are optional.
$CI_HOSTNAME: hostname
$CI_NETWORK_NAME: domain.com
These would be used by Gitlab-CI to do something similar as
Docker-compose.yml:
…
Micro-service:
…
container-name: hostname
networks:
- my-network
…
networks:
my-network:
name: domain.com
Intended users
- Sidney (Systems Administrator)
- Allison (Application Ops)
- Ingrid (Infrastructure Operator)
- Amy (Application Security Engineer)
- Isaac (Infrastructure Engineer)
- Alex (Security Operations Engineer)
Feature Usage Metrics
Authentication and authorization always are complicated matters which are good to have checked thoroughly. My guess there are many people use work arounds like setting network configurations in their runners or spinning of a docker image to run their own docker-compose.yml to do this. For implementation of the $CI_HOSTNAME and $CI_NETWORK_NAME I guess it is just checking how many users set them?
/lable ~”GitLab.com Feature Request”