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

Cannot easily expose secrets as environment variables in other containers in a pod. #16

Open
dplummer opened this issue Jul 9, 2019 · 1 comment

Comments

@dplummer
Copy link
Contributor

dplummer commented Jul 9, 2019

After using daytona in an initContainer with the secrets stored to a file, it isn't easy to expose those secrets as environment variables in subsequent containers. I propose to export secrets in a ".env" file, so containers can source that file before starting. Something like:

# in vault:
secret/application/foo/MY_VAR value=fizzbuzz
secret/application/foo/SOME_URL value=http://example.com

# kubernetes
initContainers:
  - name: daytona
    env:
    - name: SECRET_ENV_PATH
      value: /home/vault/secrets.env
    - name: VAULT_SECRETS_APP
      value: secret/application/foo
containers:
  - name: my-app
    command: ["/bin/bash", "-c"]
    args: |
    - source /home/vault/secrets.env
      ./my-app

# /home/vault/secrets.env
export MY_VAR=fizzbuzz
export SOME_URL=http://example.com
@dustin-decker
Copy link
Contributor

One workaround we've seen is to put the contents of the env file in the value field in one secret. You can then drop that secret's value as a file as described by https://github.com/cruise-automation/daytona#secret-fetching

derpityderp pushed a commit to derpityderp/daytona that referenced this issue Aug 6, 2019
- change bools to strings
- add K8S_AUTH_MOUNT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants