generated from cloudnative-pg/cnpg-template
-
Notifications
You must be signed in to change notification settings - Fork 2
Add pgaudit Extension Support with Automated CI/CD Infrastructure #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
shusaan
wants to merge
30
commits into
cloudnative-pg:main
Choose a base branch
from
shusaan:pgaudit
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+385
−2
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Hi @NiccoloFei @gbartolini , |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR establishes the foundation for PostgreSQL extension container images by implementing pgaudit as the first supported extension, complete with automated build, testing, and release infrastructure.
🎯 Objectives Achieved
✅ Implement pgaudit extension following established patterns
✅ Create automated CI/CD pipeline with comprehensive testing
✅ Establish architecture for future extensions
✅ Provide real-world usage examples
🏗️ Architecture & Design
Extension Structure:
pgaudit/
├── Dockerfile # Multi-stage build
├── docker-bake.hcl # Build configuration with proper tagging
└── README.md # Extension-specific documentation
Copy
CI/CD Pipeline:
Release Monitoring: Nightly checks for new pgaudit releases
Automated Builds: Triggered on new releases or code changes
Comprehensive Testing: Kind + CNPG operator + real extension verification
Multi-branch Support: Feature branches get isolated testing
🧪 Testing Strategy
Smoke Tests Include:
Kind cluster with ImageVolume feature
CNPG operator installation & verification
PostgreSQL cluster creation with extension volumes
Extension availability verification (pg_available_extensions)
Extension creation testing (CREATE EXTENSION pgaudit)
📦 Container Images
Tagging Convention:
pgaudit:18-18.0-202510030210-bookworm (timestamped)
pgaudit:18-18.0-bookworm (rolling)
Supported Combinations:
PostgreSQL 18 + bookworm
PostgreSQL 18 + trixie
🔄 Workflow Design
Main Branch:
Builds all distro combinations
Runs full smoke tests
Tags successful releases
Pushes to production registry
Feature Branches:
Builds single combination for testing
Runs same smoke tests
Uses branch-specific tags
No production tagging
📋 Files Added/Modified
New Files:
pgaudit/Dockerfile - Multi-stage build for pgaudit
pgaudit/docker-bake.hcl - Build configuration
pgaudit/README.md - Extension documentation
.github/workflows/build-pgaudit.yml - Main CI/CD pipeline
.github/workflows/pgaudit-release-monitor.yml - Release monitoring
kind-config.yaml - Kind cluster configuration
Modified Files:
README.md - Updated with pgaudit support and usage examples
🚀 Usage Example
apiVersion: postgresql.cnpg.io/v1
kind: Cluster
metadata:
name: postgres-with-pgaudit
spec:
instances: 3
imageName: ghcr.io/cloudnative-pg/postgresql:18-bookworm
postgresql:
extensions:
- name: pgaudit
image:
reference: ghcr.io/cloudnative-pg/pgaudit:18-18.0-bookworm
parameters:
shared_preload_libraries: "pgaudit"
pgaudit.log: "all"
storage:
size: 1Gi
Copy
yaml
🔮 Future Roadmap
This implementation establishes patterns for:
Adding new extensions (pgvector, PostGIS, etc.)
Supporting multiple PostgreSQL versions
Community contributions
Extension-specific release cycles
✅ Testing
Docker builds succeed for all combinations
Kind cluster creates successfully with ImageVolume
CNPG operator installs and functions
PostgreSQL cluster starts with extension volumes
pgaudit extension is available and functional
CI/CD pipeline runs end-to-end
This PR provides a solid foundation for the PostgreSQL extensions ecosystem while maintaining high quality standards through comprehensive automated testing.