RStudio Workbench with Auto-Scaling

These files show you an example kubernetes auto-scaling configuration with RStudio Workbench. The two subdirectories, autoscaler and rstudio-workbench, contain specific configuration files that outline the parameters required to successfully set up kubernetes with auto-scaling.

To learn more about this use case, refer to the RStudio Solutions Site.

Autoscaler

The values.yaml in the autoscaler folder outlines the configuration required for the cluster autoscaler. This is a component that automatically adjusts the size of a Kubernetes Cluster so that all pods have a place to run. We have provided a sample configuration for AWS EKS clusters. For more details see the Kubernetes Autoscaler Repo.

Note: Autoscaler is a third party software maintained by the Kubernetes project.

RStudio Workbench

The values.yaml in the rstudio-workbench folder outlines the timeout configurations required to set up this configuration. The file has 3 sections that need to be configured for autoscaling.

  • rsession

    • This section provides the configuration for the rsession.conf file which controls behaviour of the RStudio IDE processes, allowing you to tune various R session parameters. There are 4 parameters that need to be configured in this section. You can learn more about the options in the RStudio Workbench Admin Guide.
    ...
    session-timeout-minutes: 5
    session-timeout-suspend: 1
    session-quit-child-processes-on-exit: 1
    session-timeout-kill-hours: 1
  • jupyter

    ...
    session-cull-minutes: 5
    session-shutdown-minutes: 3
    session-cull-connected: 1
  • launcher.kubernetes.profiles.conf

    • This section provides the configuration for the Kubernetes Job Launcher Plugin. You will need to specify the value below for the job-json-overrides parameter to prevent the automatic eviction of pods. For more details see the Kubernetes Plugin Configuration Guide.
    ...
    job-json-overrides:
      - target: "/spec/template/metadata/annotations/cluster-autoscaler.kubernetes.io~1safe-to-evict"
        json: "false"
        name: evict-annotation