# Environment Variables (/integrations/keda/reference/environment-variables)



The scaler binary reads exactly **two** environment variables at startup. Both are validated by
`LoadConfig`; an invalid value aborts the process with a non-zero exit code rather than starting
with a silent fallback. The per-`ScaledObject` connection settings (broker address, queue, TLS,
auth) are **not** environment variables — they live in
[trigger metadata](/integrations/keda/reference/scaled-object-metadata).

## Variables [#variables]

| Variable    | Default | Description                                                                                                                         |
| ----------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------- |
| `GRPC_PORT` | `9090`  | TCP port for the scaler's gRPC server. Validated to be an integer in the range `1`–`65535`. The server binds `0.0.0.0:<GRPC_PORT>`. |
| `LOG_LEVEL` | `info`  | Structured-log level. Case-insensitive; must be one of `debug`, `info`, `warn`, `error`. Output is JSON via Go's `slog`.            |

```bash title="Run with custom values"
docker run -p 9090:9090 \
  -e GRPC_PORT=9090 \
  -e LOG_LEVEL=debug \
  kubemq/kubemq-keda-scaler:1.0.0
```

<Callout type="warn">
  An out-of-range `GRPC_PORT` (e.g. `0` or `70000`) or an unrecognized `LOG_LEVEL` causes the scaler
  to log an error and exit immediately. There is no fallback to the default in these cases.
</Callout>

Under Helm, these map to `env.grpcPort` and `env.logLevel` — see the
[Helm values table](/integrations/keda/reference/scaled-object-metadata#helm-values).

## Installation methods [#installation-methods]

<Tabs items="[&#x22;Helm&#x22;, &#x22;Kubernetes manifests&#x22;, &#x22;Docker&#x22;]">
  <Tab value="Helm">
    ```bash title="Install"
    helm install kubemq-keda-scaler deploy/helm/kubemq-keda-scaler/
    ```

    ```bash title="Install with overrides"
    helm install kubemq-keda-scaler deploy/helm/kubemq-keda-scaler/ \
      --set env.logLevel=debug \
      --set resources.requests.cpu=100m
    ```

    ```bash title="Install with a TLS CA mount"
    helm install kubemq-keda-scaler deploy/helm/kubemq-keda-scaler/ \
      --set extraVolumes[0].name=certs \
      --set extraVolumes[0].secret.secretName=kubemq-ca-cert \
      --set extraVolumeMounts[0].name=certs \
      --set extraVolumeMounts[0].mountPath=/certs \
      --set extraVolumeMounts[0].readOnly=true
    ```
  </Tab>

  <Tab value="Kubernetes manifests">
    The raw manifests under `deploy/kubernetes/` are minimal and intended for quick testing; use the
    Helm chart for production.

    ```bash title="Apply raw manifests"
    kubectl apply -f deploy/kubernetes/
    ```
  </Tab>

  <Tab value="Docker">
    The KubeMQ broker must be reachable from the container network.

    ```bash title="Run the scaler container"
    docker run -p 9090:9090 kubemq/kubemq-keda-scaler:1.0.0
    ```
  </Tab>
</Tabs>

## Running a local KubeMQ broker [#running-a-local-kubemq-broker]

To exercise the example manifests against a local broker, run KubeMQ exposing the gRPC port
(`50000`) and the shared HTTP port (`9090`), and point `kubemqAddress` at it:

<RunKubeMQ ports="[50000, 9090]" />

<Callout type="info">
  The scaler reads the queue's `Waiting` count over the standard KubeMQ gRPC API (port `50000`) — the
  same API your [queue](/learn/queues) consumers use; it does not require any connector to be enabled
  on the broker. The broker's HTTP port `9090` is its shared port and is unrelated to the scaler's own
  gRPC port, which also defaults to `9090` but listens inside the scaler pod.
</Callout>

## Related [#related]

* [ScaledObject metadata](/integrations/keda/reference/scaled-object-metadata) — per-trigger connection and tuning fields.
* [gRPC RPCs](/integrations/keda/reference/grpc-rpcs) — the RPC surface served on `GRPC_PORT`, plus health checks.
