From 9bfce105d3154fc0e6c236690c1d78de460d5cd3 Mon Sep 17 00:00:00 2001 From: Cole Arendt Date: Mon, 7 Aug 2023 10:20:50 -0400 Subject: [PATCH 1/5] add option to set subdir on the PVC volume mount for Connect and Workbench --- charts/rstudio-connect/templates/deployment.yaml | 3 +++ charts/rstudio-connect/values.yaml | 2 ++ charts/rstudio-workbench/templates/_helpers.tpl | 3 +++ charts/rstudio-workbench/values.yaml | 2 ++ 4 files changed, 10 insertions(+) diff --git a/charts/rstudio-connect/templates/deployment.yaml b/charts/rstudio-connect/templates/deployment.yaml index 6671a317..f17decde 100644 --- a/charts/rstudio-connect/templates/deployment.yaml +++ b/charts/rstudio-connect/templates/deployment.yaml @@ -150,6 +150,9 @@ spec: {{- if or .Values.sharedStorage.create .Values.sharedStorage.mount }} - name: rstudio-connect-data mountPath: "{{ .Values.sharedStorage.path }}" + {{- if .Values.sharedStorage.subPath }} + subPath: "{{ .Values.sharedStorage.subPath }}" + {{- end }} {{- end }} {{ include "rstudio-library.license-mount" (dict "license" ( .Values.license )) | indent 10 }} {{- if .Values.pod.volumeMounts }} diff --git a/charts/rstudio-connect/values.yaml b/charts/rstudio-connect/values.yaml index 0e7e3441..efefe3e3 100644 --- a/charts/rstudio-connect/values.yaml +++ b/charts/rstudio-connect/values.yaml @@ -32,6 +32,8 @@ sharedStorage: selector: {} # -- the volumeName passed along to the persistentVolumeClaim. Optional volumeName: "" + # -- an optional subPath for the volume mount + subPath: "" rbac: # -- Whether to create rbac. (also depends on launcher.enabled = true) diff --git a/charts/rstudio-workbench/templates/_helpers.tpl b/charts/rstudio-workbench/templates/_helpers.tpl index b308ad26..112fd662 100644 --- a/charts/rstudio-workbench/templates/_helpers.tpl +++ b/charts/rstudio-workbench/templates/_helpers.tpl @@ -99,6 +99,9 @@ containers: {{- if or .Values.homeStorage.create .Values.homeStorage.mount }} - name: rstudio-home-storage mountPath: "{{ .Values.homeStorage.path }}" + {{- if .Values.homeStorage.subPath }} + subPath: "{{ .Values.homeStorage.subPath }}" + {{- end }} {{- end }} - name: rstudio-prestart mountPath: "/scripts/" diff --git a/charts/rstudio-workbench/values.yaml b/charts/rstudio-workbench/values.yaml index 2785020b..b930803f 100644 --- a/charts/rstudio-workbench/values.yaml +++ b/charts/rstudio-workbench/values.yaml @@ -128,6 +128,8 @@ homeStorage: selector: {} # -- the volumeName passed along to the persistentVolumeClaim. Optional volumeName: "" + # -- an optional subPath for the volume mount + subPath: "" image: # -- the repository to use for the main pod image From e9318da4c65d75d32e324913e88c5c094b97f0ec Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Mon, 7 Aug 2023 14:22:47 +0000 Subject: [PATCH 2/5] Update helm-docs and README.md --- charts/rstudio-connect/README.md | 1 + charts/rstudio-workbench/README.md | 1 + 2 files changed, 2 insertions(+) diff --git a/charts/rstudio-connect/README.md b/charts/rstudio-connect/README.md index 4eef8bbb..6c2126ab 100644 --- a/charts/rstudio-connect/README.md +++ b/charts/rstudio-connect/README.md @@ -176,6 +176,7 @@ The Helm `config` values are converted into the `rstudio-connect.gcfg` service c | sharedStorage.requests.storage | string | `"10Gi"` | The volume of storage to request for this persistent volume claim | | sharedStorage.selector | object | `{}` | selector for PVC definition | | sharedStorage.storageClassName | bool | `false` | The type of storage to use. Must allow ReadWriteMany | +| sharedStorage.subPath | string | `""` | an optional subPath for the volume mount | | sharedStorage.volumeName | string | `""` | the volumeName passed along to the persistentVolumeClaim. Optional | | startupProbe | object | `{"enabled":false,"failureThreshold":30,"httpGet":{"path":"/__ping__","port":3939},"initialDelaySeconds":10,"periodSeconds":10,"timeoutSeconds":1}` | Used to configure the container's startupProbe. Only included if enabled = true | | startupProbe.failureThreshold | int | `30` | failureThreshold * periodSeconds should be strictly > worst case startup time | diff --git a/charts/rstudio-workbench/README.md b/charts/rstudio-workbench/README.md index d88113ba..4ab081c1 100644 --- a/charts/rstudio-workbench/README.md +++ b/charts/rstudio-workbench/README.md @@ -395,6 +395,7 @@ Use of [Sealed Secrets](https://github.com/bitnami-labs/sealed-secrets) disables | homeStorage.requests.storage | string | `"10Gi"` | the volume of storage to request for this persistent volume claim | | homeStorage.selector | object | `{}` | selector for PVC definition | | homeStorage.storageClassName | bool | `false` | storageClassName - the type of storage to use. Must allow ReadWriteMany | +| homeStorage.subPath | string | `""` | an optional subPath for the volume mount | | homeStorage.volumeName | string | `""` | the volumeName passed along to the persistentVolumeClaim. Optional | | image.imagePullPolicy | string | `"IfNotPresent"` | the imagePullPolicy for the main pod image | | image.imagePullSecrets | list | `[]` | an array of kubernetes secrets for pulling the main pod image from private registries | From 6ba402927342ac9522821976d50d8ec0c072cf11 Mon Sep 17 00:00:00 2001 From: Cole Arendt Date: Mon, 7 Aug 2023 10:30:27 -0400 Subject: [PATCH 3/5] trace the subdirectory through to the workbench sessions --- charts/rstudio-workbench/templates/_helpers.tpl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/charts/rstudio-workbench/templates/_helpers.tpl b/charts/rstudio-workbench/templates/_helpers.tpl index 112fd662..95bfdc8b 100644 --- a/charts/rstudio-workbench/templates/_helpers.tpl +++ b/charts/rstudio-workbench/templates/_helpers.tpl @@ -405,6 +405,9 @@ app.kubernetes.io/instance: {{ .Release.Name }} {{- /* only alter $tmpMounts if claim is not provided by the user */ -}} {{- if not $mountAlreadyDefined }} {{- $defaultMount := (dict "MountType" "KubernetesPersistentVolumeClaim" "MountPath" $.Values.homeStorage.path "ClaimName" $claimName ) }} + {{- if .Values.homeStorage.subPath }} + {{- $defaultMount = merge $defaultMount (dict "SubPath" .Values.homeStorage.subPath )}} + {{- end }} {{- $tmpMounts = append $tmpMounts $defaultMount}} {{- end }} From d157374492d9a0ffa303b57e627174c344cb3cda Mon Sep 17 00:00:00 2001 From: Cole Arendt Date: Mon, 7 Aug 2023 10:35:10 -0400 Subject: [PATCH 4/5] update docs and chart versions --- charts/rstudio-connect/Chart.yaml | 2 +- charts/rstudio-connect/NEWS.md | 4 ++++ charts/rstudio-connect/README.md | 6 +++--- charts/rstudio-workbench/Chart.yaml | 2 +- charts/rstudio-workbench/NEWS.md | 8 ++++++++ charts/rstudio-workbench/README.md | 6 +++--- 6 files changed, 20 insertions(+), 8 deletions(-) diff --git a/charts/rstudio-connect/Chart.yaml b/charts/rstudio-connect/Chart.yaml index 540cef60..97ca2415 100644 --- a/charts/rstudio-connect/Chart.yaml +++ b/charts/rstudio-connect/Chart.yaml @@ -1,6 +1,6 @@ name: rstudio-connect description: Official Helm chart for RStudio Connect -version: 0.5.4 +version: 0.5.5 apiVersion: v2 appVersion: 2023.07.0 icon: https://rstudio.com/wp-content/uploads/2018/10/RStudio-Logo-Flat.png diff --git a/charts/rstudio-connect/NEWS.md b/charts/rstudio-connect/NEWS.md index 0779310f..aafa5d8f 100644 --- a/charts/rstudio-connect/NEWS.md +++ b/charts/rstudio-connect/NEWS.md @@ -1,3 +1,7 @@ +# 0.5.5 + +- Add support for `sharedStorage.subDir` + # 0.5.4 - Bump Connect version to 2023.07.0 diff --git a/charts/rstudio-connect/README.md b/charts/rstudio-connect/README.md index 6c2126ab..71a71284 100644 --- a/charts/rstudio-connect/README.md +++ b/charts/rstudio-connect/README.md @@ -1,6 +1,6 @@ # RStudio Connect -![Version: 0.5.4](https://img.shields.io/badge/Version-0.5.4-informational?style=flat-square) ![AppVersion: 2023.07.0](https://img.shields.io/badge/AppVersion-2023.07.0-informational?style=flat-square) +![Version: 0.5.5](https://img.shields.io/badge/Version-0.5.5-informational?style=flat-square) ![AppVersion: 2023.07.0](https://img.shields.io/badge/AppVersion-2023.07.0-informational?style=flat-square) #### _Official Helm chart for RStudio Connect_ @@ -26,11 +26,11 @@ To ensure reproducibility in your environment and insulate yourself from future ## Installing the Chart -To install the chart with the release name `my-release` at version 0.5.4: +To install the chart with the release name `my-release` at version 0.5.5: ```bash helm repo add rstudio https://helm.rstudio.com -helm upgrade --install my-release rstudio/rstudio-connect --version=0.5.4 +helm upgrade --install my-release rstudio/rstudio-connect --version=0.5.5 ``` To explore other chart versions, take a look at: diff --git a/charts/rstudio-workbench/Chart.yaml b/charts/rstudio-workbench/Chart.yaml index 134d2f9b..7c08c3de 100644 --- a/charts/rstudio-workbench/Chart.yaml +++ b/charts/rstudio-workbench/Chart.yaml @@ -1,6 +1,6 @@ name: rstudio-workbench description: Official Helm chart for RStudio Workbench -version: 0.6.4 +version: 0.6.5 apiVersion: v2 appVersion: 2023.06.0 icon: https://rstudio.com/wp-content/uploads/2018/10/RStudio-Logo-Flat.png diff --git a/charts/rstudio-workbench/NEWS.md b/charts/rstudio-workbench/NEWS.md index f89b0c38..5e4d1fb5 100644 --- a/charts/rstudio-workbench/NEWS.md +++ b/charts/rstudio-workbench/NEWS.md @@ -1,3 +1,11 @@ +# 0.6.5 + +- Add support for `homeStorage.subDir` (and for launcher sessions) + +# 0.6.4 + +- Add support for serviceAccount labels (`rbac.serviceAccount.labels`) + # 0.6.3 - Fix support for `pod.env` on sessions diff --git a/charts/rstudio-workbench/README.md b/charts/rstudio-workbench/README.md index 4ab081c1..d192cc06 100644 --- a/charts/rstudio-workbench/README.md +++ b/charts/rstudio-workbench/README.md @@ -1,6 +1,6 @@ # RStudio Workbench -![Version: 0.6.4](https://img.shields.io/badge/Version-0.6.4-informational?style=flat-square) ![AppVersion: 2023.06.0](https://img.shields.io/badge/AppVersion-2023.06.0-informational?style=flat-square) +![Version: 0.6.5](https://img.shields.io/badge/Version-0.6.5-informational?style=flat-square) ![AppVersion: 2023.06.0](https://img.shields.io/badge/AppVersion-2023.06.0-informational?style=flat-square) #### _Official Helm chart for RStudio Workbench_ @@ -27,11 +27,11 @@ To ensure a stable production deployment, please: ## Installing the Chart -To install the chart with the release name `my-release` at version 0.6.4: +To install the chart with the release name `my-release` at version 0.6.5: ```bash helm repo add rstudio https://helm.rstudio.com -helm upgrade --install my-release rstudio/rstudio-workbench --version=0.6.4 +helm upgrade --install my-release rstudio/rstudio-workbench --version=0.6.5 ``` To explore other chart versions, take a look at: From a69e63e44d7ef4db85edb9aa427ed5cce84934d5 Mon Sep 17 00:00:00 2001 From: Cole Arendt Date: Mon, 7 Aug 2023 10:45:32 -0400 Subject: [PATCH 5/5] fix NEWS and update snapshot lock --- charts/rstudio-connect/NEWS.md | 2 +- charts/rstudio-workbench/NEWS.md | 2 +- .../rstudio-workbench/ci/complex-values.yaml | 4 +-- .../snapshot/complex-values.yaml.lock | 25 +++++++++++-------- 4 files changed, 17 insertions(+), 16 deletions(-) diff --git a/charts/rstudio-connect/NEWS.md b/charts/rstudio-connect/NEWS.md index aafa5d8f..b1e06227 100644 --- a/charts/rstudio-connect/NEWS.md +++ b/charts/rstudio-connect/NEWS.md @@ -1,6 +1,6 @@ # 0.5.5 -- Add support for `sharedStorage.subDir` +- Add support for `sharedStorage.subPath` # 0.5.4 diff --git a/charts/rstudio-workbench/NEWS.md b/charts/rstudio-workbench/NEWS.md index 5e4d1fb5..4f61ae2a 100644 --- a/charts/rstudio-workbench/NEWS.md +++ b/charts/rstudio-workbench/NEWS.md @@ -1,6 +1,6 @@ # 0.6.5 -- Add support for `homeStorage.subDir` (and for launcher sessions) +- Add support for `homeStorage.subPath` (and for launcher sessions) # 0.6.4 diff --git a/charts/rstudio-workbench/ci/complex-values.yaml b/charts/rstudio-workbench/ci/complex-values.yaml index 70f1ada0..d85ae5ab 100644 --- a/charts/rstudio-workbench/ci/complex-values.yaml +++ b/charts/rstudio-workbench/ci/complex-values.yaml @@ -73,6 +73,7 @@ homeStorage: storageClassName: nfs requests: storage: "500Gi" + subPath: "/another" prometheusExporter: securityContext: @@ -181,9 +182,6 @@ config: logging.conf: {} serverDcf: launcher-mounts: - - MountType: KubernetesPersistentVolumeClaim - MountPath: /mnt/home - ClaimName: rstudio-server-home-storage - MountType: KubernetesPersistentVolumeClaim MountPath: /shared ClaimName: rstudio-shared-data diff --git a/charts/rstudio-workbench/snapshot/complex-values.yaml.lock b/charts/rstudio-workbench/snapshot/complex-values.yaml.lock index 20932a79..deda109b 100644 --- a/charts/rstudio-workbench/snapshot/complex-values.yaml.lock +++ b/charts/rstudio-workbench/snapshot/complex-values.yaml.lock @@ -149,13 +149,14 @@ data: launcher-mounts: | - ClaimName: rstudio-server-home-storage - MountPath: /mnt/home - MountType: KubernetesPersistentVolumeClaim - ClaimName: rstudio-shared-data MountPath: /shared MountType: KubernetesPersistentVolumeClaim + + ClaimName: release-name-rstudio-workbench-home-storage + MountPath: /mnt/home + MountType: KubernetesPersistentVolumeClaim + SubPath: /another --- # Source: rstudio-workbench/templates/configmap-general.yaml apiVersion: v1 @@ -685,7 +686,7 @@ spec: template: metadata: annotations: - checksum/config-general: 6e9045d1445aa885f5b80ccb746a0f5bba05fff45baa100c04e509ec48dc8463 + checksum/config-general: 0641da4c718599b1d351db140258190aae55cd3da97f44f2616140a4dc8980fc checksum/config-graphite: 69dd73685cb821ebf5bcec3155d92801f31d72b031a4d681700bded2ff5700c2 checksum/config-prestart: 88c121990a2291900c2e9e4dda1cecda9614a767ee6c6c05068bcadd0f8e97e9 checksum/config-secret: cab76a6f9b0e8168201b837f280ddee96f5306cb62d0ac022340cb8c88e40d52 @@ -740,6 +741,7 @@ spec: mountPath: "/var/lib/awesome" - name: rstudio-home-storage mountPath: "/mnt/home" + subPath: "/another" - name: rstudio-prestart mountPath: "/scripts/" - name: rstudio-config @@ -762,12 +764,12 @@ spec: mountPath: "/startup/user-provisioning" - name: rstudio-custom-startup mountPath: "/startup/custom" - - name: rstudio-pam - mountPath: "/etc/pam.d/pam-example-2" - subPath: "pam-example-2" - name: rstudio-pam mountPath: "/etc/pam.d/pam-example" subPath: "pam-example" + - name: rstudio-pam + mountPath: "/etc/pam.d/pam-example-2" + subPath: "pam-example-2" - name: rstudio-job-overrides-old mountPath: "/mnt/job-json-overrides" @@ -1007,6 +1009,7 @@ spec: mountPath: "/var/lib/awesome" - name: rstudio-home-storage mountPath: "/mnt/home" + subPath: "/another" - name: rstudio-prestart mountPath: "/scripts/" - name: rstudio-config @@ -1029,12 +1032,12 @@ spec: mountPath: "/startup/user-provisioning" - name: rstudio-custom-startup mountPath: "/startup/custom" - - name: rstudio-pam - mountPath: "/etc/pam.d/pam-example-2" - subPath: "pam-example-2" - name: rstudio-pam mountPath: "/etc/pam.d/pam-example" subPath: "pam-example" + - name: rstudio-pam + mountPath: "/etc/pam.d/pam-example-2" + subPath: "pam-example-2" - name: rstudio-job-overrides-old mountPath: "/mnt/job-json-overrides"