I am writing a secret to a file using Drone while deploying to Kubernates. How can read this file using java Springboot?
Drone commands
commands:
- touch naspvtkey.txt
- ls -a
- echo "$NASPVTKEY" > naspvtkey.txt
Drone outputs:
+ touch naspvtkey.txt -------> created the file
+ ls -a
.DS_Store
.drone.yml
.drone.yml.sig
.git
.gitignore
.mvn
Dockerfile
README.md
kubernetes
mvnw
naspvtkey.txt
pom.xml
src
+ echo "$NASPVTKEY" > naspvtkey.txt ---------> added my secret
I am trying to access the file using
file = new File("/naspvtkey.txt");
Ensure container user has permission to create file in root directory.