Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions main.star
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ def run(
config_file_artifact_name="",
seed_file_artifact_name="",
extra_configs=[],
extra_env_vars={},
persistent=True,
launch_adminer=False,
min_cpu=POSTGRES_MIN_CPU,
Expand All @@ -47,6 +48,7 @@ def run(
seed_file_artifact_name (string): The name of a files artifact containing seed data
If not empty, the Postgres server will be populated with the data upon start
extra_configs (list[string]): Each argument gets passed as a '-c' argument to the Postgres server
extra_env_vars dict[string, string]: A dict mapping environment variable names to their values; every pair is added to the Postgres container environment.
persistent (bool): Whether the data should be persisted. Defaults to True; Note that this isn't supported on multi node k8s cluster as of 2023-10-16
launch_adminer (bool): Whether to launch adminer which launches a website to inspect postgres database entries. Defaults to False.
min_cpu (int): Define how much CPU millicores the service should be assigned at least.
Expand Down Expand Up @@ -92,6 +94,10 @@ def run(
"POSTGRES_PASSWORD": password,
}

# Add extra env vars
for k, v in extra_env_vars.items():
env_vars[k] = v

if persistent:
files[DATA_DIRECTORY_PATH] = Directory(
persistent_key= "data-{0}".format(service_name),
Expand Down