While using gitlab auto devops I notice each project being created in its own namespace, defining the service name as production-auto-deploy
.
$kubectl get services --all-namespaces
NAMESPACE NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
app-13094854 production-auto-deploy ClusterIP 10.245.23.224 <none> 5000/TCP 11h
app-13094854 production-postgres ClusterIP 10.245.202.205 <none> 5432/TCP 11h
config-server-13051179 production-auto-deploy ClusterIP 10.245.138.49 <none> 5000/TCP 40m
default kubernetes ClusterIP 10.245.0.1 <none> 443/TCP 11h
gitlab-managed-apps ingress-nginx-ingress-controller LoadBalancer 10.245.200.23 206.189.243.26 80:30888/TCP,443:30962/TCP 11h
gitlab-managed-apps ingress-nginx-ingress-controller-stats ClusterIP 10.245.104.211 <none> 18080/TCP 11h
gitlab-managed-apps ingress-nginx-ingress-default-backend ClusterIP 10.245.202.171 <none> 80/TCP 11h
gitlab-managed-apps tiller-deploy ClusterIP 10.245.31.107 <none> 44134/TCP 11h
kube-system kube-dns ClusterIP 10.245.0.10 <none> 53/UDP,53/TCP,9153/TCP 11h
some-microservice-13093883 production-auto-deploy ClusterIP 10.245.97.62 <none> 5000/TCP 11h
some-microservice-13093883 production-postgres ClusterIP 10.245.245.253 <none> 5432/TCP 11h
Can this service name be customized? For example I want it to include the project name thus mapping production-auto-deploy
-> app-production-auto-deploy
and some-microservice-production-auto-deploy
.
The reason I want these service names to be unique is because I am evaluating spring-cloud-kubernetes and I need unique service names for ribbon discovery using feign clients.
Additionally I am wondering why each project is given its own namespace, is this some kind of best-practice? Can auto devops be configured to deploy all projects in the same namespace?