Skip to content

Gateway(nginx): Defaulte env variable values with entrypoint scripts #57

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 20, 2024

Conversation

qclaogui
Copy link
Owner

@qclaogui qclaogui commented Mar 20, 2024

Related issues: nginx/docker-nginx#592 , It looked like this feature might not be implemented, so I found another solution: nginx/docker-nginx#687 (comment)

❯ cat 10-default-lgtmp.envsh
#!/usr/bin/env sh
set -eu

# As of version 1.19, the official Nginx Docker image supports templates with
# variable substitution. But that uses `envsubst`, which does not allow for
# defaults for missing variables. Here, first use the regular command shell
# to set the defaults:

# Default value is Mimir in monolithic mode
export MIMIR_DISTRIBUTOR_HOST=${MIMIR_DISTRIBUTOR_HOST:-mimir}
export MIMIR_QUERY_FRONTEND_HOST=${MIMIR_QUERY_FRONTEND_HOST:-mimir}
export MIMIR_ALERT_MANAGER_HOST=${MIMIR_ALERT_MANAGER_HOST:-mimir}
export MIMIR_RULER_HOST=${MIMIR_RULER_HOST:-mimir}
export MIMIR_COMPACTOR_HOST=${MIMIR_COMPACTOR_HOST:-mimir}

# Default value is Loki in monolithic mode
export LOKI_DISTRIBUTOR_HOST=${LOKI_DISTRIBUTOR_HOST:-loki}
export LOKI_INGESTER_HOST=${LOKI_INGESTER_HOST:-loki}
export LOKI_RULER_HOST=${LOKI_RULER_HOST:-loki}
export LOKI_COMPACTOR_HOST=${LOKI_COMPACTOR_HOST:-loki}
export LOKI_QUERIER_HOST=${LOKI_QUERIER_HOST:-loki}
export LOKI_QUERY_FRONTEND_HOST=${LOKI_QUERY_FRONTEND_HOST:-loki}

# Default value is pyroscope in monolithic mode
export PYROSCOPE_DISTRIBUTOR_HOST=${PYROSCOPE_DISTRIBUTOR_HOST:-pyroscope}
export PYROSCOPE_QUERY_FRONTEND_HOST=${PYROSCOPE_QUERY_FRONTEND_HOST:-pyroscope}

export NGINX_ENVSUBST_OUTPUT_DIR=${NGINX_ENVSUBST_OUTPUT_DIR:-/etc/nginx}

moved 10-default-lgtmp.envsh in /docker-entrypoint.d

@qclaogui qclaogui self-assigned this Mar 20, 2024
@qclaogui qclaogui force-pushed the nginx-templating-default-values branch 2 times, most recently from 733c04e to 8e35511 Compare March 20, 2024 06:13
…in Docker Compose

Signed-off-by: Weifeng Wang <[email protected]>

Gateway(nginx): Defaulte env variable  values with entrypoint scripts

Signed-off-by: Weifeng Wang <[email protected]>

Gateway(nginx): Defaulte env variable  values with entrypoint scripts

Signed-off-by: Weifeng Wang <[email protected]>

Gateway(nginx): Defaulte env variable  values with entrypoint scripts

Signed-off-by: Weifeng Wang <[email protected]>

Gateway(nginx): Defaulte env variable  values with entrypoint scripts

Signed-off-by: Weifeng Wang <[email protected]>

Gateway(nginx): Defaulte env variable  values with entrypoint scripts

Signed-off-by: Weifeng Wang <[email protected]>

Gateway(nginx): Defaulte env variable  values with entrypoint scripts

Signed-off-by: Weifeng Wang <[email protected]>
@qclaogui qclaogui force-pushed the nginx-templating-default-values branch from fcedbf9 to 2af0576 Compare March 20, 2024 13:31
…in Kubernetes

Signed-off-by: Weifeng Wang <[email protected]>

Gateway(nginx): Defaulte env variable  values with entrypoint scripts in Kubernetes

Signed-off-by: Weifeng Wang <[email protected]>
@qclaogui qclaogui force-pushed the nginx-templating-default-values branch from 402f0c9 to 6cf119b Compare March 20, 2024 14:43
@qclaogui qclaogui merged commit e9f1533 into main Mar 20, 2024
@qclaogui qclaogui deleted the nginx-templating-default-values branch March 20, 2024 15:18
This was referenced Mar 26, 2024
This was referenced Mar 29, 2024
This was referenced Apr 12, 2024
@qc-owl-app qc-owl-app bot mentioned this pull request Sep 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant