Posit Connect support for off-host content execution has entered General Availability (GA).
Documentation about off-host execution is now included in the
Connect Admin Guide.
The instructions presented here were associated with the off-host execution beta and are now obsolete.
Configuration and Deployment
Using Kubernetes to host Posit Connect service and content execution
Kubernetes Cluster Preparation
Step 1: Create namespace for Posit Connect
You will need a Kubernetes namespace for Posit Connect. We recommend creating a new one called rstudio-connect
. This can be accomplished with the following commands:
# Create the new namespace
kubectl create namespace rstudio-connect
# Switch to the new namespace in your current context
kubectl config set-context --current --namespace=rstudio-connect
Step 2: Install PostgreSQL database
Run the following command to install Postgres in your cluster:
# replace this value with your postgres password
RSC_POSTGRES_PASS="<your-postgres-database-password>"
helm upgrade --install rsc-db bitnami/postgresql \
\
--version 11.6.16 "rsc_k8s" \
--set auth.database="connect" \
--set auth.username="${RSC_POSTGRES_PASS}" --set auth.password=
Step 3: Install NFS server provisioner
This guide will use NFS as the storage provider for Connect’s data directory. Run the following command to install NFS in your cluster:
helm upgrade --install rsc-nfs kvaps/nfs-server-provisioner \
\
--version 1.4.0 \
--set persistence.enabled=true "100Gi" \
--set persistence.size="rsc-nfs" --set storageClass.name=
Step 4: Validate NFS and Postgres are running
To check that the NFS and Postgres pods have started successfully, use the command:
kubectl get pods
You should see output like the following:
NAME READY STATUS RESTARTS AGE
rsc-nfs-nfs-server-provisioner-0 1/1 Running 0 65s rsc-db-postgresql-0 1/1 Running 0 69s
If either pod indicates that its status not Running
after a few minutes, use the describe
command to check for dianostic information about the pod. In the following example, we can see that the nfs pod failed to start because Kubernetes could not pull the container image:
kubectl describe pod rsc-nfs-nfs-server-provisioner-0
Output:
Name: rsc-nfs-nfs-server-provisioner-0
Namespace: rsc-dev
...
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal Scheduled 17s default-scheduler Successfully assigned rsc-dev/rsc-nfs-nfs-server-provisioner-0 to docker-desktop
Warning FailedMount 16s kubelet MountVolume.SetUp failed for volume "rsc-nfs-nfs-server-provisioner-token-2lnb2" : failed to sync secret cache: timed out waiting for the condition
Warning Failed 13s kubelet Failed to pull image "k8s.gcr.io/sig-storage/nfs-provisioner:v0.0.0": rpc error: code = Unknown desc = Error response from daemon: manifest for k8s.gcr.io/sig-storage/nfs-provisioner:v0.0.0 not found: manifest unknown: Failed to fetch "v0.0.0" from request "/v2/sig-storage/nfs-provisioner/manifests/v0.0.0". Warning Failed 13s kubelet Error: ErrImagePull