Deploying Litmus UNS on Kubernetes using Helm Chart
You can deploy Litmus UNS on Kubernetes using a Helm chart. This chart initializes a Litmus UNS deployment on a Kubernetes cluster using the Helm package manager.
- Have familiarity with Kubernetes and ensure you have Kubernetes version 1.25 or higher installed.
- Have familiarity with Helm and ensure you have Helm version 3.8.0 or higher installed.
Note: Create an order at the Litmus UNS homepage to obtain the Kubernetes pull secret from Litmus Automation.
Before installing Litmus UNS, submit the pull secret to the cluster using the following commands:
Now you can install the chart with the release name uns in the uns namespace and simultaneously create the namespace using the following command:
Replace THE-SECRET-NAME with the secret name from the file provided by Litmus. This command deploys Litmus UNS with the default configuration on your Kubernetes cluster.
Tip:
- Use helm list to display all releases. The Parameters section provides a list of configuration options available for installation.
- To learn more about creating, editing, managing, or deleting Kubernetes Secrets, refer to the Managing Secrets using Kubectl guide.
This section provides detailed instructions on how to configure and install Litmus UNS using Helm.
The Helm chart can configure SSL/TLS for the Litmus UNS service using Kubernetes secrets. Below are the steps and configurations for setting up SSL certificates.
By default, the Helm chart deploys a self-signed SSL certificate, which is stored in a Kubernetes secret and generated during the deployment process.
The following parameters can be configured:
- Secret Name: The Helm parameter luns.tlsSecretName specifies the name of the Kubernetes secret used for the SSL certificate.
- Certificate Validity: The certificate's default Time To Live (TTL) is determined by luns.tls.ttl and is set to 390 days by default.
- DNS and IP Configuration:
- DNS Alternative Names: Configure using luns.tls.altNames with a default value of uns.local.
- IP Addresses: The default IP is 127.0.0.1, configured through luns.tls.ipList.
To learn how to set up a static IP and associate it with a Load Balancer service in Azure, you can refer to the Azure manual.
When using this Helm chart, you can define annotations for the Load Balancer service using the Helm parameter service.annotations.
To use a custom SSL certificate, follow these steps:
1. Create a Kubernetes secret with your SSL certificate and private key:
2. Update the Helm chart values to use the name of your new secret. You can do this by setting luns.tlsSecretName to the name of your created secret:
For this guide, when using the release name uns in the uns namespace, the previously mentioned command should be adjusted as follows:
The Helm chart deploys a PostgreSQL database server by default. However, you can also use a more reliable external database managed by a cloud provider like Google Cloud SQL.
To use an external PostgreSQL database, set the following chart parameters:
Parameters:
- host is the PostgreSQL database server hostname.
- port is the PostgreSQL database server port.
- secretName is the Kubernetes secret containing the database administrator credentials, which can be created with the following command: kubectl -n uns create secret generic ext-db-creds --from-literal=POSTGRES_USER='your-postgres-username' --from-literal=POSTGRES_PASSWORD='your-postgres-password'
Note: Follow the Google Cloud SQL documentation to deploy an instance of Cloud SQL for PostgreSQL.
In this example, we will use the Cloud SQL Auth Proxy to set up a connection.
To configure cloud SQL auth proxy:
1. Create a secret with the service account key for cloud SQL auth proxy:
2. Create a file cloudsql-proxy.yaml with the following content, replacing GOOGLE_PROJECT:CLOUDSQL_ZONE:CLOUDSQL_INSTANCE with actual values:
3. Create the cloud SQL auth proxy deployment in the namespace where the chart will be installed:
4. Deploy the chart with the following parameters:
Before upgrading from single mode to cluster mode (parameter mqtt.replicaCount > 1), and vice versa, scale down the MQTT StatefulSet to zero:
To uninstall the Helm chart with the release name uns in the namespace uns:
Ensure that you manually delete the Persistent Volume Claims (PVCs) for StatefulSets in Kubernetes, as they are not automatically removed.