kamal
kamal copied to clipboard
Incorrect IP address when using remote builder with proxy
I'm trying to deploy on Hetzner. My setup has 2 servers, one for app and one for postgres. They talk to each other internally. Have a network setup on Hetzner for that.
Here's a screenshot of my 2 servers.
If I try deploying using Using remote builder for single-arch
, I get the following error. It's trying to connect to 5.75.252.76
which isn't even one of my IP addresses. I tried using 10.0.0.2
in my builder host but same issue.
Here's my deploy.yml
service: j-h
image: joekaldas/j-h
ssh:
proxy: "5.75.253.249"
servers:
web:
hosts:
- 10.0.0.2
solid-queue:
hosts:
- 10.0.0.2
cmd: bundle exec rake solid_queue:start
registry:
username: joekaldas
password:
- KAMAL_REGISTRY_PASSWORD
env:
clear:
POSTGRES_USER: postgres
POSTGRES_HOST: 10.0.0.3
secret:
- RAILS_MASTER_KEY
- POSTGRES_PASSWORD
builder:
remote:
arch: amd64
host: ssh://[email protected]
accessories:
pg-16.2:
image: postgres:16.2
host: 10.0.0.3
port: "5432:5432"
env:
clear:
POSTGRES_USER: postgres
secret:
- POSTGRES_PASSWORD
files:
- db/init.sql:/docker-entrypoint-initdb.d/setup.sql
volumes:
- "postgres_data:/var/lib/postgresql/data"
Try deleting the context.
docker context ls
docker context rm name_of_context_with_wrong_ip_address
I had the same issue using an AWS instance as the builder when I had to delete and restart the instance and the IP address changed.
@dotnofoolin I've tried on both instances and both had one context of default
@JoeKaldas - the context will be on the machine you are deploying from.
To fix this, we need to add a check in the build step to confirm the context is up to date with the config.
Duplicate of https://github.com/basecamp/kamal/issues/90