Ok, I found the problem: The environment variables are empty for the user shiny.
I am creating the connection with
pool <- dbPool(RPostgres::Postgres(),
host = Sys.getenv("DB_HOST"),
user = Sys.getenv("DB_USER"),
password = Sys.getenv("DB_PASSWORD"),
port = 5432,
dbname = "postgres")
For the user root these variables are correctly resolved, but for the user shiny these are empty. I am setting the environment variables via the deployment.yaml file in Kubernetes.
How can I make sure that shiny-server can access these environment variables?