1

KubernetesPodOperator, mounting a Secret as volume creates symlink. Application that needs to access secret (cert file) requires path to file and not symlink

I mounted a Secret object to my KubernetesPodOperator. Going inside the containers instance, if I do the ls -la command, I can see the files but represented as symlinks:

lrwxrwxrwx 1 root root   25 Jun  2 11:49 my_cert.pem -> ..data/my_cert.pem

When the application runs, it will error out because it requires path to the physical file and not the symlink.

How do I mount the Secret object so that it will mount the physical file?

Even worse is that if I follow the symlink, I noticed the file size is zero.

alltej
  • 6,787
  • 10
  • 46
  • 87
  • 1
    "mounted a Secret object to my KubernetesPodOperator" could you please describe how exactly did you do that? – Nick Jun 02 '20 at 15:43
  • Get the cert: `app_certs = Secret(deploy_type='volume', deploy_target="/certs", secret='my-app-certs') ` ...then add the cert to KubernetesPodOperator definition/configuration: `my_pod = KubernetesPodOperator(secrets=[app_certs], ...)` – alltej Jun 02 '20 at 16:03
  • This is no longer an issue for me. The app that uses the cert works. I thought the issue is on the cert path being a symlink. – alltej Jun 02 '20 at 16:10
  • please consider leaving an Answer for the Question if it works now. – Nick Jun 10 '20 at 07:33

0 Answers0