kamal icon indicating copy to clipboard operation
kamal copied to clipboard

Kakam setup fails on blank aws ubuntu machine

Open urubatan opened this issue 1 year ago • 2 comments

Sorry if this is a duplicate I searched and didn't find anything similar. I'm using kamal-1.6.0 with rails-7.1.3.4

While deploying a project to a blank AWS ubuntu machine the command kamal setup fails in two steps: first it installs docker, then it fails while pushing the image, because it didn't add the user to the docker group (not running as root, but user had sudo permission) then I manually login to the machine and add the user to the docker group, docker commands work

then it fails while starting traefik, because "docker: open .kamal/env/traefik/traefik.env: no such file or directory"

then I run kamal env push

then the third time kamal setup is executed, it works fine

not sure if this is a duplicate, I didn't find any other similar issues,

My understanding is that kamal setup should do all required steps and setup the remote machines for deployment, and "simply work"

this is my "config/deploy.yml"

service: .....

image: .....

# Deploy to these servers.
servers:
  - ....IP.....

# Credentials for your image host.
registry:
  username: urubatan
  password:
    - KAMAL_REGISTRY_PASSWORD

env:
  clear:
    POSTGRESQL_ADDRESS: ....
    POSTGRESQL_USERNAME:  .....
    POSTGRESQL_PASSWORD:  .....
  secret:
    - RAILS_MASTER_KEY
    
ssh:
  user: ubuntu

traefik:
  args:
    entryPoints.http.address: ":80"
    entryPoints.http.forwardedHeaders.insecure: true
    accesslog: true
    accesslog.format: json    

primary_role: web

builder:
  multiarch: false
  arch: amd64
  context: '.'

urubatan avatar Jun 29 '24 19:06 urubatan

because it didn't add the user to the docker group (not running as root, but user had sudo permission)

IMHO this can be done via Infra as Code, like terraform?

imWildCat avatar Jun 30 '24 16:06 imWildCat

It is possible sure, but since Kamal installs docker it should make it work 😅

It installs docker, meaning it knows how to use sudo

If it needs to be done through terraform add it as a dependency

urubatan avatar Jun 30 '24 17:06 urubatan

Closing in favour of #980 as that has more detail

djmb avatar Jan 10 '25 15:01 djmb