diff --git a/README.md b/README.md index b8e333d..654a343 100644 --- a/README.md +++ b/README.md @@ -28,12 +28,14 @@ controlled through environment variables. ### Environment variables -| Variable Name | Type | Default | Description | -| ------------------------- | ------ | ---------------------------------------- | ----------------------------------------------------------- | -| PROMTAIL_CLIENT_URL | string | http://loki_loki_1:3100/loki/api/v1/push | URL pointing to the Loki push endpoint | -| PROMTAIL_LABEL_HOST | string | $(hostname) | Value of the label "host" which is added to all log entries | -| PROMTAIL_LABEL_JOB | string | beach | Value of the label "job" which is added to all log entries | -| PROMTAIL_CLIENT_TENANT_ID | string | | An optional tenant id to sent as the `X-Scope-OrgID`-header | +| Variable Name | Type | Default | Description | +| ---------------------------- | ------ | ---------------------------------------- | ----------------------------------------------------------- | +| PROMTAIL_CLIENT_URL | string | http://loki_loki_1:3100/loki/api/v1/push | URL pointing to the Loki push endpoint | +| PROMTAIL_LABEL_HOST | string | $(hostname) | Value of the label "host" which is added to all log entries | +| PROMTAIL_LABEL_JOB | string | beach | Value of the label "job" which is added to all log entries | +| PROMTAIL_CLIENT_TENANT_ID | string | | An optional tenant id to sent as the `X-Scope-OrgID`-header | +| PROMTAIL_BASIC_AUTH_USERNAME | string | | Username to use for basic auth, if required by Loki | +| PROMTAIL_BASIC_AUTH_PASSWORD | string | | Password to use for basic auth, if required by Loki | ## Security aspects diff --git a/root-files/opt/flownative/lib/promtail.sh b/root-files/opt/flownative/lib/promtail.sh index acaaf1b..283725a 100755 --- a/root-files/opt/flownative/lib/promtail.sh +++ b/root-files/opt/flownative/lib/promtail.sh @@ -28,6 +28,8 @@ export PROMTAIL_CLIENT_URL="${PROMTAIL_CLIENT_URL:-http://loki:3100/loki/api/v1/ export PROMTAIL_LABEL_JOB="${PROMTAIL_LABEL_JOB:-beach}" export PROMTAIL_LABEL_HOST="${PROMTAIL_LABEL_HOST:-$(hostname)}" export PROMTAIL_CLIENT_TENANT_ID="${PROMTAIL_CLIENT_TENANT_ID:-}" +export PROMTAIL_BASIC_AUTH_USERNAME="${PROMTAIL_BASIC_AUTH_USERNAME:-}" +export PROMTAIL_BASIC_AUTH_PASSWORD="${PROMTAIL_BASIC_AUTH_PASSWORD:-}" export PATH="${PATH}:${PROMTAIL_BASE_PATH}/bin" EOF diff --git a/root-files/opt/flownative/promtail/etc/config.yaml b/root-files/opt/flownative/promtail/etc/config.yaml index 7394b20..c98b0a6 100644 --- a/root-files/opt/flownative/promtail/etc/config.yaml +++ b/root-files/opt/flownative/promtail/etc/config.yaml @@ -27,3 +27,7 @@ clients: timeout: 10s tenant_id: ${PROMTAIL_CLIENT_TENANT_ID} stream_lag_labels: filename + +basic_auth: + username: ${PROMTAIL_BASIC_AUTH_USERNAME} + password: ${PROMTAIL_BASIC_AUTH_PASSWORD}