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

add option to set subdir on the PVC volume mount #404

Merged
merged 6 commits into from
Aug 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -15,7 +15,7 @@
sealedSecret:
enabled: true
annotations:
is-a-sealed-secret: yes

Check warning on line 18 in charts/rstudio-workbench/ci/complex-values.yaml

View workflow job for this annotation

GitHub Actions / lint

[truthy] truthy value should be one of [false, true]

Check warning on line 18 in charts/rstudio-workbench/ci/complex-values.yaml

View workflow job for this annotation

GitHub Actions / lint

[truthy] truthy value should be one of [false, true]

revisionHistoryLimit: 3
pod:
Expand Down Expand Up @@ -73,6 +73,7 @@
storageClassName: nfs
requests:
storage: "500Gi"
subPath: "/another"

prometheusExporter:
securityContext:
Expand Down Expand Up @@ -181,9 +182,6 @@
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
Loading