0

I have an application deployed to k8s (linux). The application is not working as expected. I want to verify that the properties created using Application.yml are correct.

Application.yml looks like this

foo:
  bar: ${FOO_BAR}
  baz: ${FOO_BAZ}

When I shell into the pod and run env | grep FOO I see that the values of FOO_BAR and FOO_BAZ are what I expect. I want to verify that in the Spring Boot application foo.bar and foo.baz are also correct.

Is there a command I can run from the command line that will print out the values of foo.bar and foo.baz?

I've tried:

jinfo <pid> - Does not output the values I am looking for

jps and jps -v - No output

  • 1
    If your application is able to run (even with these properties broken), you could enable the `/actuator/env` actuator ([documentation](https://docs.spring.io/spring-boot/docs/current/reference/html/actuator.html)). Otherwise see if this question answers yours: https://stackoverflow.com/questions/48212761/how-to-log-all-active-properties-of-a-spring-boot-application-before-the-beans-i – g00glen00b Mar 21 '22 at 22:52

1 Answers1

0

you can run shell command on a running pod as shown below

kubectl -n namespace exec -it pod-name -- /bin/bash -c "command(s)"
P Ekambaram
  • 15,499
  • 7
  • 34
  • 59