Configuring Posit Connect with additional volumes

This example shows how to mount a ConfigMap to the Connect pod and a PVC is mounted to content pods. This pattern of specifying the volumes and volumeMounts will work for a variety of volume types: PVC, ConfigMap, etc.

Depending on the need to add additional volumes, you may only need to mount to the Connect service or content pods but not both. For example, if you need to add TLS certificates for Connect via a ConfigMap then the content pods do not need the ConfigMap mounted.

To use this example you will need:

  • a license file or key
  • a ReadWriteMany POSIX compliant storage class for sharedStorage
  • a PostgreSQL database.
values.yaml
# Using a license file with the helm chart:
# https://github.com/rstudio/helm/tree/main/charts/rstudio-connect#license-file
# If you would like to use a license key see this documentation:
# https://github.com/rstudio/helm/tree/main/charts/rstudio-connect#license-key
license:
  file:
    secret: posit-licenses # TODO: Change to the secret name in your cluster
    secretKey: connect.lic # TODO: Change to the secret key containing your Connect license

# Configures Connect shared storage
sharedStorage:
  create: true
  mount: true
  storageClassName: nfs-sc-rwx # TODO: Change to a RWX StorageClass available in your cluster
  # volumeName: connect-shared-pv-name # Only needed if PVs have been statically provisioned, in which case this will need to match the PV name.
  requests:
    storage: 100G

# This section is used to mount to the Connect container which is
# often used to add in additional configuration and TLS certificates
# which are not needed in the content containers.
pod:
  volumeMounts:
  - mountPath: /etc/connect-certs # TODO: Change to your desired mount path
    name: ldap-certificate # TODO: Change to match the volume name below
  volumes:
  - name: ldap-certificate # TODO: Change to match the volumeMounts name above
    # Can be any type of volume... persistentVolumeClaim, configMap, etc.
    # Can also provision a PVC, PV, ConfigMap, etc via `extraObjects` if desired
    configMap:
      name: connect-ldap-certificate # TODO: Change to match your ConfigMap name

# This section is only needed if you need to mount to the content containers
# which is often the case if you need to mount data for content to access
launcher:
  useTemplates: true # Required to mount the content pods
  templateValues:
    pod:
      volumeMounts:
      - mountPath: /mnt/data # TODO: Change to your desired mount path
        name: shared-data # TODO: Ensure matches the name specified in volumes below
      volumes:
      - name: shared-data # TODO: Ensure matches the name specified in volumeMounts above
        # Can be any type of volume... persistentVolumeClaim, configMap, etc.
        # Can also provision a PVC or PV via `extraObjects` if desired
        persistentVolumeClaim:
          claimName: shared-data-pvc # TODO: Change to an available PVC name

# The config section overwrites values in Posit Connect's main
# .gcfg configuration file.
config:
  # Configures the Postgres connection for Posit Connect.
  Database:
    Provider: "Postgres"
  Postgres:
    # The URL syntax below is to utilize a PostgreSQL database installed
    # in the cluster as described in the Kubernetes Cluster Preparation
    # page of this guide. Change this URL if your PostgreSQL database is
    # setup externally or in a different location.
    URL: "postgres://connect@postgres.example.com:5432/connect?sslmode=disable"
    Password: "<PASSWORD>" # TODO: Remove this line and instead set the password during helm install with --set config.Postgres.Password=<your-postgres-password>.