Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to Modify and Deploy Custom ShinyProxy Resources in a Kubernetes Cluster #53

Open
flash0926 opened this issue Aug 6, 2024 · 2 comments
Labels
question Further information is requested

Comments

@flash0926
Copy link

I have deployed ShinyProxy in my Kubernetes cluster using the official ShinyProxy Operator. I need to modify some of the ShinyProxy styles, such as the landing page and other resources. How can I copy these modifications into the ShinyProxy pod to make them effective?
image

@LEDfan
Copy link
Member

LEDfan commented Sep 12, 2024

Hi @flash0926 , there are multiple ways to achieve this:

  • create a custom Docker image containing your resources and templates. In practice we believe this is the easiest way to do it, especially if you use CI/CD pipelines to build the docker image and deploy a new version of ShinyProxy.

    FROM openanalytics/shinyproxy:3.1.1
    COPY templates /opt/shinyproxy/templates
  • store the templates on a network file system and mount the volume into the ShinyProxy pod. Make sure the volume can be accessible by multiple pods on multiple nodes (i.e. ReadWriteMany), otherwise your deployment will fail when changing the ShinyProxy configuration. You can use kubernetesPodTemplateSpecPatches to add the k8s code to mount the volume (https://github.com/openanalytics/shinyproxy-operator/tree/master/docs/deployment#modify-the-shinyproxy-pod).

  • store the templates in k8s configmaps or secrets and mount these in the container (again using kubernetesPodTemplateSpecPatches). In our experience this is quite cumbersome and often requires changes at multiple places when modifying the templates (e.g. the list of files to mount etc).

@LEDfan LEDfan added the question Further information is requested label Sep 12, 2024
@gacolitti
Copy link

I tried mounting template files using a persistentVolumeClaim but when I do this the sp-shinyproxy* pod is never started and I'm not sure why.

Here is the change to the kubernetesPodTemplateSpecPatches

    - op: add
      path: /spec/containers/0/volumeMounts/-
      value:
        - name: shinyproxy-templates
          mountPath: /etc/shinyproxy/templates
          readOnly: true
    - op: add
      path: /spec/volumes/-
      value:
        - name: shinyproxy-templates
          persistentVolumeClaim:
            claimName: shinyproxy-pvc

I made sure to include the - at the end of the path. If I remove the /- then the sp container starts as expected but the default (demo) configuration of ShinyProxy is loaded instead of the custom template.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants