Kubernetes - Creating a specific namespace for "services"

11/19/2016

In our micro-service architecture we have a number of stateful services:

  • MongoDB
  • MySQL
  • Redis
  • ElasicSearch

We also have two Kubernetes namespaces we use for our different environments:

  • Staging
  • Production

We run each of the above stateful services in both environments / namespaces. I have been wondering as we are limited for resources in our cluster due to a limited budget. Should we create a third namespace for a these services and use them for both production and staging environments? e.g. create a

"Services" namespace?

Whats the best practice in this case? Are there any disadvantages?

-- AndrewMcLagan
devops
docker
environments
kubernetes
microservices

1 Answer

11/19/2016

Namespaces don't usually talk to each other, unless you use full qualified names.

Using the same backend service for Staging and Prod sounds like a very risky bet: anything you screw up in staging will be automatically in Prod. Probably not what you want...

but if you want to know if you can, yes you can, if you use FQDN (i.e. service-name.svc..cluster.local ) for reaching the service.

-- MrE
Source: StackOverflow