Skip to content

Commit

Permalink
Merge pull request #22 from rstudio/jon/pvc
Browse files Browse the repository at this point in the history
Shared Storage Mounting for RSPM
  • Loading branch information
jonyoder authored Aug 6, 2021
2 parents 4446e24 + 5c188b1 commit e1bcefd
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 16 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: Kubernetes deployment for RStudio Connect
version: 0.2.0-rc03
version: 0.2.0-rc04
apiVersion: v2
appVersion: 1.9.0
icon: https://rstudio.com/wp-content/uploads/2018/10/RStudio-Logo-Flat.png
Expand Down
8 changes: 4 additions & 4 deletions charts/rstudio-connect/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Kubernetes deployment for RStudio Connect

![Version: 0.2.0-rc03](https://img.shields.io/badge/Version-0.2.0--rc03-informational?style=flat-square) ![AppVersion: 1.9.0](https://img.shields.io/badge/AppVersion-1.9.0-informational?style=flat-square)
![Version: 0.2.0-rc04](https://img.shields.io/badge/Version-0.2.0--rc04-informational?style=flat-square) ![AppVersion: 1.9.0](https://img.shields.io/badge/AppVersion-1.9.0-informational?style=flat-square)

## Disclaimer

Expand All @@ -20,11 +20,11 @@ changes, as well as documentation below on how to use the chart

## Installing the Chart

To install the chart with the release name `my-release` at version 0.2.0-rc03:
To install the chart with the release name `my-release` at version 0.2.0-rc04:

```bash
helm repo add rstudio https://helm.rstudio.com
helm install my-release rstudio/rstudio-connect --version=0.2.0-rc03
helm install my-release rstudio/rstudio-connect --version=0.2.0-rc04
```

## Required Configuration
Expand All @@ -36,7 +36,7 @@ This chart requires the following in order to function:
* If `sharedStorage.create` is set, a PVC that relies on the default storage class will be created to generate the PersistentVolume.
Most Kubernetes environments do not have a default storage class that you can use with `ReadWriteMany` access mode out-of-the-box.
In this case, we recommend you disable `sharedStorage.create` and create your own `PersistentVolume` and `PersistentVolumeClaim`, then
mount them into the container by specifying the `pod.volumes` and `pod.volumeMounts` parameters.
mount them into the container by specifying the `pod.volumes` and `pod.volumeMounts` parameters, or by specifying your `PersistentVolumeClaim` using `sharedStorage.name` and `sharedStorage.mount`.
* If you cannot use a `PersistentVolume` to properly mount your data directory, you'll need to mount your data in the container
by using a regular [Kubernetes Volume](https://kubernetes.io/docs/concepts/storage/volumes), specified in `pod.volumes` and `pod.volumeMounts`.

Expand Down
2 changes: 1 addition & 1 deletion charts/rstudio-connect/README.md.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ This chart requires the following in order to function:
* If `sharedStorage.create` is set, a PVC that relies on the default storage class will be created to generate the PersistentVolume.
Most Kubernetes environments do not have a default storage class that you can use with `ReadWriteMany` access mode out-of-the-box.
In this case, we recommend you disable `sharedStorage.create` and create your own `PersistentVolume` and `PersistentVolumeClaim`, then
mount them into the container by specifying the `pod.volumes` and `pod.volumeMounts` parameters.
mount them into the container by specifying the `pod.volumes` and `pod.volumeMounts` parameters, or by specifying your `PersistentVolumeClaim` using `sharedStorage.name` and `sharedStorage.mount`.
* If you cannot use a `PersistentVolume` to properly mount your data directory, you'll need to mount your data in the container
by using a regular [Kubernetes Volume](https://kubernetes.io/docs/concepts/storage/volumes), specified in `pod.volumes` and `pod.volumeMounts`.

Expand Down
2 changes: 1 addition & 1 deletion charts/rstudio-pm/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: rstudio-pm
description: Kubernetes deployment for RStudio Package Manager
version: 0.2.0-rc05
version: 0.2.0-rc06
apiVersion: v2
appVersion: 1.2.2.1-17
icon: https://rstudio.com/wp-content/uploads/2018/10/RStudio-Logo-Flat.png
Expand Down
10 changes: 6 additions & 4 deletions charts/rstudio-pm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Kubernetes deployment for RStudio Package Manager

![Version: 0.2.0-rc05](https://img.shields.io/badge/Version-0.2.0--rc05-informational?style=flat-square) ![AppVersion: 1.2.2.1-17](https://img.shields.io/badge/AppVersion-1.2.2.1--17-informational?style=flat-square)
![Version: 0.2.0-rc06](https://img.shields.io/badge/Version-0.2.0--rc06-informational?style=flat-square) ![AppVersion: 1.2.2.1-17](https://img.shields.io/badge/AppVersion-1.2.2.1--17-informational?style=flat-square)

## Disclaimer

Expand All @@ -20,11 +20,11 @@ changes, as well as documentation below on how to use the chart

## Installing the Chart

To install the chart with the release name `my-release` at version 0.2.0-rc05:
To install the chart with the release name `my-release` at version 0.2.0-rc06:

```bash
helm repo add rstudio https://helm.rstudio.com
helm install my-release rstudio/rstudio-pm --version=0.2.0-rc05
helm install my-release rstudio/rstudio-pm --version=0.2.0-rc06
```

## Required Configuration
Expand All @@ -36,7 +36,7 @@ This chart requires the following in order to function:
* If `sharedStorage.create` is set, a PVC that relies on the default storage class will be created to generate the PersistentVolume.
Most Kubernetes environments do not have a default storage class that you can use with `ReadWriteMany` access mode out-of-the-box.
In this case, we recommend you disable `sharedStorage.create` and create your own `PersistentVolume` and `PersistentVolumeClaim`, then
mount them into the container by specifying the `pod.volumes` and `pod.volumeMounts` parameters.
mount them into the container by specifying the `pod.volumes` and `pod.volumeMounts` parameters, or by specifying your `PersistentVolumeClaim` using `sharedStorage.name` and `sharedStorage.mount`.
* If you cannot use a `PersistentVolume` to properly mount your data directory, you'll need to mount your data in the container
by using a regular [Kubernetes Volume](https://kubernetes.io/docs/concepts/storage/volumes), specified in `pod.volumes` and `pod.volumeMounts`.
* Alternatively, S3 storage can be used. See the next section for details.
Expand Down Expand Up @@ -118,6 +118,8 @@ The values are converted into configuration files in the necessary format via go
| service.type | string | `"NodePort"` | The service type (NodePort, LoadBalancer, etc.) |
| sharedStorage.accessModes | list | `["ReadWriteMany"]` | accessModes defined for the storage PVC (represented as YAML) |
| sharedStorage.create | bool | `false` | whether to create the persistentVolumeClaim for shared storage |
| sharedStorage.mount | bool | `false` | Whether the persistentVolumeClaim should be mounted (even if not created) |
| sharedStorage.name | string | `""` | The name of the pvc. By default, computes a value from the release name |
| sharedStorage.path | string | `"/var/lib/rstudio-pm"` | the path to mount the sharedStorage claim within the pod |
| sharedStorage.requests.storage | string | `"10Gi"` | the volume of storage to request for this persistent volume claim |
| sharedStorage.storageClassName | bool | `false` | storageClassName - the type of storage to use. Must allow ReadWriteMany |
Expand Down
2 changes: 1 addition & 1 deletion charts/rstudio-pm/README.md.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ This chart requires the following in order to function:
* If `sharedStorage.create` is set, a PVC that relies on the default storage class will be created to generate the PersistentVolume.
Most Kubernetes environments do not have a default storage class that you can use with `ReadWriteMany` access mode out-of-the-box.
In this case, we recommend you disable `sharedStorage.create` and create your own `PersistentVolume` and `PersistentVolumeClaim`, then
mount them into the container by specifying the `pod.volumes` and `pod.volumeMounts` parameters.
mount them into the container by specifying the `pod.volumes` and `pod.volumeMounts` parameters, or by specifying your `PersistentVolumeClaim` using `sharedStorage.name` and `sharedStorage.mount`.
* If you cannot use a `PersistentVolume` to properly mount your data directory, you'll need to mount your data in the container
by using a regular [Kubernetes Volume](https://kubernetes.io/docs/concepts/storage/volumes), specified in `pod.volumes` and `pod.volumeMounts`.
* Alternatively, S3 storage can be used. See the next section for details.
Expand Down
6 changes: 3 additions & 3 deletions charts/rstudio-pm/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ spec:
mountPath: "/var/lib/rstudio-pm/rstudio-pm.key"
subPath: rstudio-pm.key
{{- end }}
{{- if .Values.sharedStorage.create }}
{{- if or .Values.sharedStorage.create .Values.sharedStorage.mount }}
- name: rstudio-pm-data
mountPath: "{{ .Values.sharedStorage.path }}"
{{- end }}
Expand Down Expand Up @@ -140,10 +140,10 @@ spec:
secretName: {{ include "rstudio-pm.fullname" . }}-rstudio-pm-key
defaultMode: 0600
{{- end }}
{{- if .Values.sharedStorage.create }}
{{- if or .Values.sharedStorage.create .Values.sharedStorage.mount }}
- name: rstudio-pm-data
persistentVolumeClaim:
claimName: {{ include "rstudio-pm.fullname" . }}-shared-storage
claimName: {{default (print (include "rstudio-pm.fullname" .) "-shared-storage" ) .Values.sharedStorage.name }}
{{- end }}
{{ include "rstudio-library.license-volume" (dict "license" ( .Values.license ) "fullName" (include "rstudio-pm.fullname" .)) | indent 6 }}
{{- if .Values.pod.volumes }}
Expand Down
2 changes: 1 addition & 1 deletion charts/rstudio-pm/templates/pvc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: {{ include "rstudio-pm.fullname" . }}-shared-storage
name: {{default (print (include "rstudio-pm.fullname" .) "-shared-storage" ) .Values.sharedStorage.name }}
namespace: {{ $.Release.Namespace }}
annotations:
"helm.sh/resource-policy": keep
Expand Down
4 changes: 4 additions & 0 deletions charts/rstudio-pm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ versionOverride: ""
sharedStorage:
# -- whether to create the persistentVolumeClaim for shared storage
create: false
# -- The name of the pvc. By default, computes a value from the release name
name: ""
# -- Whether the persistentVolumeClaim should be mounted (even if not created)
mount: false
# -- the path to mount the sharedStorage claim within the pod
path: /var/lib/rstudio-pm
# -- storageClassName - the type of storage to use. Must allow ReadWriteMany
Expand Down

0 comments on commit e1bcefd

Please sign in to comment.