Unable to load config data to springboot application from mounted volume in kubernetes

mayank agarwal

I have springboot application and I am trying to load additional configuration from a volume mounted location /tmp/secret-config.yaml and getting below error: java.lang.IllegalStateException: Unable to load config data from '/tmp/secret-config.yaml'

I do not want to use configmap or secrets for this. It's a simple json file which I am trying to load.

I am trying to pass it like this from shell script. java -jar /opt/app.jar --spring.config.additional-location=/tmp/secret-config.yaml

Can anyone please help ?

Jonas Breuer

I would suggest to verify the volume mount of the file inside your pod. You can verify it with the following commands:

kubectl exec -it <podName> -- cat /tmp/secret-config.yaml

kubectl exec -it <podName> -- ls /tmp

In addition, the volume mount configuration in your yaml file would be interesting. Did you specify a mountPath for the volumeMount in your pod configuration? You can also check the mountPath with the following command:

# for a pod with a single container and only one volumeMount
kubectl get pods <podName> -o jsonpath='{.spec.containers[0].volumeMounts[0].mountPath}'

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Can a mounted volume in Kubernetes be accessed from the host os filesystem

unable to access application from kubernetes

Change owner of volume mounted secret in Kubernetes

Change Kubernetes secrets file format in mounted volume

Kubernetes Persistent Volume Claim mounted with wrong gid

Unable to load Ignite config spring bean definition from non default location in spring boot application

Unable to load 'paypal' section from your config

Access NFS volume mounts from Spring Boot application Kubernetes

Kubernetes -- unable to connect to mysql from spring application

docker data volume vs mounted host directory

kubernetes unable to see the mounted folder contents

Replace a file from host to container with mounted volume

Unable to load consul config

Springboot Unable to Read Yaml config

Copying files from docker volume to kubernetes volume

Unable to load data from a CSV file into HIVE

Unable to load the data from xml using pyspark

Unable to make elasticsearch as persistent volume in kubernetes cluster

No data recover from incluster config with kubernetes/go-client

Docker doesn't save data in host mounted volume

SQLServer Container looses Data when stopped although it is mounted to volume

Unable to load config.js

Running docker on Ubuntu: mounted host volume is not writable from container

How to give a name to a docker volume mounted from an external drive

Mounted host volume is not writable from host in Azure Pipelines

Unable to unmount /mnt which was mounted from a script

kubernetes upgrade from 1.9.0 to 1.10 FATAL: could not decode configuration: unable to decode config from bytes

Preload Springboot application with data

Docker: Permissions for a mounted volume