Configuration ============= The service allowed two variants of configuration: #) use the Configurator service #) use the configuration file The service reads settings from the configuration file by default. You can specify the `--luna-config` option for pulling settings from the Configurator service, see the `configurator `_. Auto reload configuration ------------------------- The service supports an auto-reload of configurations. You can enable this feature by specifying the `config-reload` option on the command line. The service periodically checks for new settings. If the current settings and new pulled settings are the same the service will not perform any actions. You can specify the check period via the `pulling-time` command line argument (10 seconds by default). If a configuration fetching has failed, the service will work without applying any changes to the existing configurations. If check connections with the new configuration have failed, the service will retry pulling the new configuration after `pulling-time` seconds. The service will shut down after 10 failed attempts. .. warning:: Service may work incorrectly while the new settings are being applied. It is strongly recommended not to send requests to the service when you change important settings (database credentials, work plugins list, and others). Configuration requirements -------------------------- There are several parameters that are responsible for interacting with the kubernetes cluster. - The main significant parameter is `CLUSTER_LOCATION`. There are several allowed values of this parameter: - `internal`: suggests service works in k8s cluster and doesn't require and other additional settings - `remote`: suggests service works with a remote k8s cluster and properly defined `CLUSTER_CREDENTIALS` settings (highly not recommended for anything except development) - `local`: suggests service works on the same machine as the k8s cluster (highly not recommended for anything except development) - If `luna-lambda` is configured to use a remote kubernetes cluster it is required to define `CLUSTER_CREDENTIALS`: - suggests access to the k8s cluster using an ssl connection - `HOST` is the kubernetes cluster host - `TOKEN` is the kubernetes cluster token which must be provided by the kubernetes cluster administrator (each token has its own expiration time, do not forget to use actual token) - `CERTIFICATE_PATH` is the path to the SSL certificate which must be provided by the kubernetes cluster administrator - Independently of the `CLUSTER_LOCATION` configuration it is required to define `S3` setting using credentials for an s3-like storage with possibility to read/write to specified bucket. It will be used by `luna-lambda` for storing archives with lambdas. .. warning:: At present there is no mechanism for s3 bucket garbage collection. - There is `LAMBDA_REGISTRY` parameter. It is required read and write access to this registry. If `luna-lambda` is running in a kubernetes cluster, it is required to grant access to this registry from the kubernetes cluster. - There is `LAMBDA_INSECURE_REGISTRIES` parameter. If `LAMBDA_REGISTRY` contains an insecure registry and/or it is required access to any other insecure registries during the `lambda creation process <./creation_pipeline.html>`_, they must be specified in `LAMBDA_INSECURE_REGISTRIES`. Configuration file for luna-lambda ---------------------------------- .. literalinclude:: ../../../luna_lambda/configs/config.conf Additional notes ^^^^^^^^^^^^^^^^ .. list-table:: :header-rows: 1 * - Parameter - Description * - ``IMAGE_CREATION_TIMEOUT`` - During `lambda creation <../_static/api.html#operation/createLambda>`_, `lambda update <../_static/api.html#operation/updateLambda>`_, `workflow creation <../_static/api.html#operation/createWorkflow>`_, or `job creation <../_static/api.html#operation/createJob>`_, if the image build fails to complete in time, the build task is canceled, and the operation fails. * - ``IMAGE_ARCHIVE_DOWNLOAD_TIMEOUT`` - During `lambda update <../_static/api.html#operation/updateLambda>`_, if the lambda image archive is not found in S3, the request is retried several times until the timeout, allowing for concurrent upload to complete. * - ``LAMBDA_DELETION_TIMEOUT`` - During `lambda update <../_static/api.html#operation/updateLambda>`_, or `lambda config update <../_static/api.html#operation/putLambdaConfig>`_, if the old lambda is not deleted until timeout, or if the ongoing image build for the old lambda is not stopped until timeout, the update fails. * - ``LAST_ACTIVITY_UPDATE_INTERVAL`` - If ``LUNA_LAMBDA_INACTIVE_LAMBDA_CLEAR_INTERVAL.active`` (for lambdas) or ``LUNA_LAMBDA_INACTIVE_JOB_CLEAR_INTERVAL.active`` (for jobs) is 0, the `last activity <../lambda_metrics.html#last-activity-metric>`_ metric is updated at this periodicity. Otherwise, ``LAST_ACTIVITY_UPDATE_INTERVAL`` is ignored, and ``LUNA_LAMBDA_INACTIVE_..._CLEAR_INTERVAL.interval`` is used instead. * - ``LAMBDA_WARMUP_TIMEOUT`` - Time budget (in seconds) for the lambda's `checkWarmup <../development.html#warmup-check>`_ function to start returning ``True``. The deployment's ``startupProbe`` is given a ``failureThreshold`` sized to this timeout, so the ``livenessProbe`` cannot kill the pod while it is still warming up. If ``checkWarmup`` has not succeeded by the time the budget is exhausted, the startup probe fails and the pod is restarted.