Multi-Tenancy

Lightbits v2.2.1 and above enforces tenant isolation on the control plane ("multi-tenancy"). With multi-tenancy, multiple tenants can share a Lightbits cluster without being able to see or affect each other's resources when accessing the Lightbits API or using the Lightbits command line tools.

Command line tools and all other API users must use the v2 Lightbits API. The v2 API includes provisions for authentication and authorization via standard JSON Web Tokens ("JWTs"), as well as transport security for all API operations.

The following three predefined roles are created by default:

  • cluster-admin (system scope)
  • admin (project scope)
  • viewer (project scope)

Currently, roles cannot be added.

At installation, the user can provide their own certificate and CA to be used by the peers. If these files are not provided, the installation will generate self-signed certificates.

Certificates Directory

By default, certificates are stored at certificates_directory=~/lightos-certificates on the Ansible controller machine.

certificates_directory can be overridden via cmd-line:

Bash
Copy

Or via group_vars/all.yml:

YAML
Copy

Certificate Types

Implementing multi-tenancy involves three sets of certificates:

  • Multi-Tenancy

    • Certificates Directory
  • etcd Certificates for mTLS Peer Communication

  • API Service Certificates for TLS

  • System Scope Cluster Admin Certificates

    • Generating Self-Signed Certificates
    • Bring Your Own Certificates

etcd Certificates for mTLS Peer Communication

All etcd services serve client APIs only on localhost. This minimizes the exposure of etcd to outside malicious activity.

Peer communication must be encrypted at all times, since etcd passes sensitive traffic between its peers.

The installation script expects the following files to be present at certificates_directory on the Ansible controller machine:

Bash
Copy
  • etcd-ca: Certificate authority (CA) parameters for etcd certificates. This CA is used to sign certificates used by etcd (such as peer and server certificates).
  • {ansible_hostname}-cert-etcd-peer: The peer certificate is used by etcd for peer communication.

These files are passed to the following etcd parameters: --peer-cert-file and --peer-key-file.

{ansible_hostname} is the name we gave the etcd node in the hosts file.

Example

A three-node cluster with server00-02 will result in:

Bash
Copy
  • These names are hard-coded in the installation script. Only the source directory can change.
  • If these files are not provided, the installation will generate self-signed certificates and place them at certificates_directory on the Ansible controller machine.

API Service Certificates for TLS

All API endpoints are TLS-enabled by default.

The user can provide their own SSL certificates, or the installation process will generate a self-signed certificate.

These are the files used by api-service to set up TLS communication.

Bash
Copy

System Scope Cluster Admin Certificates

These files will be stored in etcd and used to authenticate a system-scope project.

These are the files used to generate system scope credentials:

Bash
Copy

Generating Self-Signed Certificates

The Lightbits installation playbook checks for certificates_directory existence. If it does not exist, a folder will be created and populated with self-signed certificates. If it exists, the playbook will verify that all expected certificates files are present. In case one is missing the installation will fail.

  • Certificate file names are hard-coded in the installation script. Only the source directory can change. These are pairs and go together.

File name format:

<name>.pem: Certificate.

<name>-key.pem: RSA private key that matches the certificate.

  • In case you want to regenerate the self-signed certificates, the certificates_directory and all of its content should be deleted.

Bring Your Own Certificates

You can provide your own certificates for each of the components.

You can override part or all of the files before running the install-lightos.yaml playbook.

Type to search, ESC to discard
Type to search, ESC to discard
Type to search, ESC to discard