File Watcher Provisioning

This page describes how to use the Lenses File Watcher to setup connections to Kafka and other services and have changes applied.

Connections are defined in the provisioning.yaml file. Lenses will then watch the file and resolve the desired state, applying connections defined in the file.

If a connection is not defined but exists in Lenses it will be removed. It is very important to keep your provision YAML updated to reflect the desired state.

Enabling File Watcher Provisioning

File watcher provisioning must be explicitly enabled. Set the following in the lenses.conf file:

lenses.conf
# Directory containing the provision.yaml files
lenses.provisioning.path=/my/dir
# The interval at which Lenses will check for updates 
# in the file seconds
lenses.provisioning.interval=10s

Updates to the file will be loaded and applied if valid without a restart of Lenses.

Directory layout

Lenses expects a set of files in the directory, defined by lenses.provisioning.path. The structure of the directory must follow:

  1. files/ directory for storing any certificates, JKS files or other files needed by the connection

  2. provisioning.yaml - This is the main file, holding the definition of the connections

  3. license.json - Your lenses license file

  ~ tree provisioning-folder
provisioning-folder
├── files
│   └── tuststore.jks
├── license.json
└── provisioning.yaml

4 directories, 0 files
  ~

Managing secrets

The provisioning.yaml contains secrets. If you are deploying via Helm, the chart will use Kubernetes secrets.

Additionally, support is provided for referencing environment variables. This allows you to set secrets in your environment and have the value resolved at runtime.

values.yaml
sslKeystorePassword:
  value: ${ENV_VAR_NAME}

Referencing files

Many connections need files, for example, to secure Kafka with SSL you will need a key store and optionally a trust store.

To reference a file in the provisioning.yaml, for example, given:

values.yaml
    configuration:
      protocol:
        value: SASL_SSL
      sslKeystore:
        file: "my-keystore.jks"

a file called my-keystore.jks is expected in the files directory. This file will be used for the key store location.

Last updated

Logo

2024 © Lenses.io Ltd. Apache, Apache Kafka, Kafka and associated open source project names are trademarks of the Apache Software Foundation.