Skip to content

Commit 8edad43

Browse files
authored
Merge pull request #26 from rstudio/nahara-workbench
Update Rstudio Workbench
2 parents 3517000 + 9648383 commit 8edad43

File tree

10 files changed

+274
-281
lines changed

10 files changed

+274
-281
lines changed

Diff for: charts/rstudio-workbench/Chart.lock

+1
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ dependencies:
44
version: 0.1.13-rc01
55
digest: sha256:a730e6eebdb0313c93ffbeabfcee19e785fca64482daf794345d8a59d9a38c67
66
generated: "2021-08-03T10:36:57.881257-04:00"
7+

Diff for: charts/rstudio-workbench/Chart.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: rstudio-workbench
22
description: Kubernetes deployment for RStudio Workbench
3-
version: 0.4.0-rc09
3+
version: 0.4.0-rc11
44
apiVersion: v2
55
appVersion: 1.4.1717-3
66
icon: https://rstudio.com/wp-content/uploads/2018/10/RStudio-Logo-Flat.png

Diff for: charts/rstudio-workbench/NEWS.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# 0.4.0
22

3+
- BREAKING: `serviceAccountName` is now `rbac.serviceAccount.name` for consistency with our other charts
4+
- BREAKING: `launcher=true` is now `launcher.enabled = true` and `launcherNamespace` is now `launcher.namespace` for consistency with our other charts
35
- Breaking: Licensing configuration now uses a `license` section. For example,
46
`license: my-key` should be changed to
57
```yaml
@@ -20,7 +22,6 @@ config:
2022
container-images: rstudio/r-session-complete:bionic-1.4.1106-5
2123
allow-unknown-images: 1
2224
```
23-
2425
- BREAKING: we now automatically mount session configuration into the session pod
2526
- This adds default `job-json-overrides` using the mechanism above
2627
- This can be disabled by setting `session.defaultConfigMount=false`

Diff for: charts/rstudio-workbench/README.md

+10-10
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Kubernetes deployment for RStudio Workbench
44

5-
![Version: 0.4.0-rc09](https://img.shields.io/badge/Version-0.4.0--rc09-informational?style=flat-square) ![AppVersion: 1.4.1717-3](https://img.shields.io/badge/AppVersion-1.4.1717--3-informational?style=flat-square)
5+
![Version: 0.4.0-rc11](https://img.shields.io/badge/Version-0.4.0--rc11-informational?style=flat-square) ![AppVersion: 1.4.1717-3](https://img.shields.io/badge/AppVersion-1.4.1717--3-informational?style=flat-square)
66

77
## Disclaimer
88

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

2121
## Installing the Chart
2222

23-
To install the chart with the release name `my-release` at version 0.4.0-rc09:
23+
To install the chart with the release name `my-release` at version 0.4.0-rc11:
2424

2525
```bash
2626
helm repo add rstudio https://helm.rstudio.com
27-
helm install my-release rstudio/rstudio-workbench --version=0.4.0-rc09
27+
helm install my-release rstudio/rstudio-workbench --version=0.4.0-rc11
2828
```
2929

3030
## Required Configuration
@@ -72,8 +72,8 @@ required by RStudio Server Pro. Those config files and their mount locations are
7272
- The prestart script for RStudio Server is highly customized to:
7373
- Get the service account information off of the RStudio Server pod for use in launching jobs
7474
- Generate `launcher.pub` as needed (if `launcher.pem` is provided). If it is not provided,
75-
the helm chart will generate it automatically but this information will be lost for subsequent deployments
76-
and can cause users to be locked out sessions started by a previous deployment.
75+
the helm chart will generate it automatically but this information will be lost for subsequent deployments and
76+
can cause users to be locked out sessions started by a previous deployment.
7777
- RStudio Server Pro does not export prometheus metrics on its own. Instead, we run a sidecar graphite exporter
7878
[as described here](https://support.rstudio.com/hc/en-us/articles/360044800273-Monitoring-RStudio-Team-Using-Prometheus-and-Graphite)
7979

@@ -175,16 +175,16 @@ mounting paradigm, you will need to change the `XDG_CONFIG_DIRS` environment var
175175
| homeStorage.requests.storage | string | `"10Gi"` | the volume of storage to request for this persistent volume claim |
176176
| homeStorage.storageClassName | bool | `false` | storageClassName - the type of storage to use. Must allow ReadWriteMany |
177177
| image.imagePullPolicy | string | `"IfNotPresent"` | the imagePullPolicy for the main pod image |
178-
| image.repository | string | `"rstudio/rstudio-server-pro"` | the repository to use for the main pod image |
178+
| image.repository | string | `"rstudio/rstudio-workbench"` | the repository to use for the main pod image |
179179
| image.tag | string | `""` | Overrides the image tag whose default is the chart appVersion. |
180180
| ingress.annotations | object | `{}` | |
181181
| ingress.enabled | bool | `false` | |
182182
| ingress.hosts | string | `nil` | |
183183
| ingress.tls | list | `[]` | |
184184
| initContainers | bool | `false` | the initContainer spec that will be used verbatim |
185185
| jobJsonOverridesFiles | object | `{}` | jobJsonOverridesFiles is a map of maps. Each item in the map will become a file (named by the key), and the underlying object will be converted to JSON as the file's contents |
186-
| launcher | string | `"true"` | launcher determines whether the launcher should be started in the container |
187-
| launcherNamespace | bool | `false` | allow customizing the namespace that sessions are launched into. Note RBAC and some config issues today |
186+
| launcher.enabled | bool | `true` | determines whether the launcher should be started in the container |
187+
| launcher.namespace | string | `""` | allow customizing the namespace that sessions are launched into. Note RBAC and some config issues today |
188188
| launcherPem | string | `""` | |
189189
| launcherPub | bool | `false` | |
190190
| license.file | object | `{"contents":false,"mountPath":"/etc/rstudio-licensing","mountSubPath":false,"secret":false,"secretKey":"license.lic"}` | the file section is used for licensing with a license file |
@@ -214,7 +214,8 @@ mounting paradigm, you will need to change the `XDG_CONFIG_DIRS` environment var
214214
| prometheusExporter.image.imagePullPolicy | string | `"IfNotPresent"` | |
215215
| prometheusExporter.image.repository | string | `"prom/graphite-exporter"` | |
216216
| prometheusExporter.image.tag | string | `"v0.9.0"` | |
217-
| rbac.create | bool | `true` | rbac.create specifies whether to create the ServiceAccount required for the Job Launcher to have appropriate permissions |
217+
| rbac.create | bool | `true` | Whether to create rbac. (also depends on launcher.enabled = true) |
218+
| rbac.serviceAccount | object | `{"annotations":{},"create":true,"name":""}` | The serviceAccount to be associated with rbac (also depends on launcher.enabled = true) |
218219
| readinessProbe | object | `{"enabled":true,"failureThreshold":3,"initialDelaySeconds":3,"periodSeconds":3,"successThreshold":1,"timeoutSeconds":1}` | readinessProbe is used to configure the container's readinessProbe |
219220
| replicas | int | `1` | replicas is the number of replica pods to maintain for this service. Use 2 or more to enable HA |
220221
| resources | object | `{"limits":{"cpu":"2000m","enabled":false,"ephemeralStorage":"200Mi","memory":"4Gi"},"requests":{"cpu":"100m","enabled":false,"ephemeralStorage":"100Mi","memory":"2Gi"}}` | resources define requests and limits for the rstudio-server pod |
@@ -223,7 +224,6 @@ mounting paradigm, you will need to change the `XDG_CONFIG_DIRS` environment var
223224
| service.annotations | object | `{}` | annotations for the service definition |
224225
| service.nodePort | bool | `false` | the nodePort to use when using service type NodePort. If not defined, Kubernetes will provide one automatically |
225226
| service.type | string | `"NodePort"` | the service type (i.e. NodePort, LoadBalancer, etc.) |
226-
| serviceAccountName | bool | `false` | serviceAccountName is the service account used to launch pods into Kubernetes (into launcherNamespace) |
227227
| session.defaultConfigMount | bool | `true` | |
228228
| session.image.repository | string | `"rstudio/r-session-complete"` | The repository to use for the session image |
229229
| session.image.tag | string | `""` | A tag override for the session image. Overrides the "tagPrefix" above, if set. Default tag is `{{ tagPrefix }}{{ version }}` |

Diff for: charts/rstudio-workbench/README.md.gotmpl

+3-2
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ In addition to the above required configuration, we recommend setting the follow
4040
* Some use-cases may require special PAM profiles to run. By default, no PAM profiles other than the basic `auth` profile will be used to authenticate users.
4141
If this is not sufficient then you will need to add your PAM profiles into the container (similar to adding `sssd.conf` as specified above).
4242

43+
4344
## General Principles
4445

4546
- In most places, we opt to pass helm values over configmaps. We translate these into the valid `.ini` or `.dcf` file formats
@@ -52,8 +53,8 @@ required by RStudio Server Pro. Those config files and their mount locations are
5253
- The prestart script for RStudio Server is highly customized to:
5354
- Get the service account information off of the RStudio Server pod for use in launching jobs
5455
- Generate `launcher.pub` as needed (if `launcher.pem` is provided). If it is not provided,
55-
the helm chart will generate it automatically but this information will be lost for subsequent deployments
56-
and can cause users to be locked out sessions started by a previous deployment.
56+
the helm chart will generate it automatically but this information will be lost for subsequent deployments and
57+
can cause users to be locked out sessions started by a previous deployment.
5758
- RStudio Server Pro does not export prometheus metrics on its own. Instead, we run a sidecar graphite exporter
5859
[as described here](https://support.rstudio.com/hc/en-us/articles/360044800273-Monitoring-RStudio-Team-Using-Prometheus-and-Graphite)
5960

Diff for: charts/rstudio-workbench/templates/_helpers.tpl

+220
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,226 @@ If release name contains chart name it will be used as a full name.
2424
{{- end }}
2525
{{- end }}
2626

27+
{{- define "rstudio-workbench.containers" -}}
28+
{{- $useLegacyProfiles := hasKey .Values.config.server "launcher.kubernetes.profiles.conf" }}
29+
containers:
30+
- name: rstudio
31+
{{- $defaultVersion := .Values.versionOverride | default $.Chart.AppVersion }}
32+
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default $defaultVersion }}"
33+
env:
34+
{{- if .Values.enableDiagnostics }}
35+
- name: DIAGNOSTIC_DIR
36+
value: "/var/log/rstudio"
37+
- name: DIAGNOSTIC_ONLY
38+
value: "true"
39+
- name: DIAGNOSTIC_ENABLE
40+
value: "true"
41+
{{- end }}
42+
- name: RSTUDIO_LAUNCHER_NAMESPACE
43+
value: "{{ $.Release.Namespace }}"
44+
{{ include "rstudio-library.license-env" (dict "license" ( .Values.license ) "product" ("rstudio-workbench") "envVarPrefix" ("RSW") "fullName" (include "rstudio-workbench.fullname" .)) | indent 2 }}
45+
- name: RSP_LAUNCHER
46+
value: "{{ .Values.launcher.enabled }}"
47+
{{- if .Values.userCreate }}
48+
- name: RSP_TESTUSER
49+
value: "{{ .Values.userName }}"
50+
- name: RSP_TESTUSER_UID
51+
value: "{{ .Values.userUid }}"
52+
- name: RSP_TESTUSER_PASSWD
53+
value: "{{ .Values.userPassword }}"
54+
{{- else }}
55+
- name: RSP_TESTUSER
56+
value: ""
57+
{{- end }}
58+
- name: XDG_CONFIG_DIRS
59+
value: "{{ template "rstudio-workbench.xdg-config-dirs" .}}"
60+
{{- if or ( gt (int .Values.replicas) 1 ) ( .Values.loadBalancer.forceEnabled ) }}
61+
- name: PRESTART_LOAD_BALANCER_CONFIGURATION
62+
value: enabled
63+
{{- end }}
64+
{{- if .Values.pod.env }}
65+
{{ toYaml .Values.pod.env | indent 2 }}
66+
{{- end }}
67+
{{- if .Values.command }}
68+
command:
69+
{{ toYaml .Values.command | indent 4 }}
70+
{{- end }}
71+
{{- if .Values.args }}
72+
args:
73+
{{ toYaml .Values.args | indent 4 }}
74+
{{- end }}
75+
imagePullPolicy: "{{ .Values.image.imagePullPolicy }}"
76+
ports:
77+
- containerPort: 8787
78+
securityContext:
79+
{{ toYaml .Values.securityContext | indent 4 }}
80+
volumeMounts:
81+
{{- if .Values.sharedStorage.create }}
82+
- name: rstudio-shared-storage
83+
mountPath: "{{ .Values.sharedStorage.path }}"
84+
{{- end }}
85+
{{- if .Values.homeStorage.create }}
86+
- name: rstudio-home-storage
87+
mountPath: "{{ .Values.homeStorage.path }}"
88+
{{- end }}
89+
- name: rstudio-prestart
90+
mountPath: "/scripts/"
91+
- name: rstudio-config
92+
mountPath: "/mnt/configmap/rstudio/"
93+
- name: rstudio-session-config
94+
mountPath: "/mnt/session-configmap/rstudio/"
95+
- name: rstudio-secret
96+
mountPath: "/mnt/secret-configmap/rstudio/"
97+
- name: etc-rstudio
98+
mountPath: "/etc/rstudio"
99+
- name: shared-data
100+
mountPath: "/mnt/load-balancer/rstudio"
101+
{{ include "rstudio-library.license-mount" (dict "license" ( .Values.license )) | indent 4 }}
102+
{{/* TODO: path collision problems... would be ideal to not have to maintain both long term */}}
103+
{{- if .Values.jobJsonOverridesFiles }}
104+
- name: rstudio-job-overrides-old
105+
mountPath: "/mnt/job-json-overrides"
106+
{{- end }}
107+
{{- if not $useLegacyProfiles }}
108+
- name: rstudio-job-overrides-new
109+
mountPath: "/mnt/job-json-overrides-new"
110+
{{- end }}
111+
{{- if .Values.pod.volumeMounts }}
112+
{{ toYaml .Values.pod.volumeMounts | indent 4 }}
113+
{{- end }}
114+
resources:
115+
{{- if .Values.resources.requests.enabled }}
116+
requests:
117+
memory: "{{ .Values.resources.requests.memory }}"
118+
cpu: "{{ .Values.resources.requests.cpu }}"
119+
ephemeral-storage: "{{ .Values.resources.requests.ephemeralStorage }}"
120+
{{- end }}
121+
limits:
122+
{{- if .Values.resources.limits.enabled }}
123+
memory: "{{ .Values.resources.limits.memory }}"
124+
cpu: "{{ .Values.resources.limits.cpu }}"
125+
ephemeral-storage: "{{ .Values.resources.limits.ephemeralStorage }}"
126+
{{- end }}
127+
{{- if .Values.livenessProbe.enabled }}
128+
livenessProbe:
129+
httpGet:
130+
path: /health-check
131+
port: 8787
132+
initialDelaySeconds: {{ .Values.livenessProbe.initialDelaySeconds }}
133+
periodSeconds: {{ .Values.livenessProbe.periodSeconds }}
134+
timeoutSeconds: {{ .Values.livenessProbe.timeoutSeconds }}
135+
failureThreshold: {{ .Values.livenessProbe.failureThreshold }}
136+
{{- end }}
137+
{{- if .Values.startupProbe.enabled }}
138+
startupProbe:
139+
httpGet:
140+
path: /health-check
141+
port: 8787
142+
initialDelaySeconds: {{ .Values.startupProbe.initialDelaySeconds }}
143+
periodSeconds: {{ .Values.startupProbe.periodSeconds }}
144+
timeoutSeconds: {{ .Values.startupProbe.timeoutSeconds }}
145+
failureThreshold: {{ .Values.startupProbe.failureThreshold }}
146+
{{- end }}
147+
{{- if .Values.readinessProbe.enabled }}
148+
readinessProbe:
149+
httpGet:
150+
path: /health-check
151+
port: 8787
152+
initialDelaySeconds: {{ .Values.readinessProbe.initialDelaySeconds }}
153+
periodSeconds: {{ .Values.readinessProbe.periodSeconds }}
154+
timeoutSeconds: {{ .Values.readinessProbe.timeoutSeconds }}
155+
successThreshold: {{ .Values.readinessProbe.successThreshold }}
156+
failureThreshold: {{ .Values.readinessProbe.failureThreshold }}
157+
{{- end }}
158+
{{- if or (gt (int .Values.replicas) 1) (.Values.loadBalancer.forceEnabled) }}
159+
- name: sidecar
160+
image: "{{ .Values.loadBalancer.image.repository }}:{{ .Values.loadBalancer.image.tag }}"
161+
imagePullPolicy: "{{ .Values.loadBalancer.image.imagePullPolicy }}"
162+
{{- if .Values.loadBalancer.env }}
163+
env:
164+
{{- toYaml .Values.loadBalancer.env | nindent 2 }}
165+
{{- end }}
166+
args:
167+
- "{{ include "rstudio-workbench.fullname" . }}"
168+
- "{{ $.Release.Namespace }}"
169+
- "/mnt/load-balancer/rstudio/"
170+
- "{{ .Values.loadBalancer.sleepDuration }}"
171+
- "{{ .Values.loadBalancer.appLabelKey }}"
172+
{{- if .Values.loadBalancer.securityContext }}
173+
securityContext:
174+
{{- toYaml .Values.loadBalancer.securityContext | nindent 4 }}
175+
{{- end }}
176+
volumeMounts:
177+
- name: shared-data
178+
mountPath: "/mnt/load-balancer/rstudio/"
179+
{{- end }}
180+
{{- if .Values.prometheusExporter.enabled }}
181+
- name: exporter
182+
image: "{{ .Values.prometheusExporter.image.repository }}:{{ .Values.prometheusExporter.image.tag }}"
183+
imagePullPolicy: "{{ .Values.prometheusExporter.image.imagePullPolicy }}"
184+
args:
185+
- "--graphite.mapping-config=/mnt/graphite/graphite-mapping.yaml"
186+
volumeMounts:
187+
- name: graphite-exporter-config
188+
mountPath: "/mnt/graphite/"
189+
{{- end }}
190+
{{- if .Values.pod.sidecar }}
191+
{{ toYaml .Values.pod.sidecar }}
192+
{{- end }}
193+
volumes:
194+
{{- if .Values.sharedStorage.create }}
195+
- name: rstudio-shared-storage
196+
persistentVolumeClaim:
197+
claimName: {{ include "rstudio-workbench.fullname" . }}-shared-storage
198+
{{- end }}
199+
{{- if .Values.homeStorage.create }}
200+
- name: rstudio-home-storage
201+
persistentVolumeClaim:
202+
claimName: {{ include "rstudio-workbench.fullname" . }}-home-storage
203+
{{- end }}
204+
{{- if .Values.jobJsonOverridesFiles }}
205+
- name: rstudio-job-overrides-old
206+
configMap:
207+
name: {{ include "rstudio-workbench.fullname" . }}-overrides-old
208+
defaultMode: 0644
209+
{{- end }}
210+
{{- if not $useLegacyProfiles }}
211+
- name: rstudio-job-overrides-new
212+
configMap:
213+
name: {{ include "rstudio-workbench.fullname" . }}-overrides-new
214+
defaultMode: 0644
215+
{{- end }}
216+
- name: etc-rstudio
217+
emptyDir: {}
218+
- name: shared-data
219+
emptyDir: {}
220+
- name: rstudio-config
221+
configMap:
222+
name: {{ include "rstudio-workbench.fullname" . }}-config
223+
defaultMode: 0644
224+
- name: rstudio-session-config
225+
configMap:
226+
name: {{ include "rstudio-workbench.fullname" . }}-session
227+
defaultMode: 0644
228+
- name: rstudio-prestart
229+
configMap:
230+
name: {{ include "rstudio-workbench.fullname" . }}-prestart
231+
defaultMode: 0755
232+
- name: rstudio-secret
233+
secret:
234+
secretName: {{ include "rstudio-workbench.fullname" . }}-secret
235+
defaultMode: 0600
236+
{{ include "rstudio-library.license-volume" (dict "license" ( .Values.license ) "fullName" (include "rstudio-workbench.fullname" .)) }}
237+
{{- if .Values.prometheusExporter.enabled }}
238+
- name: graphite-exporter-config
239+
configMap:
240+
name: {{ include "rstudio-workbench.fullname" . }}-graphite
241+
defaultMode: 0755
242+
{{- end }}
243+
{{- if .Values.pod.volumes }}
244+
{{ toYaml .Values.pod.volumes }}
245+
{{- end }}
246+
{{- end }}
27247

28248
{{/*
29249
Create chart name and version as used by the chart label.

0 commit comments

Comments
 (0)