diff --git a/.github/workflows/tests-cluster-chainsaw.yaml b/.github/workflows/tests-cluster-chainsaw.yaml index af27270f1..15e02743b 100644 --- a/.github/workflows/tests-cluster-chainsaw.yaml +++ b/.github/workflows/tests-cluster-chainsaw.yaml @@ -59,6 +59,29 @@ jobs: echo "Chart.yaml:" cat Chart.yaml + # Added by ParadeDB: Authenticate to Docker Hub to avoid rate limits + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_ACCESS_TOKEN }} + + # Added by ParadeDB: Always pull the latest version of paradedb/paradedb + - name: Set ParadeDB Version to Latest + working-directory: charts/paradedb/ + env: + GH_TOKEN: ${{ secrets.GHA_CREATE_RELEASE_PAT }} + run: | + LATEST_TAG=$(curl -s https://api.github.com/repos/paradedb/paradedb/tags | jq -r '.[0].name') + APP_VERSION=${LATEST_TAG#v} + sed -i "s/^[[:space:]]*paradedb: .*/ paradedb: \"$APP_VERSION\"/" values.yaml + sed -i "s/^version: .*/version: ${{ vars.CHART_VERSION_MAJOR }}.${{ vars.CHART_VERSION_MINOR }}.${{ vars.CHART_VERSION_PATCH }}/" Chart.yaml + echo "values.yaml:" + cat values.yaml + echo "----------------------------------------" + echo "Chart.yaml:" + cat Chart.yaml + - name: Setup kind uses: ./.github/actions/setup-kind diff --git a/charts/paradedb/README.md b/charts/paradedb/README.md index 461397013..a04ad1be3 100644 --- a/charts/paradedb/README.md +++ b/charts/paradedb/README.md @@ -210,7 +210,7 @@ refer to the [CloudNativePG Documentation](https://cloudnative-pg.io/documentat | cluster.monitoring.customQueries | list | `[]` | Custom Prometheus metrics Will be stored in the ConfigMap | | cluster.monitoring.customQueriesSecret | list | `[]` | The list of secrets containing the custom queries | | cluster.monitoring.disableDefaultQueries | bool | `false` | Whether the default queries should be injected. Set it to true if you don't want to inject default queries into the cluster. | -| cluster.monitoring.enabled | bool | `false` | Whether to enable monitoring | +| cluster.monitoring.enabled | bool | `true` | Whether to enable monitoring | | cluster.monitoring.podMonitor.enabled | bool | `true` | Whether to enable the PodMonitor | | cluster.monitoring.podMonitor.metricRelabelings | list | `[]` | The list of metric relabelings for the PodMonitor. Applied to samples before ingestion. | | cluster.monitoring.podMonitor.relabelings | list | `[]` | The list of relabelings for the PodMonitor. Applied to samples before scraping. | @@ -218,7 +218,7 @@ refer to the [CloudNativePG Documentation](https://cloudnative-pg.io/documentat | cluster.monitoring.prometheusRule.excludeRules | list | `[]` | Exclude specified rules | | cluster.postgresGID | int | `-1` | The GID of the postgres user inside the image, defaults to 26 | | cluster.postgresUID | int | `-1` | The UID of the postgres user inside the image, defaults to 26 | -| cluster.postgresql.parameters | object | `{}` | PostgreSQL configuration options (postgresql.conf) | +| cluster.postgresql.parameters | object | `{"cron.database_name":"postgres"}` | PostgreSQL configuration options (postgresql.conf) | | cluster.postgresql.pg_hba | list | `[]` | PostgreSQL Host Based Authentication rules (lines to be appended to the pg_hba.conf file) | | cluster.postgresql.pg_ident | list | `[]` | PostgreSQL User Name Maps rules (lines to be appended to the pg_ident.conf file) | | cluster.postgresql.shared_preload_libraries | list | `[]` | Lists of shared preload libraries to add to the default ones | diff --git a/charts/paradedb/test/scheduledbackups/00-minio_cleanup-assert.yaml b/charts/paradedb/test/scheduledbackups/00-minio_cleanup-assert.yaml new file mode 100644 index 000000000..678c11c9b --- /dev/null +++ b/charts/paradedb/test/scheduledbackups/00-minio_cleanup-assert.yaml @@ -0,0 +1,6 @@ +apiVersion: batch/v1 +kind: Job +metadata: + name: paradedb-test +status: + succeeded: 1 diff --git a/charts/paradedb/test/scheduledbackups/00-minio_cleanup.yaml b/charts/paradedb/test/scheduledbackups/00-minio_cleanup.yaml new file mode 100644 index 000000000..90151a964 --- /dev/null +++ b/charts/paradedb/test/scheduledbackups/00-minio_cleanup.yaml @@ -0,0 +1,16 @@ +apiVersion: batch/v1 +kind: Job +metadata: + name: minio-cleanup +spec: + template: + spec: + restartPolicy: OnFailure + containers: + - name: minio-cleanup + image: minio/mc + command: ['sh', '-c'] + args: + - | + mc alias set myminio https://minio.minio.svc.cluster.local minio minio123 + mc rm --recursive --force myminio/mybucket/scheduledbackups diff --git a/charts/paradedb/test/scheduledbackups/01-scheduledbackups_cluster-assert.yaml b/charts/paradedb/test/scheduledbackups/01-scheduledbackups_cluster-assert.yaml new file mode 100644 index 000000000..a3af1a25b --- /dev/null +++ b/charts/paradedb/test/scheduledbackups/01-scheduledbackups_cluster-assert.yaml @@ -0,0 +1,37 @@ +apiVersion: postgresql.cnpg.io/v1 +kind: Cluster +metadata: + name: scheduledbackups-cluster +status: + readyInstances: 1 +--- +apiVersion: postgresql.cnpg.io/v1 +kind: ScheduledBackup +metadata: + name: scheduledbackups-cluster-daily-backup +spec: + immediate: true + schedule: "0 0 0 * * *" + method: barmanObjectStore + backupOwnerReference: self + cluster: + name: scheduledbackups-cluster +--- +apiVersion: postgresql.cnpg.io/v1 +kind: ScheduledBackup +metadata: + name: scheduledbackups-cluster-weekly-backup +spec: + immediate: true + schedule: "0 0 0 * * 1" + method: barmanObjectStore + backupOwnerReference: self + cluster: + name: scheduledbackups-cluster +--- +apiVersion: postgresql.cnpg.io/v1 +kind: Backup +spec: + method: barmanObjectStore + cluster: + name: scheduledbackups-cluster diff --git a/charts/paradedb/test/scheduledbackups/01-scheduledbackups_cluster.yaml b/charts/paradedb/test/scheduledbackups/01-scheduledbackups_cluster.yaml new file mode 100644 index 000000000..94f6015c4 --- /dev/null +++ b/charts/paradedb/test/scheduledbackups/01-scheduledbackups_cluster.yaml @@ -0,0 +1,35 @@ +type: postgresql +mode: standalone + +cluster: + instances: 1 + storage: + size: 256Mi + +backups: + enabled: true + provider: s3 + endpointURL: "https://minio.minio.svc.cluster.local" + endpointCA: + name: kube-root-ca.crt + key: ca.crt + wal: + encryption: "" + data: + encryption: "" + s3: + bucket: "mybucket" + path: "/scheduledbackups/v1" + accessKey: "minio" + secretKey: "minio123" + region: "local" + retentionPolicy: "30d" + scheduledBackups: + - name: daily-backup + schedule: "0 0 0 * * *" + backupOwnerReference: self + method: barmanObjectStore + - name: weekly-backup + schedule: "0 0 0 * * 1" + backupOwnerReference: self + method: barmanObjectStore diff --git a/charts/paradedb/test/scheduledbackups/chainsaw-test.yaml b/charts/paradedb/test/scheduledbackups/chainsaw-test.yaml new file mode 100644 index 000000000..c1409ce46 --- /dev/null +++ b/charts/paradedb/test/scheduledbackups/chainsaw-test.yaml @@ -0,0 +1,27 @@ +apiVersion: chainsaw.kyverno.io/v1alpha1 +kind: Test +metadata: + name: scheduledbackups +spec: + timeouts: + apply: 1s + assert: 1m + cleanup: 1m + steps: + - name: Install a cluster with ScheduledBackups + try: + - script: + content: | + helm upgrade \ + --install \ + --namespace $NAMESPACE \ + --values ./01-scheduledbackups_cluster.yaml \ + --wait \ + scheduledbackups ../../ + - assert: + file: ./01-scheduledbackups_cluster-assert.yaml + - name: Cleanup + try: + - script: + content: | + helm uninstall --namespace $NAMESPACE scheduledbackups diff --git a/charts/paradedb/values.yaml b/charts/paradedb/values.yaml index 2de42e257..8c912d1ee 100644 --- a/charts/paradedb/values.yaml +++ b/charts/paradedb/values.yaml @@ -297,7 +297,9 @@ cluster: postgresql: # -- PostgreSQL configuration options (postgresql.conf) - parameters: {} + parameters: + # Required by pg_cron + cron.database_name: postgres # max_connections: 300 # -- Quorum-based Synchronous Replication synchronous: {}