kamal icon indicating copy to clipboard operation
kamal copied to clipboard

Copying and mounting secret config files

Open cosminonea opened this issue 4 months ago • 4 comments

I am using Kamal 2 to deploy a background job. The job needs to connect to a Google Cloud SQL instance. I am running the cloud proxy as an accessory service like below:

accessories:
  db:
    image: gcr.io/cloud-sql-connectors/cloud-sql-proxy:latest
    cmd: "--credentials-file /.gcloud/sql-proxy-key.json [project-id]:europe-west3:instance-1 --address 0.0.0.0 --port 5432"
    host: [host-ip]
    port: "127.0.0.1:5432:5432"

This fails because the /.gcloud/sql-proxy-key.json doesn't exist in the container.

How would I copy that file (and other secret files) from my machine onto the host during setup or deploy? Does kamal do that or do I have to push the files onto the host outside kamal?

cosminonea avatar Oct 08 '24 13:10 cosminonea