Self-hosted service
ongres/stackgres avatar
ongres/stackgres

StackGres Operator for Kubernetes PostgreSQL

StackGres Operator, Full Stack PostgreSQL on Kubernetes // !! Mirror repository of https://gitlab.com/ongresinc/stackgres, only accept Merge Requests there.

1,440 stars76 forksJavaAGPL-3.0

At a glance

What is it?
StackGres packages PostgreSQL with Kubernetes-native management, Patroni high availability, connection pooling, backups, monitoring, and logging. It is aimed at platform teams and application developers who need PostgreSQL deployed through Kubernetes rather than assembling each operational component separately.
Who is it for?
Adopt StackGres when your team wants an opinionated PostgreSQL distribution managed through Kubernetes and can operate its CRDs, Patroni behavior, storage, backups, and observability components. Do not choose it as a plain PostgreSQL image replacement or if your deployment cannot tolerate a Kubernetes operator and its surrounding infrastructure.
Can I use it commercially?
Yes, with strict conditions. AGPL-3.0 is a network copyleft licence: if people use a modified version over a network, for example as a hosted service, you must offer them its source code under the same licence.
Is it still maintained?
Yes. The repository last received commits 8 days ago.
What is it written in?
Mainly Java, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on October 20, 2026, and from our analysis. They are not legal advice.

Editorial analysis

StackGres as a Kubernetes PostgreSQL Distribution

StackGres addresses a specific operational problem: PostgreSQL rarely exists as an isolated database process in production. Connections need pooling, replicas need coordinated failover, backups need scheduling and retention, logs need collection, and operators need visibility into database health. The project describes these as the components around PostgreSQL and packages them into a distribution intended for Kubernetes.

The target users are platform engineers, Kubernetes administrators, application teams, and Java developers who either deploy or contribute to the system. The README positions StackGres as a full-stack PostgreSQL distribution rather than as a modified PostgreSQL server. PostgreSQL itself remains a vanilla version from its upstream open source project, joined by components such as a connection pooler and Patroni. Applications that use PostgreSQL should therefore continue to work against the database, although deployment and administration now involve StackGres resources and Kubernetes behavior.

That distinction matters for adoption. A team can keep its SQL and PostgreSQL client model while moving database provisioning, replication, and related operational concerns into Kubernetes. In exchange, it accepts an operator-managed model, custom resource definitions, and a larger set of components that must be configured and maintained.

The StackGres Operator and Its Control Plane

This repository holds the StackGres Operator, the Java component that packages, deploys, and manages the Kubernetes application. StackGres explains that databases need more operational guidance than an ordinary stateless workload because they maintain state and integrate several components. The operator provides that Kubernetes-native management layer.

The operator is written in Java and uses Quarkus. According to the repository README, the container image is built on Red Hat Universal Base Image and compiled as a native binary with GraalVM. The stated purpose is faster boot time and lower resident memory use, but the README does not provide a measured startup time, memory profile, or deployment resource requirement. Those numbers would need to come from the project's documentation or an evaluation environment rather than from this repository description.

StackGres presents its surrounding components as an opinionated selection. This is a meaningful design choice for teams that do not want to compare several implementations of pooling, failover, monitoring, logging, and disaster recovery themselves. It also creates a dependency on the project's compatibility and configuration choices. The operator is therefore the control point for turning higher-level StackGres configuration into Kubernetes resources and coordinated database operations.

Patroni, Kubernetes APIs, and Automatic Failover

High availability is implemented with Patroni. The README states that Patroni handles automated failover and that StackGres does not require an external distributed consistent storage system because it relies on Kubernetes APIs. Kubernetes APIs reach etcd, which provides the coordination state used by the platform.

This approach differs from deployments that require a separate consensus store for Patroni. It also means the availability of the PostgreSQL stack is tied to the reliability and permissions of the Kubernetes control plane. If the operator, API server, or associated resources cannot act, failover and management may be affected. The README does not document recovery procedures, split-brain handling, or a complete failure matrix, so those points require verification in the project documentation.

StackGres also lists integrated server-side connection pooling and observability through Envoy Proxy's PostgreSQL filter. The exact routing rules, metrics, configuration keys, and failure behavior are not shown in the repository README. The feature list establishes that these components exist, but it does not provide enough detail to infer how they should be tuned for a particular workload.

Backups, Monitoring, Logs, and GitOps Resources

The platform includes automated backups and lifecycle management, Prometheus integration, customized Grafana dashboards, and distributed logs for PostgreSQL and Patroni. These features cover operational signals that are often deployed separately from a database. The project describes monitoring as automatic and logging as distributed, while leaving the detailed configuration to its documentation.

Management is exposed through high-level CRDs, which the README labels GitOps ready. That is a concrete fit for teams that already store Kubernetes manifests in Git and want database infrastructure declared rather than assembled manually. However, the README does not describe the complete set of custom resources, their validation rules, upgrade order, or how external secrets are supplied. It also does not document rollback behavior for an unsuccessful manifest or operator upgrade.

The backups feature should therefore not be interpreted as proof that every deployment has a complete disaster recovery plan. The repository identifies backup automation and lifecycle management, but storage destinations, retention policy, restore testing, cross-region behavior, and recovery objectives are not specified here. Those are implementation questions for the versions page and the detailed documentation.

Installation and First Kubernetes Use

The README does not include a copyable installation command or a complete first deployment manifest. Instead, it directs users to the StackGres documentation, the Demo / Quickstart page, and the installation page at `https://stackgres.io/install/`. The project says that the installation page provides a one-line command, but the command itself is not present in the repository text available here, so this review does not reproduce it.

A first real use therefore begins in the documented Demo / Quickstart, after the operator is installed. The expected first step is to follow that guide to create a StackGres PostgreSQL deployment, then connect an application using ordinary PostgreSQL credentials and connection settings. The repository does not provide the resource names, namespace, image tags, storage classes, or YAML fields needed to write a verified example manifest.

For an engineer evaluating the project, the first checks should be concrete. Confirm that the target is a Kubernetes-certified platform, select a supported PostgreSQL major version, and use the official installation page rather than copying an unversioned command from another integration. The README states that StackGres supports PostgreSQL major versions 12 through 18, but it does not say which version should be selected for a particular release of the operator. The documentation's compatibility information should be checked before deployment.

Licensing, Compatibility, and Maintenance Boundaries

StackGres is licensed under the GNU Affero General Public License version 3, also identified as AGPLv3. The README also states that a commercial license without GPL clauses is available through contacting the project. This is a licensing choice that should be reviewed against the intended deployment and modification model; this review does not provide legal advice.

Compatibility is intentionally broad at the platform level. The README says StackGres has been designed to run on any Kubernetes-certified platform, including Kubernetes-as-a-Service offerings and on-premise distributions. That is a stated design goal, not a guarantee that every CSI driver, ingress configuration, security policy, or service implementation will behave identically. The documentation should be checked for the specific Kubernetes distribution and storage environment.

The repository is not archived, and its last push was on 2026-10-15. That indicates recent repository activity at the time recorded, but the repository has no GitHub releases listed. Users should therefore distinguish source activity from a documented release cadence and verify the version and upgrade documentation before selecting a production deployment.

StackGres Compared with Separate PostgreSQL Components

The real alternative is to run PostgreSQL and assemble the surrounding components independently. For example, a team could deploy PostgreSQL directly in Kubernetes, configure Patroni separately, choose its own connection pooler, add Prometheus and Grafana, collect logs through the platform's logging system, and manage backups with separate tooling. That approach offers more control over each component, but it also requires the team to evaluate compatibility, configure integrations, and maintain the assembly.

StackGres takes the opposite approach by packaging selected components and exposing them through a common Kubernetes distribution and operator. This is useful when a team values a documented, opinionated starting point more than selecting every component independently. It is less suitable when an existing platform standard requires another pooler, coordination mechanism, monitoring stack, or backup system that StackGres does not support in the desired configuration.

The project is not a replacement for general Kubernetes capacity planning or storage administration. PostgreSQL workloads still need appropriate persistent volumes, resource settings, network policies, credentials, backup destinations, and monitoring thresholds. StackGres reduces the number of database ecosystem decisions, but it does not remove the underlying Kubernetes responsibilities.

Editorial conclusion

Adopt StackGres when your team wants an opinionated PostgreSQL distribution managed through Kubernetes and can operate its CRDs, Patroni behavior, storage, backups, and observability components. Do not choose it as a plain PostgreSQL image replacement or if your deployment cannot tolerate a Kubernetes operator and its surrounding infrastructure. Verify first that your platform is Kubernetes-certified, that the supported PostgreSQL version matches your application, and that the documented install path works in your environment.

Frequently asked questions

Is StackGres a modified version of PostgreSQL?

No. StackGres contains PostgreSQL and other ecosystem components, but the README says PostgreSQL and the included components are vanilla versions from their respective open source repositories. Applications using PostgreSQL should work as-is.

Which PostgreSQL versions does StackGres support?

The README states that supported PostgreSQL major versions range from 12 to 18. The project points to its Versions page for the complete supported-version list.

How does StackGres implement high availability?

StackGres uses Patroni for high availability and automatic failover. The README says Patroni relies on Kubernetes APIs rather than requiring an external distributed consistent storage system.

How is StackGres licensed?

The source code is licensed under GNU Affero General Public License version 3. The README also says that a commercial license without GPL clauses is available by contacting the project.

Where can I find the StackGres installation command?

The README directs users to the StackGres installation page at `https://stackgres.io/install/`, which it says contains the one-line installation command. The command itself is not included in the repository README.

Official sources

  1. Issues
  2. License: AGPL-3.0
  3. ongres/stackgres on GitHub
  4. Project website
  5. README
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/ongres-stackgres.svg)](https://hysenlabs.com/projects/ongres-stackgres)

Was this useful?