Hello Vaibhav Dhawan,
Welcome to microsoft Q&A, Thankyou for posting your query here.
use an init container to fetch secrets directly from /secrets-store at pod startup and write them to a shared volume or a configuration file that your main application container can read.
This ensures that every new pod starts with the latest secrets:
initContainers:
- name: copy-keycloak-secrets
image: alpine
command: ['sh', '-c', 'cp /secrets-store/* /etc/secrets/']
volumeMounts:
- name: secrets-store
mountPath: /secrets-store
- name: secret-config
mountPath: /etc/secrets
Hope this helps you.
If an answer has been helpful, please consider accepting the answer to help increase visibility of this question for other members of the Microsoft Q&A community. If not, please let us know what is still needed in the comments so the question can be answered. Thank you for helping to improve Microsoft Q&A!