Skip to content

Commit

Permalink
Merge pull request #404 from rstudio/add-subdir
Browse files Browse the repository at this point in the history
add option to set subdir on the PVC volume mount
  • Loading branch information
colearendt authored Aug 11, 2023
2 parents 02aa7f6 + a69e63e commit f95d05b
Show file tree
Hide file tree
Showing 12 changed files with 50 additions and 22 deletions.
2 changes: 1 addition & 1 deletion charts/rstudio-connect/Chart.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 4 additions & 0 deletions charts/rstudio-connect/NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 0.5.5

- Add support for `sharedStorage.subPath`

# 0.5.4

- Bump Connect version to 2023.07.0
Expand Down
7 changes: 4 additions & 3 deletions charts/rstudio-connect/README.md
Original file line number Diff line number Diff line change
@@ -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_

Expand All @@ -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:
Expand Down Expand Up @@ -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 |
Expand Down
3 changes: 3 additions & 0 deletions charts/rstudio-connect/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
2 changes: 2 additions & 0 deletions charts/rstudio-connect/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion charts/rstudio-workbench/Chart.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
8 changes: 8 additions & 0 deletions charts/rstudio-workbench/NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# 0.6.5

- Add support for `homeStorage.subPath` (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
Expand Down
7 changes: 4 additions & 3 deletions charts/rstudio-workbench/README.md
Original file line number Diff line number Diff line change
@@ -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_

Expand All @@ -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:
Expand Down Expand Up @@ -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 |
Expand Down
4 changes: 1 addition & 3 deletions charts/rstudio-workbench/ci/complex-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ homeStorage:
storageClassName: nfs
requests:
storage: "500Gi"
subPath: "/another"

prometheusExporter:
securityContext:
Expand Down Expand Up @@ -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
Expand Down
25 changes: 14 additions & 11 deletions charts/rstudio-workbench/snapshot/complex-values.yaml.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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"
Expand Down Expand Up @@ -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
Expand All @@ -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"
Expand Down
6 changes: 6 additions & 0 deletions charts/rstudio-workbench/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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/"
Expand Down Expand Up @@ -402,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 }}

Expand Down
2 changes: 2 additions & 0 deletions charts/rstudio-workbench/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f95d05b

Please sign in to comment.