nmaas Installation Guide
Requirements
To install nmaas into an existing Kubernetes cluster, the following requirements must be met:
- Kubernetes version
>=1.16
- Helm v3 support in the Kubernetes cluster
- Existing ingress controller, preferably with a default TLS certificate set (more information available below)
- An integration with an external load-balancer or MetalLB for bare-metal deployments, so that IPs can be assigned to
LoadBalancer
services
nmaas Components
nmaas is comprised of multiple components, and a brief description for each one is provided in the self-hosting introduction page.
Installation
The nmaas installation is a two-step process - first an instance of GItLab must be deployed and configured, and then nmaas itself. The two components cannot be deployed at the same time, since during the deployment process nmaas requires a GitLab API key to be specified.
GitLab Installation
GitLab can be deployed using the official Helm chart whose source code is also publicly available. Note that GitLab requires at least 8GB of memory to run. Also note that it requires both a PostgreSQL database and a Redis instance, both of which can either be externalized or deployed in-cluster, by the official chart.
GitLab and an External Database
GitLab can use an external PostgreSQL instance, but during the deployment process either the root user must be specified, or the following extensions enabled in the target GitLab database:
- btree_gist
- pg_trgm
This can be done using the following commands:
GitLab Version
8.2.0
is the latest version of the GitLab chart that has been tested with the latest version of nmaas.
Bellow is a snippet of the mandatory parameters that must be specified during GitLab's deployment, so that it will be compatible with nmaas. The complete list of supported value parameters is available in the official GitLab Helm chart Git repository.
gitlab-values.yaml | |
---|---|
|
Note that the secrets whose names are specified in .Values.postgresql.existingSecret
(for internal PostgreSQL), .Values.global.initialRootPassword.secret
, .Values.global.psql.password.secret
(for external PostgreSQL), and .Values.global.smtp.password.secret
must be manually created. These secrets contain the PostgreSQL root and user passwords, the initial root password to be used by GitLab, as well as SMTP server credentials. Below is a snippet that can be reused to create such secrets:
Note that the built-in PostgreSQL chart that can be automatically deployed together with GitLab is based on Bitnami's PostgreSQL chart, so additional customization options can be seen from Bitnami's GitHub page.
In case an external PostgreSQL instance will be used then the secret specified in .Values.global.psql.password.secret
must be created automatically. Also, keep in mind the warning given above, if a regular PostgreSQL user is specified, the btree
and trgm
extensions must be enabled beforehand.
GitLab Email Sending
nmaas does not rely on email sending via GitLab, so both the email and smtp sections in the value files can be left with their default values - unconfigured. However, users are free to customize these sections according to their own environments.
Once all configuration parameters have been specified, GitLab can be installed using the following Helm v3 command:
GitLab Deployment Duration
Please allow more than 15 minutes for GitLab to be deployed, depending on hardware configuration and current resource utilization.
Once GitLab has been deployed, it can be accessed by navigating to gitlab.<TLD>
, where TLD is the value specified for the .Values.global.hosts.domain
parameter.
GitLab Public Exposure
Note that after deployment, by default, anyone can register to your newly deployed GitLab instance. This can be configured by logging in as the root GitLab user.
Users are advised to determine whether public exposure of the GitLab web interface is needed at all. nmaas' GitLab integration can work even if only public access to the GitLab SSH interface is provided, since repository cloning always relies on SSH as the transport protocol.
To create a GitLab API token that can be used by nmaas, perform the following steps:
- Login to GitLab using the root account;
- Click on the avatar image in the top right corner and select
Settings
; - From the left-hand navigation menu choose
Access Tokens
; - Create a new access token with no expiration date by simply leaving the
Expires at
field empty, and assigning all available scopes; - Write down the API token, it will be needed shortly.
SSH Access to GitLab Repositories
GitLab supports SSH access to any created repositories. If you want to allow your users to clone the repositories where their application configuration is stored, then you will have to alter the GitLab Shell service, and change its type to LoadBalancer, so that a routable IP address will be assigned to it.
nmaas Installation
The source code for the nmaas Helm chart is publicly available on nmaas-platform/nmaas-chart. The README.md
file provides details on all the customizable value
parameters for a given chart version.
The following manual steps must be performed before deploying nmaas:
-
Creating a private/public SSH keypair so that nmaas Platform can access nmaas Helm:
-
The secrets for the SP, API, and admin password:
-
Create the nmaas Janitor secret containing the GitLab API key, generated previously:
Once the required secrets have been created, nmaas can be deployed using the following command (make sure to deploy in the same namespace as GitLab):
It is recommended to use nmaas-system
as the namespace where nmaas and all associated components (PostgreSQL, GitLab) will be deployed.
nmaas Deployment Time
Please allow at least 10 minutes for nmaas to be fully deployed, depending on hardware configuration and resource utilization.
Verifying the Installation
You can verify that nmaas has been successfully deployed by navigating to its ingress URL from your browser, logging in as the admin user and selecting Settings -> Monitoring
. From this location, you can execute checks for all the required components of nmaas. A fully functional installation should return a successful response for all monitors.
Administrator Information
For more detailed instructions, refer to the Domain Admin Guide
Creating New Domains
Creating a new customer domain within nmaas is a two-step process:
- First, the new domain should be added from the nmaas web interface. The following steps should be performed.
- Login to the nmaas Portal as the administrator user (the default administrator username is
admin
and the desired password is passed as a installation parameter); - Navigate to
Settings -> Domains
; - Click the
Add
button and enter the required parameters specific to the newly created domain:Name
- full name of given domain (e.g.Test Domain
)Codename
- abbreviated name of the domain (e.g.testdom
)Kubernetes namespace
(Optional) - a namespace dedicated for this domain to be created in the next stepKubernetes storage class
(Optional) - a specific storage class to be used for persistent volumes created in this domain (typically should be left blank)Kubernetes ingress class
(Optional) - a ingress class supported by the ingress controller deployed for this domain (should be left blank if a single common controller supports all the domains)External service domain
- a base URL for accessing all applications deployed in this domain (typically should contain the Codename and the URL of nmaas itself, e.g.testdom.nmaas.example.com
)DCN deployment type
- by default should be set toManual
DCN status
- by default should be set toConfigured
Customer networks
(to be removed) - list of network prefixes to which applications deployed in this domain should have access (thought this parameter is currently mandatory it is not used for any automated actions so any initial values can be provided)
- Click the
Submit
button to create the domain
- Login to the nmaas Portal as the administrator user (the default administrator username is
-
Then, the following operations should be performed within the cluster:
- Create a new Kubernetes namespace with the same name as the domain
-
Create a new MetalLB range with the same name as the new customer domain, and set that addresses should not be automatically assigned. To accomplish this, the existing MetalLB ConfigMap can simply be edited to include the new configuration block. An example MetalLB
ConfigMap
is available below:config.yaml With the above configuration, whenever a LoadBalancer Kubernetes Service is created, it will be assigned an address from the default-pool, unless the
annotation metallb.universe.tf/address-pool: domain1
is present, in which case an address from the domain1 pool will be allocated. -
Deploy a new ingress controller in the new domain namespace, with an ingress class that will match the name of the domain.
Additional Documentation
An online user guide is available at nmaas User Guide page.
Information about the nmaas applications deployment and configuration process and the nmaas portfolio is available on the nmaas Tools page.
In case of any questions please contact the nmaas Team at [email protected].