Configurations for a shared kubernetes cluster for multiple projects

7/15/2018

I'm looking for a way of managing multiple projects with a common tech stack: nginx, php-fpm, mysql.

It will be a managed service provided by my company. This means customers won't deal with the cluster internals. Customers choose a plan so they can have more or less resources reserved. Think of it like a service like wordpress.com or ghost.io.

When a customer comes, we reserve a set of nodes for him. The goal is that any customer can use unused resources from another customer.

First attempt: namespaces per customer

namespace customer1:

  • nginx deploy and service
  • php-fpm deploy and service
  • mysql deploy and service

namespace customer2:

  • nginx deploy and service
  • php-fpm deploy and service
  • mysql deploy and service

But I think this division is too rigid in order to share unused resources.

Second attempt: shared namepace, custom names per resources

namespace hive:

  • customer1.nginx deploy and service
  • customer1.php-fpm deploy and service
  • customer1.mysql deploy and service

  • customer2.nginx deploy and service

  • customer2.php-fpm deploy and service

  • customer2.mysql deploy and service

It look better for me, but I think resources are too tight coupled to cusomer yet.

The only thigs that define a project are a domain, a source code directory and a database (I'll deal later with logs and other stuff).

Are there any other approaches to think of the cluster as a kind of "compute fog"?

-- Manel R. Doménech
cloud
kubernetes

1 Answer

7/16/2018

I think namespace is the right thing to do what you want. All namespaces can share the same physical resources, unless you preserve nodes for each namespace, there is no rigid resource division for namespace with general usage.

-- Kun Li
Source: StackOverflow