basecamp / kamal

Deploy web apps anywhere.
https://kamal-deploy.org
MIT License
11.6k stars 462 forks source link

Kakam setup fails on blank aws ubuntu machine #870

Open urubatan opened 4 months ago

urubatan commented 4 months ago

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: '.'
imWildCat commented 4 months ago

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?

urubatan commented 4 months ago

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