Should my database server be a Pod on the same Service

5/1/2017

In terms of providing a url (to a postgres database) for my web server. Should the postgres database be behind it's own Service or is it okay for it to be a Pod on the same Service as the web server?

Can I configure a Pod to have a FQDN that doesn't change?

-- Mitkins
kubernetes

1 Answer

5/1/2017

Its absolutely fine and I would say recommended to keep the database behind its own service in k8s. The database would need to be backed by a persistent volume as well.

You can reference the service in other webserver/application pods. As long as you expose the service properly, FQDN should work.

"This is one of the simpler methods, you could evolve based on your network design"

-- jkantihub
Source: StackOverflow