You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by GitBox <gi...@apache.org> on 2020/09/25 14:29:20 UTC
[GitHub] [camel-k] evanshortiss edited a comment on issue #1715: Environment Variables from Secrets
evanshortiss edited a comment on issue #1715:
URL: https://github.com/apache/camel-k/issues/1715#issuecomment-698961863
Thank you @lburgazzoli, those are both nice options!
My confusion is stemming from the fact that normally I can attach a secret to the environment like so:
```
- name: DB_USER
valueFrom:
secretKeyRef:
key: DB_USER
name: db-login-secret
```
Then in properties, for say a Quarkus application, I can do `db.usr=${HOST:DB_USER}`. It seems like with kamel, the secret must contain a properties format file?
My reasoning for this question is I have my DB info in a pre-existing secret:
```
apiVersion: v1
data:
POSTGRES_PASSWORD: cGFzc3dvcmQK
POSTGRES_USER: dXNlcgo=
kind: Secret
metadata:
name: db-login
type: Opaque
```
And I have my properties like so in a config map:
```
kafka.host=cluster-kafka-brokers
kafka.port=9092
kafka.serializerClass=kafka.serializer.StringEncoder
# Kafka meter consumer properties
consumer.topic=meters
consumer.group=CamelMeters
consumer.maxPollRecords=5000
consumer.consumersCount=1
consumer.seekTo=beginning
# Can I pull these from a secret/environment?
camel.beans.dataSource.username = {{db.usr}}
camel.beans.dataSource.password = {{db.pwd}}
```
Is it possible to populate the `dataSource` properties via the existing secret?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org