We have a spring MVC application deployed using tomcat image in AKS. How to get values from Secrets mounted as volumes?
Most of the examples points to spring boot only
I am mounting values from secret store
kind: Pod
apiVersion: v1
metadata:
name: nginx
namespace: default
labels:
aadpodidbinding: pod-mi
spec:
containers:
- name: nginx
image: nginx
volumeMounts:
- name: foo
mountPath: "/mnt/secrets"
readOnly: true
volumes:
- name: foo
csi:
driver: secrets-store.csi.k8s.io
readOnly: true
volumeAttributes:
secretProviderClass: spc.
can see the secrets get mounted correctly:
kubectl -n default exec -it nginx -- bash
root@nginx:/# ls /mnt/secrets
service-one-secret
service-two-secret
Cat service-one-secret doesn't return anything
Can any one suggest a way to read its values from spring mvc application?