Skip to main content

Environments

The Rig Platform supports a multi-environment architecture out-of-the-box.

Environments are associated to a single cluster, meaning Rig supports multiple clusters through environments.

While any mix-and-match are supported, it essentially boils down to two variants, singletenancy and multitenancy. There are no limits to the number of environments, clusters or environments per cluster.

Singletenancy

In a singletenancy setup, the given cluster hosts only a single environment. A simple example of this is two clusters, production and staging, that respectively hosts a production and a staging environment.

SingletenancySingletenancy

In this setup, the Rig Platform communicates with both clusters, to configure the two environments individually. The configuration for the Rig Platform Helms values file looks like this:

rig:
clusters:
staging:
type: k8s
production:
type: k8s
environments:
staging:
cluster: staging
production:
cluster: production
default: true
Default environment

The default marker is used by the Dashboard and CLI for which to pick when nodes environment is specified, e.g. loading the dashboard will in this case show the production environment.

Multitenancy

In a multitenancy setup, a single cluster is hosting a number of environments. This is a convenient way of sharing node resources across environments and simplifying the overall infrastructure.

MultitenancyMultitenancy

When communicating with the cluster, it's important that the namespace generated is unique across environments, so resources don't end up conflicting. This is done by using the namespace_template property, that by default is configured to "{{ .Project.Name }}". In the example below, the environment is suffixed to all namespace names.

rig:
clusters:
production:
type: k8s
environments:
staging:
cluster: production
namespace_template: "{{ .Project.Name }}-{{ .Environment.Name }}"
production:
cluster: production
namespace_template: "{{ .Project.Name }}-{{ .Environment.Name }}"
default: true