Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kamal config not displaying env vars for roles #816

Open
nickhammond opened this issue May 24, 2024 · 0 comments
Open

kamal config not displaying env vars for roles #816

nickhammond opened this issue May 24, 2024 · 0 comments

Comments

@nickhammond
Copy link
Contributor

kamal config mentions that it will output the combined config including secrets but it looks like they're missing for roles/servers. I'm seeing them on accessories but nothing from the global or role level.

kamal config              # Show combined config (including secrets!)

With this deploy.yml file:

service: hey

image: nickhammond/hey

registry:
  server: ghcr.io
  username: <%= %x(gh config get -h github.com username).strip %>
  password: <%= %x(gh config get -h github.com oauth_token).strip %>

env:
  clear:
    GLOBAL_VAR: 1
  secret:
    - GLOBAL_SECRET

servers:
  web:
    hosts:
      - 867.53.0.9
    env:
      clear:
        ROLE_VAR: true
      secret:
        - ROLE_SECRET

accessories:
  db:
    image: mysql:8.0
    host: 867.53.0.9
    port: 3306
    env:
      clear:
        MYSQL_DATABASE: 'production'
        MYSQL_ROOT_HOST: '%'
      secret:
        - MYSQL_ROOT_PASSWORD
    directories:
      - data:/var/lib/mysql

kamal config output is this:

---
:roles:
- web
:hosts:
- 867.53.0.9
:primary_host: 867.53.0.9
:version: HEAD
:repository: ghcr.io/nickhammond/hey
:absolute_image: ghcr.io/nickhammond/hey:HEAD
:service_with_version: hey-HEAD
:volume_args: []
:ssh_options:
  :user: root
  :port: 22
  :keepalive: true
  :keepalive_interval: 30
  :log_level: :fatal
:sshkit: {}
:builder: {}
:accessories:
  db:
    image: mysql:8.0
    host: 867.53.0.9
    port: 3306
    env:
      clear:
        MYSQL_DATABASE: production
        MYSQL_ROOT_HOST: "%"
      secret:
      - MYSQL_ROOT_PASSWORD
    directories:
    - data:/var/lib/mysql
:logging:
- "--log-opt"
- max-size="10m"
:healthcheck:
  path: "/up"
  port: 3000
  max_attempts: 7
  exposed_port: 3999
  cord: "/tmp/kamal-cord"
  log_lines: 50

I would expect to see GLOBAL_VAR, GLOBAL_SECRET, ROLE_VAR, and ROLE_SECRET in this output but it's missing.

It might be related to #803 but slightly different.

Happy to have a go at it but just wanted to mention it first. I was trying to troubleshoot some env var loading and remembered this command existed but haven't used it in a while.

@nickhammond nickhammond changed the title kamal config not displaying env vars for roles kamal config not displaying env vars for roles May 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant