This guide shows you how to deploy Sure on Kubernetes using the official Helm chart. The chart supports web (Rails) and worker (Sidekiq) workloads, optional in-cluster PostgreSQL and Redis, and production-grade features like pre-upgrade migrations, pod security contexts, and horizontal pod autoscaling.
Prerequisites
- Kubernetes >= 1.25
- Helm >= 3.10
- Basic familiarity with Kubernetes and Helm
Features
- Web (Rails) deployment with service and optional ingress
- Worker (Sidekiq) deployment
- Optional database migrations via Helm hook job or initContainer
- Optional subcharts for PostgreSQL (CloudNativePG) and Redis (OT-CONTAINER-KIT redis-operator)
- Security best practices: runAsNonRoot, readOnlyRootFilesystem, no hardcoded secrets
- Scalability: replicas, resources, topology spread constraints, optional HPAs
- Optional CronJobs for custom tasks
Installation
Add Helm repositories
Add the Sure Helm repository:
If you plan to use the bundled PostgreSQL or Redis subcharts, add their repositories as well:
Quickstart (turnkey self-hosting)
This installs CloudNativePG operator with a Postgres cluster and Redis managed by the OT redis-operator.
For production stability, use immutable image tags (for example, image.tag=v1.2.3) instead of latest.
Do not pass production secrets with --set on the command line. Use a values file with restricted permissions or a Kubernetes Secret as described in Secrets management.
Expose the app via an ingress (see configuration below) or port-forward:
Navigate to http://localhost:8080 to access Sure.
After creating your initial admin account, you can control future signups from Settings > Self-Hosting > Onboarding:
- Open: Anyone can create an account from the registration page.
- Invite-only: Signups stay enabled, but a valid invite code is required.
- Closed: The registration page is disabled for new signups.
If you do not want additional self-service registrations, switch the instance to Closed after the initial setup.
Configuration
Using external Postgres and Redis
To use external managed databases instead of the bundled subcharts, store connection strings in a Kubernetes Secret and reference them from your values file. See Secrets management for the general pattern.
Deployment profiles
Simple single-node
Minimal setup for development or small deployments:
encryptionEnv.enabled: true tells the chart to wire the Active Record encryption keys from your secret into the app container.
SELF_HOSTED: "true" enables self-hosted behavior inside Sure.
- Replace
longhorn with a storage class that exists in your cluster.
HA k3s profile
High availability setup with multiple replicas and synchronous replication:
Secrets management
Generate strong secrets before creating the Kubernetes Secret:
Create a Kubernetes secret with the required credentials:
Apply the secret:
Reference the secret in your values:
Ingress configuration
Enable ingress to expose Sure externally:
Horizontal pod autoscaling
Enable HPAs for automatic scaling based on CPU utilization:
Updating
To update to a new version of Sure:
The chart will automatically run database migrations before deploying the new version.
Backup and restore
PostgreSQL backups with CloudNativePG
CloudNativePG supports volume snapshot backups:
Manual backup
Create a manual backup of your PostgreSQL database:
[!NOTE]
If you customized the PostgreSQL username or database name in your chart values, replace sure and sure_production in the backup and restore commands below.
Restore from backup
Troubleshooting
View logs
Check pod status
Verify database connectivity
Run Helm tests
After installation, verify the deployment:
Uninstall
To remove Sure from your cluster:
This will not delete PersistentVolumeClaims. Before deleting PVCs, make sure the namespace does not contain volumes for anything other than Sure.
Getting help
If you find bugs or have feature requests: