rstudio-pm
by Posit PBC
Official Helm chart for Posit Package Manager
About this chart
Posit Package Manager
Official Helm chart for Posit Package Manager
IT Administrators use Posit Package Manager to control and manage R and Python packages that Data Scientists need to create and share data products.
Chart versioning
Chart versions use SemVer and follow Helm's chart versioning guidance. They describe the chart.
Product versions belong in appVersion.
While a chart is below 1.0.0:
- Minor: breaking changes or changes that require user action
- Patch: product releases, enhancements, bug fixes, and other compatible changes
- Major: not used
After 1.0.0, standard SemVer applies.
For production
To ensure a stable production deployment:
-
"Pin" the version of the Helm chart that you are using. You can do this using the:
-
helm dependencycommand and the associated "Chart.lock" files or -
the
--versionflag.::: {.callout-important} This protects you from breaking changes. :::
-
-
Before upgrading check for breaking changes using
helm-diffplugin andhelm diff upgrade. -
Read
NEWS.mdfor updates on breaking changes and the documentation below on how to use the chart.
Installing the chart
To install the chart with the release name my-release at version 0.20.9:
helm repo add rstudio https://helm.rstudio.com
helm upgrade --install my-release rstudio/rstudio-pm --version=0.20.9
To explore other chart versions, look at:
helm search repo rstudio/rstudio-pm -l
Upgrade guidance
0.20.0
- Chart version 0.20.0 switches default images from
rstudio/to theposit/namespace on Docker Hub (also available atghcr.io/posit-dev/). See the migration guide for details. - Image tag format changed from
{tagPrefix}{appVersion}to{appVersion}-{os}. The chart will fail with a clear error if you haveimage.tagPrefixset — replace it withimage.os.
0.4.0
- When upgrading to version 0.4.0 or later, the Package Manager service moves from running as
rootto running as therstudio-pmuser (withuid:gid999:999). - A
chownof persistent storage may be required. The team is working to implement an automatic fix. To disable the automatic fix/hook, setenableMigrations=false.
Required configuration
This chart requires the following in order to function:
- A license file. See the Licensing section below for more details.
- A Kubernetes PersistentVolume that contains the data directory for Package Manager.
- If
sharedStorage.createis set, it creates a Persistent Volume Claim (PVC) that relies on the default storage class to generate the PersistentVolume. Most Kubernetes environments do not have a default storage class that you can use withReadWriteManyaccess mode out-of-the-box. In this case, we recommend you disablesharedStorage.createand create your ownPersistentVolumeandPersistentVolumeClaim, then mount them into the container by specifying thepod.volumesandpod.volumeMountsparameters, or by specifying yourPersistentVolumeClaimusingsharedStorage.nameandsharedStorage.mount. - If you cannot use a
PersistentVolumeto properly mount your data directory, mount your data in the container by using a regular Kubernetes Volume, specified inpod.volumesandpod.volumeMounts. - Alternatively, S3 storage can be used. See the S3 Configuration section for details.
- If
Licensing
This chart supports activating the product using a license file.
We recommend storing a license file as a Secret and setting the license.file.secret and license.file.secretKey values accordingly.
First, create the secret declaratively with YAML or imperatively using the following command:
kubectl create secret generic rstudio-pm-license --from-file=licenses/rstudio-pm.lic
Second, specify the following values:
license:
file:
secret: rstudio-pm-license
secretKey: rstudio-pm.lic
Alternatively, license files can be set during helm install with the following argument:
--set-file license.file.contents=licenses/rstudio-pm.lic
Database
Package Manager requires a PostgreSQL database when running in Kubernetes. You must configure a valid connection URI and a password for the product to function correctly. Both the connection URI and password may be specified in the config section of values.yaml. However, we recommend only adding the connection URI and putting the database password in a Kubernetes Secret, which can be automatically set as an environment variable.
Database configuration
Add the following to your values.yaml, replacing the URL with your database details.
config:
Database:
Provider: "postgres"
Postgres:
URL: "postgres://<USERNAME>@<HOST>:<PORT>/<DATABASE>"
Database password
First, create a Secret declaratively with YAML or imperatively using the following command (replacing with your actual password):
kubectl create secret generic rstudio-pm-database --from-literal=password=YOURPASSWORDHERE
Second, specify the following in your values.yaml:
pod:
env:
- name: PACKAGEMANAGER_POSTGRES_PASSWORD
valueFrom:
secretKeyRef:
name: rstudio-pm-database
key: password
# Temporarily work around bug in Package Manager 2024.08.2 where Postgres.UsageDataPassword
# does not default to Postgres.Password. This will be fixed in the next release of Package Manager.
- name: PACKAGEMANAGER_POSTGRES_USAGEDATAPASSWORD
valueFrom:
secretKeyRef:
name: rstudio-pm-database
key: password
Alternatively, database passwords may be set during helm install with the following argument:
--set config.Postgres.Password="<YOUR_PASSWORD_HERE>"
S3 configuration
Package Manager can be configured to store its data in S3
buckets,
which eliminates the need to provision shared storage for multiple replicas. A
values.yaml file using S3 might contain something like the following:
config:
Storage:
Default: s3
S3Storage:
Bucket: your-s3-bucket
If you are running on EKS, we strongly suggest using IAM Roles for Service Accounts to manage the credentials needed to access S3. In this scenario, once you have created an IAM role, you can use this role as an annotation on the existing Service Account:
serviceAccount:
create: true
annotations:
eks.amazonaws.com/role-arn: arn:aws:iam::123456789000:role/iam-role-name-here
If you are unable to use IAM Roles for Service Accounts, there are any number of alternatives for injecting AWS credentials into a container. As a fallback, the chart supports setting static credentials:
awsAccessKeyId: your-access-key-id
awsSecretAccessKey: your-secret-access-key
Bear in mind that static, long-lived credentials are the least secure option and should be avoided if at all possible.
General principles
- In most places, we opt to pass Helm values over configmaps. We translate these into the valid
.gcfgfile format required by rstudio-pm.
Configuration file
The configuration values all take the form of usual Helm values so you can set the database password with something like:
... --set config.Postgres.Password=mypassword ...
The Helm config values are converted into the rstudio-pm.gcfg service configuration file via go-templating.
Values
| Key | Type | Default | Description |
|---|---|---|---|
| affinity | object | {} | A map used verbatim as the pod's "affinity" definition |
| args | bool | false | args is the pod's run arguments. By default, it uses the container's default |
| awsAccessKeyId | bool | false | awsAccessKeyId is the access key id for s3 access, used also to gate file creation |
| awsSecretAccessKey | string | nil | awsSecretAccessKey is the secret access key, needs to be filled if access_key_id is |
| command | bool | false | command is the pod's run command. By default, it uses the container's default |
| config | object | {"HTTP":{"Listen":":4242"},"Metrics":{"Enabled":true}} | config is a nested map of maps that generates the rstudio-pm.gcfg file |
| enableMigration | bool | false | Enable migrations for shared storage (if necessary) using Helm hooks. |
| enableSandboxing | bool | true | Enable sandboxing of Git builds, which requires elevated security privileges for the Package Manager container. |
| extraContainers | list | [] | sidecar container list |
| extraObjects | list | [] | Extra objects to deploy (value evaluated as a template) |
| fullnameOverride | string | "" | the full name of the release (can be overridden) |
| image.imagePullPolicy | string | "IfNotPresent" | the imagePullPolicy for the main pod image |
| image.imagePullSecrets | list | [] | an array of kubernetes secrets for pulling the main pod image from private registries |
| image.os | string | "ubuntu-24.04" | The OS version for the image tag (e.g. ubuntu-24.04, ubuntu-22.04). Only used if tag is not defined |
| image.repository | string | "posit/package-manager" | the repository to use for the main pod image |
| image.tag | string | "" | the tag to use for the main pod image. Overrides os and appVersion |
| ingress.annotations | object | {} | |
| ingress.enabled | bool | false | |
| ingress.hosts | string | nil | |
| ingress.ingressClassName | string | "" | The ingressClassName for the ingress resource. Only used for clusters that support networking.k8s.io/v1 Ingress resources |
| ingress.tls | list | [] | |
| initContainers | bool | false | the initContainer spec that will be used verbatim |
| license.file | object | {"contents":false,"mountPath":"/etc/rstudio-licensing","mountSubPath":false,"secret":false,"secretKey":"license.lic"} | the file section is used for licensing with a license file |
| license.file.contents | bool | false | contents is an in-line license file |
| license.file.mountPath | string | "/etc/rstudio-licensing" | mountPath is the place the license file will be mounted into the container |
| license.file.mountSubPath | bool | false | It can be preferable not to enable this, because then updates propagate automatically |
| license.file.secret | bool | false | secret is an existing secret with a license file in it |
| license.file.secretKey | string | "license.lic" | secretKey is the key for the secret to use for the license file |
| license.key | string | nil | key is the license to use |
| license.server | bool | false | server is the : for a license server |
| livenessProbe | object | {"enabled":false,"failureThreshold":10,"httpGet":{"path":"/__ping__","port":4242},"initialDelaySeconds":10,"periodSeconds":5,"timeoutSeconds":2} | livenessProbe is used to configure the container's livenessProbe |
| nameOverride | string | "" | the name of the chart deployment (can be overridden) |
| nodeSelector | object | {} | A map used verbatim as the pod's "nodeSelector" definition |
| pod.annotations | object | {} | annotations is a map of keys / values that will be added as annotations to the pods |
| pod.containerSecurityContext | object | {"allowPrivilegeEscalation":false,"capabilities":{"drop":["ALL"]},"runAsNonRoot":true,"runAsUser":999,"seccompProfile":{"type":"{{ if .Values.enableSandboxing }}Unconfined{{ else }}RuntimeDefault{{ end }}"}} | the securityContext for the main Package Manager container. Evaluated as a template. |
| pod.env | list | [] | env is an array of maps that is injected as-is into the "env:" component of the pod.container spec |
| pod.hostAliases | list | [] | |
| pod.labels | object | {} | Additional labels to add to the rstudio-pm pods |
| pod.lifecycle | object | {} | Container lifecycle hooks |
| pod.port | int | 4242 | |
| pod.securityContext | object | {"fsGroup":999,"fsGroupChangePolicy":"OnRootMismatch"} | the securityContext for the pod |
| pod.serviceAccountName | string | "" | Deprecated, use serviceAccount.name instead |
| pod.terminationGracePeriodSeconds | int | 120 | The termination grace period seconds allowed for the pod before shutdown |
| pod.volumeMounts | list | [] | volumeMounts is an array of maps that is injected as-is into the "volumeMounts" component of the pod spec |
| pod.volumes | list | [] | volumes is an array of maps that is injected as-is into the "volumes:" component of the pod spec |
| podDisruptionBudget | object | {} | Pod disruption budget |
| priorityClassName | string | "" | The pod's priorityClassName |
| readinessProbe | object | {"enabled":true,"failureThreshold":3,"httpGet":{"path":"/__cluster-health__","port":4242},"initialDelaySeconds":3,"periodSeconds":3,"successThreshold":1,"timeoutSeconds":1} | r |
Deploy rstudio-pm with OpenTenant
Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has rstudio-pm on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.
- Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
- Place the chartrstudio-pm is pinned at v0.20.9 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
- ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below opentenant validate opentenant.yaml terraform init && terraform apply