Skip to content

Commit

Permalink
Merge pull request #214 from rstudio/kegs-mount-content
Browse files Browse the repository at this point in the history
Add sharedStorage.mountContent and deprecation warning
  • Loading branch information
dbkegley authored May 31, 2022
2 parents 177b8d0 + e8d9ba0 commit cf51385
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 10 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.2.32
version: 0.2.33
apiVersion: v2
appVersion: 2022.05.0
icon: https://rstudio.com/wp-content/uploads/2018/10/RStudio-Logo-Flat.png
Expand Down
7 changes: 7 additions & 0 deletions charts/rstudio-connect/NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# 0.2.33

- Add `sharedStorage.mountContent` value configuration option. When this setting
is enabled, the chart will configure Connect's `Launcher.DataDirPVCName` to use
the PVC defined by `sharedStorage.name`. If this setting is used, then
`config.Launcher.DataDir` must not be set.

# 0.2.32

- Update `rstudio-library` chart version. Add support for lists in INI file sections.
Expand Down
9 changes: 5 additions & 4 deletions charts/rstudio-connect/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# RStudio Connect

![Version: 0.2.32](https://img.shields.io/badge/Version-0.2.32-informational?style=flat-square) ![AppVersion: 2022.05.0](https://img.shields.io/badge/AppVersion-2022.05.0-informational?style=flat-square)
![Version: 0.2.33](https://img.shields.io/badge/Version-0.2.33-informational?style=flat-square) ![AppVersion: 2022.05.0](https://img.shields.io/badge/AppVersion-2022.05.0-informational?style=flat-square)

#### _Official Helm chart for RStudio Connect_

Expand All @@ -23,11 +23,11 @@ As a result, please:

## Installing the Chart

To install the chart with the release name `my-release` at version 0.2.32:
To install the chart with the release name `my-release` at version 0.2.33:

```bash
helm repo add rstudio https://helm.rstudio.com
helm install my-release rstudio/rstudio-connect --version=0.2.32
helm install my-release rstudio/rstudio-connect --version=0.2.33
```

## Required Configuration
Expand Down Expand Up @@ -127,8 +127,9 @@ The Helm `config` values are converted into the `rstudio-connect.gcfg` service c
| sharedStorage.accessModes | list | `["ReadWriteMany"]` | A list of accessModes that are 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.mountContent | bool | `false` | Whether the persistentVolumeClaim should be mounted to the content pods created by the Launcher |
| sharedStorage.name | string | `""` | The name of the pvc. By default, computes a value from the release name |
| sharedStorage.path | string | `"/var/lib/rstudio-connect"` | The path to mount the sharedStorage claim within the pod |
| sharedStorage.path | string | `"/var/lib/rstudio-connect"` | The path to mount the sharedStorage claim within the Connect pod |
| sharedStorage.requests.storage | string | `"10Gi"` | The volume of storage to request for this persistent volume claim |
| sharedStorage.storageClassName | bool | `false` | The type of storage to use. Must allow ReadWriteMany |
| 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 |
Expand Down
11 changes: 7 additions & 4 deletions charts/rstudio-connect/ci/complex-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,18 @@ pod:
sidecar:
- name: test
image: "busybox"
command: ["sleep"]
args: ["infinity"]
imagePullPolicy: "IfNotPresent"
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 100
labelSelector:
matchLabels:
app.kubernetes.io/part-of: rstudio-team
topologyKey: kubernetes.io/hostname
podAffinityTerm:
labelSelector:
matchLabels:
app.kubernetes.io/part-of: rstudio-team
topologyKey: kubernetes.io/hostname

ingress:
enabled: true
Expand Down
15 changes: 15 additions & 0 deletions charts/rstudio-connect/templates/NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,21 @@ NOTE: `.Values.config.Licensing.LicenseType` is configured manually. Normally, w
- Otherwise, `LicenseType` uses the default of `local`.
Please consider removing this configuration value.

{{- end }}
{{- end }}
{{- if hasKey .Values.config "Launcher" }}
{{- if hasKey .Values.config.Launcher "DataDir" }}
{{- if contains ":" .Values.config.Launcher.DataDir }}

NOTE: `config.Launcher.DataDir` is configured with a ":". When a ":" character
is found, Connect treats this configuration as an NFS connection string. Connect then
uses this information to create NFS volumes when mounting the DataDir to the content
pods created by the Launcher. This feature will be removed in the next release of Connect.
- Please consider setting `sharedStorage.mountContent = true` instead.
- When `sharedStorage.mountContent = true`, `config.Launcher.DataDir`
should not be set.

{{- end }}
{{- end }}
{{- end }}
{{- end }}
4 changes: 4 additions & 0 deletions charts/rstudio-connect/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ app.kubernetes.io/instance: {{ .Release.Name }}
{{- if .Values.launcher.enabled }}
{{- $namespace := default $.Release.Namespace .Values.launcher.namespace }}
{{- $launcherSettingsDict := dict "Enabled" ("true") "Kubernetes" ("true") "ClusterDefinition" (list "/etc/rstudio-connect/runtime.yaml") "KubernetesNamespace" ($namespace) "KubernetesProfilesConfig" ("/etc/rstudio-connect/launcher/launcher.kubernetes.profiles.conf") }}
{{- $dataDirPVCName := default (print (include "rstudio-connect.fullname" .) "-shared-storage" ) .Values.sharedStorage.name }}
{{- if .Values.sharedStorage.mountContent }}
{{- $_ := set $launcherSettingsDict "DataDirPVCName" $dataDirPVCName }}
{{- end }}
{{- $launcherDict := dict "Launcher" ( $launcherSettingsDict ) }}
{{- $pythonSettingsDict := dict "Enabled" ("true") }}
{{- $pythonDict := dict "Python" ( $pythonSettingsDict ) }}
Expand Down
4 changes: 3 additions & 1 deletion charts/rstudio-connect/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@ sharedStorage:
name: ""
# -- Whether the persistentVolumeClaim should be mounted (even if not created)
mount: false
# -- The path to mount the sharedStorage claim within the pod
# -- The path to mount the sharedStorage claim within the Connect pod
path: /var/lib/rstudio-connect
# -- Whether the persistentVolumeClaim should be mounted to the content pods created by the Launcher
mountContent: false
# -- The type of storage to use. Must allow ReadWriteMany
storageClassName: false
# -- A list of accessModes that are defined for the storage PVC (represented as YAML)
Expand Down

0 comments on commit cf51385

Please sign in to comment.