Apolo
HomeConsoleGitHub
  • Apolo concepts
  • CLI Reference
  • Examples/Use Cases
  • Flow CLI
  • Actions Reference
  • Apolo Extras CLI
  • Python SDK
  • Getting started
    • Introduction
    • First Steps
      • Getting Started
      • Training Your First Model
      • Running Your Code
    • Apolo Base Docker image
    • FAQ
    • Troubleshooting
    • References
  • Apolo Console
    • Getting started
      • Sign Up, Login
      • Organizations
      • Clusters
      • Projects
    • Apps
      • Pre-installed apps
        • Files
        • Buckets
        • Disks
        • Images
        • Secrets
        • Jobs
          • Remote Debugging with PyCharm Professional
          • Remote Debugging with VS Code
        • Flows
      • Available apps
        • Terminal
        • LLM Inference
          • vLLM Inference details
          • Multi-GPU Benchmarks Report
        • PostgreSQL
        • Text Embeddings Inference
        • Jupyter
        • VSCode
        • PyCharm Community Edition
        • MLflow
        • Apolo Deploy
        • Dify
        • Weaviate
        • Fooocus
        • Stable Diffusion
        • Hugging Face
        • Service Deployment
        • Spark Application
  • Apolo CLI
    • Installing CLI
    • Apps
      • Files
      • Jobs
      • Images
      • Available apps
        • VSCode
        • Hugging Face
        • Service Deployment
  • Administration
    • Apolo Credits
    • Cluster Management
      • Creating a Cluster
      • Managing Users and Quotas
      • Managing organizations
      • Creating Node Pools
      • Managing Presets
Powered by GitBook
On this page
  • Overview
  • Key Features
  • Installing
  • Highlights of the installation flow
  • Install via Apolo CLI
  • Install via Apolo web console
  • Usage
  • References

Was this helpful?

  1. Apolo Console
  2. Apps
  3. Available apps

PostgreSQL

Overview

PostgreSQL is a powerful, open-source relational database system known for its reliability, feature richness, and extensibility. It supports advanced SQL compliance, transactional integrity, and scalability, making it a popular choice for both OLTP and OLAP workloads. PostgreSQL’s flexibility allows for use across a wide range of applications, from web services to large-scale data platforms.Apolo uses the Crunchy Data distribution of PostgreSQL, which builds on the core database engine by adding production-grade features such as high availability, automated backups, Kubernetes-native deployment, and enhanced monitoring. This ensures that PostgreSQL on Apolo is robust, secure, and ready for mission-critical workloads in modern cloud environments.

PostgreSQL comes with integrated PgBouncer, which sits between your application and PostgreSQL, managing and reusing database connections to reduce overhead and improve performance—especially in high-concurrency environments.

Key Features

  • Enterprise-Grade PostgreSQL: Fully open-source and compliant with PostgreSQL, offering advanced tooling and support for critical workloads.

  • High Availability: Built-in support for HA via Patroni, Kubernetes-native failover handling, and synchronous streaming replication.

  • Automated Backups & Point-in-Time Recovery (PITR): Integrated tools for automated scheduled backups, WAL archiving, and recovery to any point.

  • Monitoring & Metrics: Native integration with Prometheus and Grafana for visibility into database performance and health.

  • Security & Compliance: Includes features such as TLS encryption, role-based access control, audit logging, and SELinux hardening.

  • Kubernetes-Native: Optimized for Kubernetes through Crunchy Data’s PostgreSQL Operator (PGO), enabling declarative management and scalable deployments.

Installing

As with other applications on Apolo, you can deploy Crunchy PostgreSQL cluster via web console, or using Apolo CLI.

Highlights of the installation flow

  • Resource presets: select the resource preset (e.g. cpu-medium, cpu-large) that defines hardware requirements (CPU, memory, etc.) for the PostgreSQL server or PG bouncer.

  • Persistent Storage Management: we automatically provisions high-performance, durable storage with snapshot and backup support.

  • Backup & PITR Support: we integrate your setup with Apolo buckets to configure backup system for regular snapshots and point-in-time recovery options.

  • RBAC: you can preconfigure list of databases and users, define user to database access grid.


Install via Apolo CLI

Step 1 — use CLI command to get application configuration file template:

apolo app-template get postgres -o mypostgres.yaml

Step 2 — fill in application parameters. Here is an example config file with some of those parameters:

# Example of mypostgres.yaml

template_name: postgres
template_version: v25.5.0
display_name: mypostgres
input:
  backup:
    enable: true
  pg_bouncer:
    preset:
      name: cpu-medium
    replicas: 1
  postgres_config:
    db_users:
    - db_names:
      - dbone
      - dbtwo
      name: userone
    - db_names:
      - dbtwo
      name: usertwo
    instance_replicas: 3
    instance_size: 10
    postgres_version: '16'
  preset:
    name: cpu-medium

Debrief of configuration parameters:

  1. We enabled incremental and full backups via setting input.backup.enable=true .

  2. We configured PG Bouncer to have 1 replica and use cpu-medium resource preset in runtime.

  3. We created two users: userone and usertwo . We also created two databases: dbone , dbtwo . Afterwards we granted userone access to dbone and dbtwo DBs, while usertwo has access only to dbtwo . The users have write access level for those databases.

  4. We also setup PostgreSQL cluster to work in HA mode using Patroni and have 3 server replicas by setting input.postgres_config.instance_replicas=3 . The resource preset for each instance is set to be cpu-medium via inputs.preset.name=cpu-medium configuration parameter.

  5. The disk size under each replica is 10 Gigs.

  6. The PostgreSQL server version is 16.

Step 3 — now you can install this application into your Apolo project:

apolo app install -f mypostgres.yaml

You could see the application status transitions via CLI:

apolo app list
  ID                                     Name                                                          Display Name                      Template                          Version   State     
 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 
  70565e06-69e9-4cbd-a895-616a1a61454a   apolo-apoloproject-postgres-70565e06                          mypostgres                        postgres                          v25.5.0   healthy   
  ...

If you want to see logs of the application, hit apolo app logs <app-id> supplying the ID from a previous command output. Note: loading and displaying logs for your application might take some time.

Step 4 — if you want to remove the application via CLI, use apolo app remove <app-id>.

You can find more information for application management commands in the list of references below.

Install via Apolo web console

Below is a brief description of how to deploy the PostgreSQL application with exactly the same configuration via Apolo web console.

Step 1 — find PostgreSQL application in list of apps, and click "install" button.

Step 2 — fill in the same parameters for this application

After setting up all input parameters, click "install" to start the installation. You will be redirected to an application details page, which displays application inputs, outputs and health status.

Your PostgreSQL cluster is ready. The application outputs, including access credentials are displayed below at this screen too. You could utilize this outputs with other applications or other workloads.

You could remove this application just like all other apps by clicking the "Uninstall" button in the upper right corner of the application details page.

Usage

After installing PostgreSQL cluster application, you could use it in all variations of workloads within the cluster, like jobs or other apps.

Currently, it is possible to connect to the database only from within the cluster workloads. Please, reach us if you need to expose the database to the outer world, we might help you find the solution.

While application interconnection in most of the cases is handled by the platform, you should know how to reach out database from your jobs.

In this small example, we'll use PostgreSQL container image as a client and connect to the database deployed previously.

Step 1 — start a client job via CLI

apolo run postgres:16-bookworm -- psql '<Pgbouncer Uri>'
Using preset 'cpu-small'
Using image 'postgres:16-bookworm'
√ Job ID: job-d99bfd4b-97f2-466b-91a4-0106dfc3abc2
- Status: pending Creating
- Status: pending Scheduling
- Status: pending Pulling (Pulling image "postgres:16-bookworm")
- Status: pending ContainerCreating
√ Status: running
...

Pgbouncer Uri here is the output reported after the application being installed. Note, this output is only accessible to the participants of your project

Note: we advice selecting postgres image tag version matching the database version you deployed.

Step 2 — verify connection works, try creating minimal table

psql (16.9 (Debian 16.9-1.pgdg120+1), server 16.4)
SSL connection (protocol: TLSv1.3, cipher: TLS_AES_256_GCM_SHA384, compression: off)
Type "help" for help.

√ ========= Job's output, may overlap with logs =========
dbone=> select 1;
 ?column? 
dbone=> CREATE TABLE sample_users (
dbone(>     id SERIAL PRIMARY KEY,
dbone(>     name VARCHAR(100),
dbone(>     email VARCHAR(100) UNIQUE,
dbone(>     created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
dbone(> );
CREATE TABLE
dbone=> INSERT INTO sample_users (name, email) VALUES
dbone-> ('Alice', 'alice@example.com'),
dbone-> ('Bob', 'bob@example.com');
INSERT 0 2
dbone=> SELECT * FROM sample_users;
 id | name  |       email       |         created_at         
----+-------+-------------------+----------------------------
  1 | Alice | alice@example.com | 2025-05-27 09:33:07.994067
  2 | Bob   | bob@example.com   | 2025-05-27 09:33:07.994067
(2 rows)

Step 3 — terminate job

dbone=> exit
√ Job job-d99bfd4b-97f2-466b-91a4-0106dfc3abc2 finished successfully

And this is it!

Quick recap of what was done:

  1. Deployed PostgreSQL cluster with backups, monitoring and configured RBAC

  2. Verified configuration by connecting to the server from within Apolo Job and

    1. Creating sample table

    2. Inserting several records into the table

    3. Querying the table

References

PreviousMulti-GPU Benchmarks ReportNextText Embeddings Inference

Last updated 7 days ago

Was this helpful?

(for the usage of apolo run and resource presets)

Crunchy Postgres Apolo Chart Repository
Crunchy Data Postgres Documentation
Apolo Documentation
Configuring server instance preset, number of server instances, PostgreSQL version
Configure disk size for each instance, first user and it's access to databases
Configure second user to have access only to dbtwo database
Configure PG Bouncer resource preset, enable backup configuration and configure app name.
Application details page
PostgreSQL app outputs
Apolo CLI Application management commands
Apolo CLI Application template commands