charts icon indicating copy to clipboard operation
charts copied to clipboard

Transferring data from configmap to secret kubernetes

Open dmyar21 opened this issue 1 year ago • 8 comments

Good afternoon Is it possible to transfer sensitive data from configmap to secret kubernetes? For example: Database connection data

dmyar21 avatar Jan 16 '24 13:01 dmyar21

@dmyar21 could you give an example of which config you mean and how you are currently setting it? then I'd be able to answer if and how it might be possible

philicious avatar Jan 23 '24 23:01 philicious

Hi @philicious I want to move the configmap trino-catalog to secret kybernetes as it contains information about connecting to the database I did this by creating a separate secret.yaml and changing volume and volume mount s in deployment.yaml. That's how I got the result I wanted.

dmyar21 avatar Jan 25 '24 10:01 dmyar21

Hi @philicious

Suggestion to implement this: https://github.com/trinodb/charts/pull/111

luismacosta avatar Jan 28 '24 18:01 luismacosta

Hello @dmyar21 and @luismacosta

Maybe this could be useful: You can set secrets in environment variables in Trino and then reference them in the catalog configuration (or any configuration) like so:

  example-postgres-db.properties: |-
    connector.name=postgresql
    connection-url=jdbc:postgresql://${ENV:DB_HOST}:${ENV:DB_PORT}/${ENV:DB_DATABASE}
    connection-user=${ENV:DB_USERNAME}
    connection-password=${ENV:DB_PASSWORD}
    user-credential-name=user
    password-credential-name=password

You can mount the environment variables (DB_HOST, DB_PORT, DB_DATABASE, DB_USERNAME, DB_PASSWORD) from secrets, and your catalog configuration can stay on a configmap since it does not contain any secret values.

sdaberdaku avatar Sep 19 '24 17:09 sdaberdaku