This site is archived

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.

Appendix: External storage configuration

Using External Storage

If you prefer to utilize an external storage instance for Posit Connect’s data directory, such as Amazon EFS or Azure file shares, the following sections describe one way to accomplish this.

Step 1: Create a no-op StorageClass

This StorageClass will be specified in our Helm chart’s values. The Helm chart will use this StorageClass when it creates a PersistentVolumeClaim to be used as Connect’s data directory. The kubernetes.io/no-provisioner provisioner, notifies Kubernetes that no action is necessary to provision a PersistentVolume because we will create one manually in the next step.

cat <<EOF | kubectl apply -f -
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  name: rsc-external-storage
provisioner: kubernetes.io/no-provisioner
EOF

Step 2: Create a PersistentVolume

In this step we will create a PersistentVolume that meets the criteria of the PersistentVolumeClaim that will later be created by the Helm chart.

# modify these values to match your environment
RSC_NFS_SERVER=<your-external-storage-endpoint>
RSC_NFS_EXPORT_PATH=<your-external-storage-export-path>

# you may modify this value to change the amount of storage that will be available to Posit Connect
RSC_STORAGE_VOLUME=100G

# create a PV, backed by your external share
cat <<EOF | kubectl apply -f -
apiVersion: v1
kind: PersistentVolume
metadata:
  name: rsc-pv
spec:
  storageClassName: rsc-external-storage
  capacity:
    storage: ${RSC_STORAGE_VOLUME}
  volumeMode: Filesystem
  accessModes:
    - ReadWriteMany
  persistentVolumeReclaimPolicy: Retain
  nfs:
    path: ${RSC_NFS_EXPORT_PATH}
    server: ${RSC_NFS_SERVER}
EOF

Step 3: Modify the Helm Chart Values

Now we need to tell the Helm chart about the storage class to use when creating the PersistentVolumeClaim for Connect’s data directory. Note that the storageClassName specified below, matches the no-op StorageClass that we created in step 1.

To do this, modify the following values in your values.yaml:

sharedStorage:
  # Tell the chart to create a PVC for connect's data dir
  create: true

  # Tell the chart to mount this PVC to the connect Pod
  mount: true

  # The name of the PVC that will be created for Connect's data directory.
  # This PVC is also specified by `Launcher.DataDirPVCName` below.
  name: rsc-pvc

  # The storageClass to use for Connect's data directory. Must support RWX.
  storageClassName: rsc-external-storage

  requests:
    # This should match value used for RSC_STORAGE_VOLUME in the previous step.
    storage: 100G

config:
  Launcher:
    # Tell the job-launcher to use Connect's data dir PVC when launching content jobs
    DataDirPVCName: rsc-pvc

Step 4: Apply the Changes to your Installation

See the kubernetes deployment section to see how to create your installation, or apply these changes to an existing installation.