Support

Troubleshooting Workbench with Kubernetes (EKS)

Follow

Pre-requisites

  • RStudio Workbench Server
  • NFS server
  • RStudio Workbench License with Launcher enabled
  • EKS Cluster on AWS

 

Assumptions

Workbench

We assume that you have an instance of RStudio Workbench running & configured as per the below guide:

https://docs.rstudio.com/rsw/integration/launcher-kubernetes/

 

Firewall

From there, it is important to have your RStudio Workbench instance able to access your NFS share via the appropriate inbound firewall rules on the NFS share's firewall. Furthermore, it is important to have your EKS cluster able to access your NFS share via its relevant inbound firewall rules also.

 

AWS Access

Ensure that you have command-line access to the AWS console to access your AWS resources. You can use the AWS CLI tool through your terminal to verify this. You can run the command below to confirm if you are correctly connected to your AWS account:

aws sts get-caller-identity

You must also specify the name & region of your EKS cluster:

aws eks --region xx-xxxx-x update-kubeconfig --name xxxxxxxx

For example:

aws eks --region us-east-1 update-kubeconfig --name Rstudio-EKS

It also helps to set your namespace to the default namespace that you will be using:

kubectl config set-context --current --namespace=NAMESPACE

For example:

kubectl config set-context --current --namespace=rstudio

 

Troubleshooting

We also assume that you have been through our documentation on troubleshooting Kubernetes as below:

https://docs.rstudio.com/troubleshooting/launcher-kubernetes/

 

Troubleshooting Launched Pods

Firstly, let's check to see if we can access the Kubernetes API by launching a Kubernetes pod from our RStudio Workbench server into our Kubernetes cluster.

You can run the command below to see previously launched pods:

kubectl get pods

If you have launched pods that you are having issues connecting to, you can run the command below for a more detailed description of which stage the pod is in, as well as any errors that may be associated with its launch:

kubectl describe pod <podname>

For example:

kubectl describe pod rstudiotestpod

 

Launching a test pod

You can launch a test pod to help narrow down connection issues when a pod is created. This will confirm that our RStudio Workbench server can launch containers into our Kubernetes cluster. To do so, create a yaml test file as below:

sudo nano rstudiokubernetes.yaml

The contents of this file will contain the yaml configuration that you will use to launch the test pod. I've attached a sample configuration here:

apiVersion: v1
kind: Pod
metadata:
name: rstudiotestpod
labels:
app: testing
spec:
containers:
- image: rstudio/r-session-complete:bionic-2021.09.1-372.pro1
command:
- "sleep"
- "604800"
imagePullPolicy: IfNotPresent
name: rstudiotestpod
restartPolicy: Always
apiVersion The version of the Kubernetes API to use
kind The type of object you wish to create
metadata The type of data that helps uniquely identify the object
spec The specification of how you want the pod configured

Note: You will need to specify the image used in the image option as above. This image must be the same Linux distribution that your Rstudio Workbench server uses. Our docker images can be found here:

https://hub.docker.com/u/rstudio

 

Save the file, and then apply the default configuration to use the yaml file that you created:

kubectl apply -f rstudiokubernetes.yaml

When running this command, you should see confirmation that the pod has been launched:

cecil@rstudio:~$ kubectl apply -f rstudiokubernetes.yaml
pod/rstudiotestpod created

Once the pod has been created, you can SSH into the running pod by using the command below:

kubectl exec -it rstudiotestpod -- /bin/bash

 

Support Ticket

If you still have issues after completing the above, you can always lodge a support ticket, where our group of friendly, and incredibly knowledgeable staff can assist with any issues that you may be having. You can submit a ticket here:

https://support.rstudio.com/hc/en-us/requests/new

Comments