Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Helm

This page describes installing Lenses in Kubernetes via Helm.

Only Helm version 3 is supported.

On start-up, Lenses will be in bootstrap mode unless it has an existing Kafka Connection. Enable provisioning to automate the creation of connections.

First, add the Helm Chart repository using the Helm command line:

helm repo add lensesio https://helm.repo.lenses.io
helm repo update

Use helm to install Lenses with default values:

helm install lenses lensesio/lenses --namespace lenses --create-namespace

The default install of Lenses will place Lenses in bootstrap mode, you can add the connections to Kafka manually and upload your license or automation with provisioning. Please refer to the GitHub values.yaml for all options.

Provisioning

To automatically provision the connections to Kafka and other systems set the .Values.lenses.provision.connections to be the YAML definition of your connections. For a full list of the connection types supported see Provisioning.

The chart will render the full YAML specified under this setting as the provisioning.yaml file.

Alternatively you can use a second YAML file, which contains only the connections pass them at the command line when installing:

helm install lenses \
charts/lenses \
--values charts/lenses/values.yaml \
--values provisioning.yaml

Helm Chart components

The chart uses:

  1. Secrets to store Lenses Postgres credentials and authentication credentials

  2. Secrets to store connection credentials such as Kafka SASL_SCRAM password or password for SSL JKS stores.

  3. Secrets to hold the base64 encoded values of the JKS stores

  4. ConfigMap for Lenses configuration overrides

  5. Cluster roles and role bindings (optional).

Secrets and config maps are mounted as files under the mount /mnt:

  1. settings - holds the lenses.conf

  2. secrets - holds the secrets Lenses and license

  3. provision-secrets - holds the secrets for connections in the provisioning.yaml file

  4. provision-secrets/files - holds any file needed for a connection, e.g. JKS files.

Kubernetes RBAC

Lenses calls the Kubernetes API only to run SQL Processors in KUBERNETES mode (lenses.sql.mode). In IN_PROC or CONNECT mode (the default is IN_PROC) it makes no Kubernetes API calls, and you can set rbacEnable: false.

With rbacEnable: true (the default), the chart creates a ClusterRole and ClusterRoleBinding for the ServiceAccount Lenses runs as, so that Lenses can deploy SQL Processors to any namespace. Unless you set serviceAccount, that is the namespace's default ServiceAccount, so the permissions also apply to every other pod in the namespace that does not set its own ServiceAccount.

From chart 5.5.25 the ClusterRole only grants the permissions Lenses uses. It no longer grants list or watch on Secrets, write access to pods, or access to services, ingresses, statefulsets, persistent volumes or namespace creation.

From chart 5.5.25 you can give Lenses its own ServiceAccount and limit it to the namespaces your SQL Processors run in:

  • serviceAccount.create creates a ServiceAccount named after the release, for example lenses. Put cloud IAM annotations, such as EKS IRSA or GKE Workload Identity, in serviceAccount.annotations.

  • namespaceScope creates a Role and RoleBinding in each namespace of lenses.sql.namespaces instead of the ClusterRole. Without a list, it uses the release namespace.

  • lenses.sql.namespaces also sets lenses.kubernetes.namespaces, so that Lenses only uses those namespaces. The namespaces must already exist.

To keep cluster-wide access with a dedicated ServiceAccount, set serviceAccount.create: true and leave namespaceScope at false.

Managing RBAC yourself

Set rbacEnable: false, create a Role and RoleBinding in each namespace Lenses deploys SQL Processors to, and limit Lenses to those namespaces. Kubernetes permissions for SQL Processors lists the rules.

lenses.conf

The main configurable options for lenses.conf are available in the values.yaml under the lenses object. These include:

  • Authentication

  • Database connections

  • SQL processor configurations

To apply other static configurations use lenses.append.conf, for example:

Authentication secrets

Set accordingly under**lenses.security.**

For SSO set lenses.security.saml

Postgres

To use Postgres as the backing store for Lenses set the details in the lenses.storage.postgres object.

If Postgres is not enabled a default embedded H2 database is used. To enable persistence for this data:

External Secrets

The chart relies on secrets for sensitive information such as Passwords. Secrets can rotate and are commonly stored in an external store such as Azure KeyVault, Hashicorp Vault or AWS Secrets Manager.

If you wish to have the chart use external secrets that are synchronized with these providers, set the following for the Lenses user:

For Postgres, add additional ENV variables via the lenses.additionalEnv object to point to your secret and set the username and password to external in the Postgres section.

Ingress & Services

While the chart supports setting TLS on Lenses itself we recommend placing it on the Ingress resource

Ingress and service resources are supported.

Enabled an Ingress resource in the values.yaml:

Enable a service resource in the values.yaml:

Controlling resources

To control the resources used by Lenses:

Enabling SQL Processors in K8s mode

To run SQL Processors in KUBERNETES mode and control their defaults:

To control the namespaces Lenses can deploy SQL Processors to, use the lenses.sql.namespaces value (chart 5.5.25 and later). See Kubernetes RBAC.

Prometheus metrics

Prometheus metrics are automatically exposed on port 9102 under /metrics.

Example Values files

For Connections, see Provisioning examples. You can also find examples in the Helm chart repo.

Last updated

Was this helpful?