-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrstudio-server-template.yaml
130 lines (128 loc) · 2.99 KB
/
rstudio-server-template.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
apiVersion: template.openshift.io/v1
kind: Template
metadata:
name: rstudio-server-template
annotations:
description: >
RStudio Server using a container image from the Rocker project (https://rocker-project.org).
To determine the user name to enter when logging into the RStudio Server web interface:
After launching, select the application in the Topology view, click "Actions > Edit Pod".
Copy the spec.securityContext.runAsUser value.
iconClass: "icon-redhat"
tags: "r"
objects:
- apiVersion: v1
kind: ConfigMap
metadata:
name: rstudio-server-config
labels:
app: rstudio-server
data:
database.conf: |
provider=sqlite
directory=/tmp
logging.conf: |
[*]
log-level=info
logger-type=stderr
- apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: home
labels:
app: rstudio-server
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 8Gi
- apiVersion: v1
kind: Pod
metadata:
name: rstudio-server
labels:
app: rstudio-server
spec:
volumes:
- name: home
emptyDir:
claimName: {}
- name: database-conf
configMap:
name: rstudio-server-config
- name: logging-conf
configMap:
name: rstudio-server-config
containers:
- name: rstudio-server
image: rocker/rstudio:4.2.2
resources:
requests:
memory: "640Mi"
cpu: "500m"
limits:
memory: "1000Mi"
cpu: "1024m"
volumeMounts:
- name: home
mountPath: /home/rstudio
- name: logging-conf
mountPath: /etc/rstudio/logging.conf
subPath: logging.conf
- name: database-conf
mountPath: /etc/rstudio/database.conf
subPath: database.conf
env:
- name: PASSWORD
value: ${PASSWORD}
- name: HOME
value: /home/rstudio
- name: RSTUDIO_SESSION_TIMEOUT
value: "0"
ports:
- containerPort: 8080
command:
- sh
- -c
- |
export USER=$(id -un)
rserver \
--www-port 8080 \
--auth-none=0 \
--auth-pam-helper-path=pam-helper \
--auth-stay-signed-in-days=30 \
--auth-timeout-minutes=0 \
--auth-validate-users=0 \
--server-user=${USER}
- apiVersion: v1
kind: Service
metadata:
name: rstudio-server
labels:
app: rstudio-server
spec:
ports:
- port: 8080
selector:
app: rstudio-server
- apiVersion: route.openshift.io/v1
kind: Route
metadata:
name: rstudio-server
labels:
app: rstudio-server
spec:
# omitting host to randomly-generate a subdomain
#subdomain: rstudio-server
tls:
termination: edge
insecureEdgeTerminationPolicy: Redirect
to:
kind: Service
name: rstudio-server
parameters:
- description: Password
from: '[\w]{20}'
generate: expression
name: PASSWORD