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.

Configuration and Deployment

Using Kubernetes to host Posit Connect service and content execution

Kubernetes Deployment

Installing Posit Connect within Kubernetes

If you have an existing server, take your existing Posit Connect server out-of-service. This most likely involves the following actions:

  • Prohibit access to your Posit Connect servers.
  • Disable any automatic provisioning or automation which might re-activate the server.
  • Stop the rstudio-connect service on the existing server

To complete your installation of Posit Connect within Kubernetes, run the following commands:

Note

The Postgres password may be defined in the values.yaml file with config.Postgres.Password, but for security reasons we recommend passing it as part of the helm install command instead.

# replace this value with your license key
RSC_LICENSE="<your-rstudio-connect-license-key>"

# replace this value with your postgres password
RSC_POSTGRES_PASS="<your-postgres-database-password>"

# install Posit Connect
helm upgrade --install rstudio-connect-prod rstudio/rstudio-connect \
  --set license.key="${RSC_LICENSE}" \
  --set config.Postgres.Password="${RSC_POSTGRES_PASS}" \
  --values values.yaml
Note

If you have made changes to your values file and wish to update an existing installation, you can just run the command again.

Use the following command to check the status of Connect:

kubectl get pod -l app.kubernetes.io/name=rstudio-connect

You should see output like the following:

NAME                                       READY   STATUS    RESTARTS   AGE
connect-rstudio-connect-5d45d7b9bc-5wrcn   2/2     Running   0          9m50s
Note

Note that the Connect pod indicates that 2/2 containers are running. In addition to the Connect container, the pod includes a Graphite exporter container which allows Prometheus to consume metrics about the pod’s health. When prometheusExporter.enabled is true (the default), prometheus.io/ annotations are added to the pod so that metrics can be easily consumed.

If your Posit Connect pod is failing to start, see the Debugging Posit Connect appendix for details on how to diagnose and fix problems with your deployment.

Validating your installation

At this point, your Posit Connect server should be running and in the process of completing initialization / migration steps. To confirm successful completion of this phase:

  • Inspect server and application logs for errors
  • Wait for the server to complete its configuration startup tasks
    • The server application log will contain the following message when this is complete: Done running configuration tasks ...
  • Log in and interact with Connect dashboard
    • Confirm successful login
    • Verify that the Documentation page in the dashboard shows the docker images which you have made available.

Accessing the Dashboard from your browser

Warning

Manual port-forwarding is appropriate for local testing and validation of the installation. Once you have validated the installation, you will need to configure an Ingress and public DNS records for Connect. See the External Connectivity appendix for more information about configuring external access to your Connect installation.

To interact with your new Posit Connect installation, you will need to temporarily enable port-forwarding. For example, to use local port 3939:

kubectl port-forward svc/rstudio-connect-prod 3939:80

You can now point your browser to http://localhost:3939/, register a new account, and log in to Posit Connect.

To validate the correct functionality of your Posit Connect server, you should:

  • Log in and interact with Connect dashboard
  • Verify that the Documentation page shows the images
  • Inspect server and application logs for errors
  • Verify the ability to access simple content
  • Verify the admin metrics page works (check JS console)
  • Verify sending a test email works
  • Verify re-rendering an existing document
  • Verify deploying a new app
  • Verify deploying a new doc
  • Verify scheduled content runs successfully
  • Verify history / previous renders show up
  • Verify email sending of content succeeds

Enable access to your Posit Connect server

Following your internal processes, make the necessary changes to place your new Posit Connect server back into service. This most likely involves the following actions:

  • Allow access to your Posit Connect servers.
  • Enable any automatic provisioning or automation for your new server.