How to access pod env variable in micronaut application.yaml file #875
-
I have configmap like this apiVersion: v1
kind: ConfigMap
metadata:
name: akhq
namespace: monitoring
labels:
app: akhq
version: 0.18.0
data:
application.yml: |-
micronaut:
security:
enabled: true
akhq.security:
basic-auth:
- username: $username
password: "$password"
groups:
- admin
- username: $username ## this pod shell variable i want to replace before akhq start reading this file
password: "$password"
groups:
- reader
clients-defaults:
consumer:
properties:
isolation.level: read_committed I am having secret map with username and password keys whose value is available in pod as secrekeyref in env variable. Now I am trying to replace "username" pod env variable in application.yml which is not working when confimap writes application.yml in pod under /app location it prints string as it is ${myvar}. I want it to get replace from shell env variable before akhq start reading application.yaml. Any placeholder i can use in application.yaml which micronaut framework can substitute in application.yaml before reading file. or how ? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Beta Was this translation helpful? Give feedback.
-
Micronaut accept any env variable inside the configuration files. |
Beta Was this translation helpful? Give feedback.
Micronaut accept any env variable inside the configuration files.
You can use
username: ${YOUR_ENV_USER}