RStudio IDE is an integrated development environment for R widely used by data scientists. The RStudio Operator aims to make running an RStudio on Kubernetes easier by using Kubernetes custom resources.
Clone the repository and install with Kustomize.
cd rstudio-operator
kustomize build manifests/base | kubectl apply -f -
Field | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
apiVersion string (Required.) |
emmaliaocode.dev/v1 |
||||||||||||||||||||||||||||||||||||||||||||||||||||
kind string (Required.) |
Rstudio |
||||||||||||||||||||||||||||||||||||||||||||||||||||
metadata object (Required.) |
Standard object's metadata. | ||||||||||||||||||||||||||||||||||||||||||||||||||||
spec object (Required.) |
Specification of the Rstudio instance.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
status object |
Most recently observed status of the Rstudio. |
Create a password secret for logging in to Rstudio IDE.
kubectl create secret generic rstudio-secret --from-literal=password=[password]
Create a Rstudio custom resource.
kubectl apply -f - <<EOF
apiVersion: emmaliaocode.dev/v1
kind: Rstudio
metadata:
name: example
namespace: default
spec:
image: rocker/rstudio:4.4.0
imagePullPolicy: IfNotPresent
loginSecret: rstudio-secret
isRoot: true
resources:
requests:
cpu: "250m"
memory: "64Mi"
limits:
cpu: "500m"
memory: "128Mi"
storages:
- name: my-storage
storageClassName: standard
storageSize: "1Gi"
accessModes:
- ReadWriteMany
volumes:
- name: my-config
configMap:
name: my-config
- name: my-pvc
persistentVolumeClaim:
claimName: my-pvc
- name: my-secret
secret:
secretName: my-secret
- name: my-empty-dir
emptyDir:
sizeLimit: "1Gi"
volumeMounts:
- name: my-storage
mountPath: /storage
- name: my-config
mountPath: /config
- name: my-pvc
mountPath: /pvc
- name: my-secret
mountPath: /secret
- name: my-empty-dir
mountPath: /empty-dir
EOF
rstudio.emmaliaocode.dev/example created
Get objects with rstudio=example
label.
kubectl get all -l rstudio=example
NAME READY STATUS RESTARTS AGE
pod/example-rstudio-0 1/1 Running 0 4m13s
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
service/example-rstudio NodePort 10.109.56.60 <none> 8787:32378/TCP 4m13s
NAME READY AGE
statefulset.apps/example-rstudio 1/1 4m13s