How can use secret as env var?

Hi, im triying to use secrets as environment vars as follow:

        env:
          - name: MYSQL_ROOT_USERNAME
            value: ${DATABASE_USER}
          - name: MYSQL_ROOT_PASSWORD
            value: ${DATABASE_PASS}

where DATABASE_USER and DATABASE_PASS are Okteto Sectrets. And define my springboot app application.properties:

spring.datasource.username= ${MYSQL_ROOT_USERNAME}
spring.datasource.password= ${MYSQL_ROOT_PASSWORD}

It doesn’t work. :roll_eyes:

Hi @mscarceller
Okteto doesn’t apply environment substitution to your okteto manifests. You will need to do that as part of your okteto deploy commands.
Using a template ystem like helm or kustomize might also work