Temporary failure in name resolution
Hello Team,
I am using kamal to deploy my ruby app. Below is the part of my kamal config/deploy.yml file:
# Name of your application. Used to uniquely configure containers.
service: wcf-app
# Name of the container image.
image: devops/wcf-stag-kamal-image
# Deploy to these servers.
servers:
web:
hosts:
- 17.9.45.6
# options:
# publish:
# - "3600:3600"
labels:
traefik.enable: true
ssh:
user: deploy
port: 911
accessories:
redis:
image: redis
roles:
- web
options:
publish:
- "6379:6379"
Now i used below commands to run my app:
- kamal accessory boot redis
- kamal deploy
I can see 3 container i.e redis, traefik and my app container are up. I have used REDIS_HOST=wcf-app-redis and REDIS_PORT=6379 in my app. But its not reachable from my app container.
Then i tried to debug this issue and check below points:
- I can confirm all the 3 container redis, app and traefik are in same network i.e bridge
- All the 3 container are reachable to each other when i am pining using container IP.
- But when i tried to use name of container
wcf-app-redisunable to ping and gettingTemporary failure in name resolution.
As we can't use IP for connection and its not working via name of container.
Can you please help me whats is the issue/mistake i am doing here.
Thank You
Hello Team,
I am able to figure out the issue. My app and accessory redis were using default docker network bridge. And it support conatiner IP not DNS.
So i have created new docker network and used same for all 3 conatiner:
# Name of your application. Used to uniquely configure containers.
service: wcf-app
# Name of the container image.
image: devops/wcf-stag-kamal-image
#build: false
# Deploy to these servers.
servers:
web:
hosts:
- 10.10.0.34
options:
network: wcf-app-network
# publish:
# - "3600:3600"
labels:
traefik.enable: true
traefik:
options:
network: wcf-app-network
args:
providers.docker.network: wcf-app-network
ssh:
user: deploy
port: 911
accessories:
redis:
image: redis # Use the official Redis image
roles:
- web
options:
network: wcf-app-network
publish:
- "6379:6379"
But i need to create docker network manually on host machine. Can we create docker network using kamal config/deploy.yml file?
Thank You
Hi @Tekchanddagar. Kamal 2 will automatically create a kamal network and create all containers including accessories in it. Does that solve your problem here?