Actorizer-CDC is a Change Data Capture application designed to track and replicate database changes to an actorizer service. It monitors PostgreSQL databases using logical replication (WAL) and sends the changes to the actorizer service for further processing.
The Actorizer-CDC application captures changes from PostgreSQL databases and forwards them to an actorizer service. It supports monitoring multiple databases and tables, with configurable replication settings. The application is designed to work with the simulator platform and provides monitoring capabilities through Prometheus.
actorizer-cdc/
├── Chart.yaml # Helm chart metadata
├── .gitlab-ci.yml # GitLab CI/CD configuration
├── .helmignore # Files to ignore in Helm chart
├── mixins/ # Prometheus alert configurations
│ └── alerts.yaml # Alert rules for monitoring
├── templates/ # Helm templates
│ ├── _helpers.tpl # Helper templates
│ ├── configmap.yaml # ConfigMap for application configuration
│ ├── deployment.yaml # Kubernetes Deployment
│ ├── hpa.yaml # Horizontal Pod Autoscaler
│ ├── ingress.yaml # Ingress configuration
│ ├── monitoring.yaml # ServiceMonitor for Prometheus
│ ├── NOTES.txt # Installation notes
│ ├── prometheusrule-alerts.yaml # Prometheus alert rules
│ ├── secret.yaml # Secret for Docker registry credentials
│ ├── service.yaml # Kubernetes Service
│ └── serviceaccount.yaml # ServiceAccount configuration
└── values.yaml # Default configuration values
The following variables in the values.yaml file are configurable and should be set according to your environment:
| Variable | Description |
|---|---|
ACCOUNT_DOMAIN |
The domain URL for the account service |
CLIENT_ID |
Client ID for authentication with the account service |
SECRET |
Secret key for authentication with the account service |
DB_USER_ACTORIZER |
Username for connecting to the actorizer database |
DB_PASSWORD_ACTORIZER |
Password for connecting to the actorizer database |
DB_HOST_ACTORIZER |
Hostname for the actorizer database |
DB_USER_SIMUALTOR |
Username for connecting to the simulator database |
DB_PASSWORD_SIMUALTOR |
Password for connecting to the simulator database |
DB_HOST_SIMUALTOR |
Hostname for the simulator database |
DB_NAME_SIMUALTOR |
Database name for the simulator database |
The configuration is organized in the following structure:
-
Global Settings:
serviceMonitor.enabled: Enable/disable Prometheus ServiceMonitoralerts.enabled: Enable/disable Prometheus alertsrepotype: Repository type, can be "public" or "helm". When set to "helm", imagePullSecrets will be created and used
-
Actorizer CDC Settings:
replicaCount: Number of replicas to runimage: Container image settingsconfig: Application configuration
-
Application Configuration:
mode: Application mode (test, production)actorizer: URL of the actorizer servicealgorithm: Signature algorithm (EdDSA or ES256)srv: HTTP server settingsaccount: Account service connection settingsconnection: Main database connection settingsdbs: List of databases to monitor
-
Database Monitoring Configuration:
- Each database in the
dbslist has:name: Database nameconnection: Database connection settingsreplication: Replication settings (logical and history)entities: List of tables/entities to monitor
- Each database in the
-
Database Connection Parameters:
- The database connection URIs include several important parameters:
pool_min_conns: Minimum number of connections in the poolpool_max_conns: Maximum number of connections in the poolpool_max_conn_lifetime: Maximum lifetime of a connectionpool_max_conn_idle_time: Maximum idle time for a connectionpool_health_check_period: Interval for health checkspool_max_conn_lifetime_jitter: Jitter for connection lifetime
- The database connection URIs include several important parameters:
- Kubernetes cluster
- Helm 3.x
- PostgreSQL database with logical replication enabled
# Add the Helm repository
helm repo add corezoid https://hub.corezoid.com/helm
# Install the chart
helm install actorizer-cdc corezoid/actorizer-cdc \
--set global.actorizer_cdc.config.account.url=your-account-domain \
--set global.actorizer_cdc.config.account.client_id=your-client-id \
--set global.actorizer_cdc.config.account.secret=your-secret \
--set global.actorizer_cdc.config.connection.uri=postgres://user:password@host:5432/actorizer?pool_min_conns=2&pool_max_conns=20To override the default configuration, create a custom values file:
global:
serviceMonitor:
enabled: true
alerts:
enabled: true
actorizer_cdc:
replicaCount: 2
config:
actorizer: https://your-actorizer-url
account:
url: your-account-domain
client_id: your-client-id
secret: your-secret
connection:
uri: postgres://user:password@host:5432/actorizer?pool_min_conns=2&pool_max_conns=20
dbs:
- name: your-database
connection:
uri: postgres://user:password@host:5432/your-databaseThen install the chart with:
helm install actorizer-cdc corezoid/actorizer-cdc -f custom-values.yamlIf you need to use a private Docker repository, set the repotype to "helm":
global:
repotype: "helm"This will create a Secret with Docker registry credentials and configure the Deployment to use it.
The Actorizer-CDC application supports two types of replication:
-
Logical Replication:
- Uses PostgreSQL's logical decoding feature with the
wal2jsonplugin - Captures changes in real-time as they occur in the database
- Configuration parameters:
enable: Enable/disable logical replicationslot: Name of the replication slotworkers: Number of worker threads for processing changes
- Uses PostgreSQL's logical decoding feature with the
-
History Replication:
- Used for initial data loading or catching up after downtime
- Scans database tables for changes based on timestamps
- Configuration parameters:
enable: Enable/disable history replicationcycle: Whether to continuously scan for changesthreads: Number of threads for scanning
For each table being monitored, you can configure:
name: Logical name for the entityschema: Database schema (usually "public")table: Table name (supports regex patterns liketransactions_[0-9]{6})order: Fields to order by when retrieving changesentity: Fields that uniquely identify an entitydata: Additional fields to include in the change data
The chart includes Prometheus alerts for monitoring the application:
ActorizerCDCTooManyErrorsInMinute: Alerts when there are more than 20 errors in a minuteActorizerCDCTooManyErrorsInHour: Alerts when there are more than 100 errors in an hour
To enable monitoring, set:
global:
serviceMonitor:
enabled: true
alerts:
enabled: truehelm upgrade actorizer-cdc corezoid/actorizer-cdc -f custom-values.yamlhelm uninstall actorizer-cdcCopyright © Corezoid