Installation for production use
Flexible configuration via the values.yamlfile
For production use with a lot of settings, we recommend providing deployment arguments and settings in values.yaml.
Warning
Never edit ./helm/values.yaml directly! An error in the file will disrupt the service.
To edit, copy the ./helm/values.yaml file and work with the copy. This way you will always be able to restore the original configuration. When done, provide the path to your file through the --values argument. For an example of the file's contents and format, refer to ./help/values.example.yaml.
When using the --values parameter, all other arguments provided to the ./init.sh script and related to the distribution deployment configuration will be ignored. The script will give priority to the arguments from your file and retrieve any missing arguments from the original ./helm/values.yaml, which is part of the base deployment template.
cp ./help/values.example.yaml ./my-prod-values.yaml
# ... edit my-prod-values.yaml ...
./init.sh --values ./my-prod-values.yaml
Default settings in ./helm/values.yaml may change during DataLens updates. In your custom file, only include the settings you want to override and that control the features you want to use.
Using the --values-mergeparameter
To combine settings from values.yaml with command-line arguments, use the --values-merge parameter. This deployment option may be useful for one-time operations, such as generating certificates or activating specific features, where the general settings are provided in values.yaml.
cp ./helm/values.yaml ./my-prod-values.yaml
# ... edit my-prod-values.yaml ...
./init.sh --values ./my-prod-values.yaml --ingress-domain <domain> --ingress-tls --ingress-tls-gen --values-merge
Tip
Arguments provided via --values-merge override arguments in values.yaml. Other arguments take default values. For example, if --ingress-domain is not specified, the system will use the datalens.enterprise value.
For a list of arguments and their default values, see Available deployment arguments in Installing and running DataLens On-premises.
Overview of distribution services and their network interactions
DataLens is a bunch of microservices. The installation script will deploy them to Kubernetes. External traffic from the user will go to the Ingress controller, which will direct it to ui. Next, ui will interact with backend services (us, control_api, data_api) via internal Kubernetes network names.
Here is a digram illustrating this architecture:
Deployment with an external PostgreSQL cluster
An embedded database is an inefficient practice for production workflows. Use an external managed PostgreSQL cluster instead. With great numbers of users, this will give you flexibility when using the service's objects allow you to build a fault-tolerant architecture.
Step-by-step procedure
-
In the
my-prod-values.yamlfile, disable the embedded PostgreSQL.infra: postgres: enabled: false # Disable the embedded PostgreSQL -
In the same file, under
postgres, specify the parameters for connection to the external cluster:postgres: POSTGRES_HOST: 'your-pg-host.db.example.com' POSTGRES_PORT: '5432' # ... as well as other user and database parameters, if they differ from the standard ones -
At the start, you can specify your passwords in
./init.sh, but this is not safe: it is better to provide them via secrets.
When you run the installation with such values.yaml, DataLens will not create its own PostgreSQL pod but will immediately connect to the external cluster you specify.
Using your own TLS certificates
Self-signed certificates are suitable for testing; however, in production, browsers will warn users to use certificates issued by your corporate or public certificate authority (CA).
This is done through the --ingress-tls-crt and --ingress-tls-key arguments:
./init.sh \
--k3s-install \
--ingress-domain datalens.mycompany.com \
--ingress-tls \
--ingress-tls-crt /path/to/your/cert.pem \
--ingress-tls-key /path/to/your/private.key
The script will save these certificates in Kubernetes secrets, and the Ingress controller will use them to terminate TLS traffic.
You can also specify the certificates directly in the values.yaml file.
For more details on secrets, see DataLens On-premises secrets.
Guidelines for designing a fault-tolerant architecture
High availability (HA) is achieved by duplicating components. In Kubernetes, you can do this by increasing the number of replicas.
The values.yaml file has the application section in which you can specify replicas for each service:
application:
control_api:
replicas: 2 # Run two instances of `control-api`, which is a connection and dataset management service
data_api:
replicas: 3 # Run three instances of `data-api`, which is a service that accesses the source
us:
replicas: 2 # Run two instances of `us`, which is a metadata storage service
# ... and so forth
Scaling recommendations
Start scaling the most loaded components: data_api, control_api, us.
For full-value HA, you need a fault-tolerant Kubernetes cluster of multiple nodes (servers). An installation with the --k3s-install flag creates a single-node cluster and is not fault-tolerant.
Use an external PostgreSQL and Valkey™ fault-tolerant cluster.
Results
You have covered some important aspects of installing DataLens for production use. Now you know how to manage your configuration using values.yaml and connect external systems.