Accessing persistant storage from shiny app on kubernetes deployement

I’m running shinyproxy on google cloud kubernetes. There I claimed a persistent storage. Now I want my shiny apps spinned up by shinyproxy to be able to access this storage. I tried different setups but failed until now.

On the shinyproxy pods the volume is mounted but not on the shiny apps that are launched by shinyproxy.
The app atlas_test2 does not even launches while atlas_test3 get launched but does not mount the volume.

This is my current deployment yaml file

apiVersion: apps/v1
kind: Deployment
metadata:
  name: shinyproxy
spec:
  selector:
    matchLabels:
      run: shinyproxy
  replicas: 1
  template:
    metadata:
      labels:
        run: shinyproxy
    spec:
      containers:
      - name: shinyproxy
        image: shinyproxy-example:v1.0-2
        imagePullPolicy: Always
        ports:
        - containerPort: 8080
        volumeMounts:
        - name: shiny-persistent-storage
          mountPath: /srv/shiny-server/www
      - name: kube-proxy-sidecar
        image: kube-proxy-sidecar:v1.0-0
        imagePullPolicy: IfNotPresent
        ports:
        - containerPort: 8001
      volumes:
      - name: shiny-persistent-storage
        persistentVolumeClaim:
          claimName: sp-volumeclaim

My application.yaml file looks like this

proxy:
  port: 8080
  authentication: simple
  admin-groups: admins
  users:
  - name: jack
    password: password
    groups: admins
  - name: jeff
    password: password
    groups: user
  - name: demo
    password: demo
    groups: demo
  container-backend: kubernetes
  kubernetes:
    internal-networking: true
    url: http://localhost:8001
  container-log-path: ./container-logs
  specs:
  - id: atlas_test2
    display-name: Atlas
    container-cmd: ["R", "-e", "shiny::runApp('/srv/shiny-server/atlas', host = '0.0.0.0', port = 3838, launch.browser = FALSE, quiet = TRUE)"]
    container-image: atlas:v1.0-1
    container-volumes: ["/srv/shiny-server/www:/srv/shiny-server/www"]
    access-groups: [demo, user]
  - id: atlas_test3
    display-name: Atlas
    container-cmd: ["R", "-e", "shiny::runApp('/srv/shiny-server/atlas', host = '0.0.0.0', port = 3838, launch.browser = FALSE, quiet = TRUE)"]
    container-image: atlas:v1.0-1
    access-groups: [demo, user]
    proxy.kubernetes.volumeMounts:
    - name: shiny-persistent-storage
      mountPath: /srv/shiny-server/www

logging:
  file:
    shinyproxy.log

server:
  servlet:
    context-path:  /

Is there any error message?
Could it be just the typo for atlas2 (you mount to /srv/shiny-server/www, but run from /srv/shiny-server/atlas without www)?
For atlas3 you don’t have container-volumes defined, so that’s why they are not mounted.

Dear @mnazarov I found a solution,
I seems that persistant storages were not yet supported, I created a patch

1 Like

We are also needing access to persistent volumes for our app that is being delivered via kubernetes. We are starting with about 500 users(school adminstrators), but hope to serve our app to 5K teachers sometime in the fall semester. Our shiny app needs access to persistent volumes to enable fully functionality.

@mnazarov, any thoughts on when someone might be able to look at the PR to see if it can be merged?

By the way, many thanks for all your work on shinyproxy. It is enabling out school district to deliver analytic information that our educators would otherwise not have access to.