#@ load("@ytt:data", "data")

#@ ns = data.values.application.namespace

---
apiVersion: v1
kind: ConfigMap
metadata:
  name: garage-config
  namespace: #@ ns
data:
  garage.toml: |
    metadata_dir = "/var/lib/garage/meta"
    data_dir = "/var/lib/garage/data"
    db_engine = "lmdb"

    replication_factor = 1

    rpc_bind_addr = "[::]:3901"
    rpc_public_addr = "127.0.0.1:3901"
    rpc_secret_file = "/etc/garage/rpc_secret"

    [s3_api]
    s3_region = "garage"
    api_bind_addr = "[::]:3900"
    root_domain = ".s3.garage.local"

    [s3_web]
    bind_addr = "[::]:3902"
    root_domain = ".web.garage.local"
    index = "index.html"

    [admin]
    api_bind_addr = "[::]:3903"
    admin_token_file = "/etc/garage/admin_token"
    metrics_token_file = "/etc/garage/admin_token"
