-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrstudio.yaml
137 lines (130 loc) · 3.23 KB
/
rstudio.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
131
132
133
134
135
136
137
# Create a Namespace for Example MapR Apps
---
apiVersion: v1
kind: Namespace
metadata:
name: mapr-apps
labels:
name: mapr-apps
# MapR Apps ServiceAccount
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: mapr-apps-sa
namespace: mapr-apps
# Ticket to authenticate with HPE Container Platform internal Data Fabric
---
apiVersion: v1
kind: Secret
metadata:
name: mapr-ticket-hcp-secret
namespace: mapr-apps
type: Opaque
data:
# To create a Ticket, login onto the MapR cluster and execute following:
# 1. maprlogin password -user (your user name)
# 2. echo -n $(cat /tmp/maprticket_####) | base64 -w 0
# 3. Copy the base64 encoded ticket into the CONTAINER_TICKET line, eg:
# Note for Testing only you can use the following Command on the Controller Node ## echo -n $(cat /opt/bluedata/mapr/conf/mapruserticket ) | base64 -w 0
CONTAINER_TICKET: #. -< !!!!!!!!!!!!!!!!!!!!!!!!! ENTER YOUR BASE 64 Encoded Ticket here #########
---
# Create Persistent Volume on Internal Data Fabric
apiVersion: v1
kind: PersistentVolume
metadata:
name: pv-mapr-apps
namespace: mapr-apps
spec:
capacity:
storage: 5Gi
accessModes:
- ReadWriteMany
persistentVolumeReclaimPolicy: Retain
claimRef:
namespace: mapr-apps
name: pvc-mapr-apps
csi:
nodePublishSecretRef:
name: "mapr-ticket-hcp-secret"
namespace: "mapr-apps"
driver: com.mapr.csi-kdf
volumeHandle: tmp
volumeAttributes:
volumePath: "/"
cluster: "hcp.mapr.cluster"
cldbHosts: "10.1.0.195" # <--- Adjust the CLDB Name: 1. Login on HCP Controller, 2 Execute bdmapr maprcli node listcldbs
securityType: "secure"
platinum: "true"
# Create PVC for internal Data Fabric
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: pvc-mapr-apps
namespace: mapr-apps
spec:
accessModes:
- ReadWriteMany
resources:
requests:
storage: 30G
apiVersion: apps/v1
---
#### Deployment Rstudio using integrated persistent Datafabric mounted on /mapr
kind: Deployment
metadata:
name: rstudio
namespace: mapr-apps
spec:
selector:
matchLabels:
app: rstudio
tier: frontend
template:
metadata:
labels:
app: rstudio
tier: frontend
spec:
containers:
- name: mapr-apps-rstudio
image: rocker/rstudio:3.2.0
imagePullPolicy: IfNotPresent
ports:
- containerPort: 8787
name: rstudio-port
resources:
requests:
memory: "4Gi"
cpu: "500m"
volumeMounts:
- mountPath: /mapr/hcp.mapr.cluster
name: maprvolume
env:
- name: PASSWORD
value: "admin123"
serviceAccount: mapr-apps-sa
serviceAccountName: mapr-apps-sa
volumes:
- name: maprvolume
persistentVolumeClaim:
claimName: pvc-mapr-apps
---
### Expose Rstudio Server via the HCP internal Gateway
apiVersion: v1
kind: Service
metadata:
name: rstudio
namespace: mapr-apps
labels:
hpecp.hpe.com/hpecp-internal-gateway: "true"
spec:
selector:
app: rstudio
ports:
- name: rstudio-port
protocol: TCP
port: 8787
targetPort: 8787
type: NodePort