├── .editorconfig ├── .github └── ISSUE_TEMPLATE │ ├── bug_report.md │ ├── enhancement-request.md │ ├── feature_request.md │ └── support---question-and-answer.md ├── .gitignore ├── .gitmodules ├── CONTRIBUTING.md ├── ISSUE_TEMPLATE.md ├── LICENSE.md ├── Makefile ├── PULL_REQUEST_TEMPLATE.md ├── README.md ├── _config.yml ├── badger └── badgerserver.go ├── bin ├── .gitignore ├── common │ ├── common_lib.sh │ ├── nss_wrapper.sh │ ├── nss_wrapper_env.sh │ ├── uid_daemon.sh │ ├── uid_postgres.sh │ └── uid_postgres_no_exec.sh ├── install-deps.sh ├── license_aggregator.sh ├── pgadmin4 │ └── start-pgadmin4.sh ├── pgbackrest-common │ └── start.sh ├── pgbackrest-repo │ ├── archive-push-gcs.sh │ ├── archive-push-s3.sh │ ├── pgbackrest-repo.sh │ └── uid_pgbackrest.sh ├── pgbackrest-restore │ ├── pgbackrest-restore.sh │ └── restore_common_lib.sh ├── pgbackrest │ └── .gitignore ├── pgbadger │ ├── badger-generate.sh │ └── start-pgbadger.sh ├── pgbouncer │ ├── .gitignore │ └── start.sh ├── pgpool │ └── startpgpool.sh ├── postgres-gis │ └── setup.sql ├── postgres_common │ ├── backup │ │ └── start-backupjob.sh │ ├── exporter │ │ └── install.sh │ ├── modules │ │ ├── pgaudit.sh │ │ └── pgmonitor.sh │ ├── pgbasebackup_restore │ │ └── start.sh │ ├── pgbench │ │ └── start.sh │ ├── pgdump │ │ └── start.sh │ ├── pgrestore │ │ └── start.sh │ ├── postgres │ │ ├── .gitignore │ │ ├── check-for-secrets.sh │ │ ├── custom-configs.sh │ │ ├── liveness.sh │ │ ├── pgbackrest.sh │ │ ├── pgbackrest_backup.sh │ │ ├── pgbackrest_env.sh │ │ ├── pgbackrest_info.sh │ │ ├── promote.sh │ │ ├── readiness.sh │ │ ├── readiness.sql │ │ ├── reload.sh │ │ ├── setenv.sh │ │ ├── setup.sql │ │ ├── sshd.sh │ │ ├── start-secrets.sh │ │ └── start.sh │ ├── sqlrunner │ │ └── start.sh │ └── start.sh ├── pull-from-crunchy.sh ├── pull-from-dockerhub.sh ├── pull-from-gcr.sh ├── push-to-local.sh ├── remove-all-images.sh ├── setenv.sh └── upgrade │ └── start.sh ├── btn.png ├── build ├── base-ext │ └── Dockerfile ├── base │ └── Dockerfile ├── pgadmin4 │ └── Dockerfile ├── pgbackrest │ └── Dockerfile ├── pgbadger │ └── Dockerfile ├── pgbouncer │ └── Dockerfile ├── pgpool │ └── Dockerfile ├── postgres-gis │ └── Dockerfile ├── postgres │ └── Dockerfile └── upgrade │ └── Dockerfile ├── cmd └── pgbackrest │ └── main.go ├── conf ├── .gitignore ├── backrest │ ├── group.template │ └── passwd.template ├── collect │ ├── group.template │ └── passwd.template ├── demo-namespace.json ├── node-exporter │ ├── group.template │ └── passwd.template ├── pgadmin4 │ ├── config_local.py │ ├── group.template │ ├── httpd.conf │ ├── passwd.template │ ├── pgadmin-http.conf │ └── pgadmin-https.conf ├── pgbackrest-repo │ ├── .gitignore │ └── aws-s3-credentials.yaml ├── pgbackrest-restore │ ├── group.template │ └── passwd.template ├── pgbadger │ ├── group.template │ └── passwd.template ├── pgbouncer │ ├── group.template │ ├── passwd.template │ ├── pgbouncer.ini │ └── users.txt ├── pgpool │ ├── group.template │ ├── passwd.template │ ├── pgpool.conf │ ├── pool_hba.conf │ └── pool_passwd ├── postgres_common │ ├── backup │ │ ├── group.template │ │ └── passwd.template │ ├── pgbench │ │ ├── group.template │ │ └── passwd.template │ ├── pgdump │ │ ├── group.template │ │ └── passwd.template │ ├── pgrestore │ │ ├── group.template │ │ └── passwd.template │ └── postgres │ │ ├── archive-command │ │ ├── backrest-archive-command │ │ ├── backrest-archive-command-local-and-gcs │ │ ├── backrest-archive-command-local-and-s3 │ │ ├── group.template │ │ ├── passwd.template │ │ ├── pg_hba.conf │ │ ├── pgrepl-recovery.conf │ │ ├── postgresql.conf.template │ │ └── postgresql.conf.template.nopgaudit ├── sample-app │ ├── group.template │ ├── main.css │ └── passwd.template ├── scheduler │ ├── backup-template.json │ ├── group.template │ └── passwd.template └── upgrade │ ├── group.template │ └── passwd.template ├── containers.png ├── crunchy_logo.png ├── docs ├── archetypes │ └── default.md ├── config.toml ├── content │ ├── _index.md │ ├── client-user-guide │ │ ├── _index.md │ │ ├── usage.md │ │ └── user-guide.md │ ├── container-specifications │ │ ├── _index.md │ │ ├── crunchy-pgadmin4.md │ │ ├── crunchy-pgbackrest.md │ │ ├── crunchy-pgbadger.md │ │ ├── crunchy-pgbouncer.md │ │ ├── crunchy-pgpool.md │ │ ├── crunchy-postgres-gis.md │ │ ├── crunchy-postgres │ │ │ ├── _index.md │ │ │ ├── backup.md │ │ │ ├── pgbasebackup-restore.md │ │ │ ├── pgbench.md │ │ │ ├── pgdump.md │ │ │ ├── pgrestore.md │ │ │ ├── postgres.md │ │ │ └── sqlrunner.md │ │ └── crunchy-upgrade.md │ ├── contributing │ │ ├── _index.md │ │ ├── building.md │ │ ├── documentation-updates.md │ │ ├── issues.md │ │ └── pull-requests.md │ ├── examples │ │ ├── _index.md │ │ ├── administration │ │ │ ├── pgAdmin4.md │ │ │ └── upgrade.md │ │ ├── backup-restoration │ │ │ ├── pgbackrest.md │ │ │ ├── pgbasebackup.md │ │ │ └── pgdump-pgrestore.md │ │ ├── logging │ │ │ ├── centralized-logging.md │ │ │ └── pgaudit.md │ │ ├── metrics │ │ │ ├── pgbadger.md │ │ │ └── pgbench.md │ │ ├── poolers │ │ │ ├── pgbouncer.md │ │ │ └── pgpool.md │ │ └── postgresql │ │ │ ├── custom-config-ssl.md │ │ │ ├── custom-config.md │ │ │ ├── postgis.md │ │ │ ├── primary-replica.md │ │ │ ├── primary.md │ │ │ └── sync-replica.md │ ├── installation-guide │ │ ├── _index.md │ │ ├── installation-guide.md │ │ └── storage-configuration.md │ ├── overview │ │ ├── _index.md │ │ ├── overview.md │ │ └── supported.md │ └── troubleshooting │ │ └── _index.md ├── layouts │ └── partials │ │ └── flex │ │ └── body-aftercontent.html └── static │ ├── Operator-DR-Storage.png │ ├── OperatorReferenceDiagram.png │ ├── after.png │ ├── containers.png │ ├── crunchy_logo.png │ ├── favicon.ico │ ├── favicon.png │ ├── grafana-dashboard-1.png │ ├── grafana-dashboard-2.png │ ├── grafana-dashboard-3.png │ ├── grafana.png │ ├── grafana_s1.png │ ├── grafana_s2.png │ ├── operator-diagram-cluster.png │ ├── operator-diagram-database.png │ ├── operator-diagram.png │ ├── pgadmin4-screenshot.png │ ├── pgadmin4.png │ ├── pgbadger.png │ ├── prometheus-console.png │ └── tty.gif ├── examples ├── common.sh ├── docker │ ├── backrest │ │ ├── async-archive │ │ │ ├── cleanup.sh │ │ │ └── run.sh │ │ ├── backup │ │ │ ├── cleanup.sh │ │ │ └── run.sh │ │ ├── delta │ │ │ ├── cleanup.sh │ │ │ ├── post-restore.sh │ │ │ └── run.sh │ │ ├── full │ │ │ ├── cleanup.sh │ │ │ ├── post-restore.sh │ │ │ └── run.sh │ │ └── pitr │ │ │ ├── cleanup.sh │ │ │ ├── post-restore.sh │ │ │ └── run.sh │ ├── custom-config-ssl │ │ ├── cleanup.sh │ │ ├── configs │ │ │ ├── pg_hba.conf │ │ │ ├── pg_ident.conf │ │ │ ├── postgresql.conf │ │ │ └── setup.sql │ │ └── run.sh │ ├── custom-config │ │ ├── cleanup.sh │ │ ├── configs │ │ │ ├── pg_hba.conf │ │ │ ├── postgresql.conf │ │ │ └── setup.sql │ │ └── run.sh │ ├── pgadmin4-http │ │ ├── cleanup.sh │ │ └── run.sh │ ├── pgadmin4-https │ │ ├── cleanup.sh │ │ └── run.sh │ ├── pgaudit │ │ ├── cleanup.sh │ │ ├── run.sh │ │ ├── test-pgaudit.sh │ │ └── test.sql │ ├── pgbadger │ │ ├── cleanup.sh │ │ ├── env │ │ │ └── pgsql-primary.list │ │ └── run.sh │ ├── pgbasebackup │ │ ├── backup │ │ │ ├── cleanup.sh │ │ │ └── run.sh │ │ └── full │ │ │ ├── cleanup.sh │ │ │ ├── post-restore.sh │ │ │ └── run.sh │ ├── pgbench-custom │ │ ├── cleanup.sh │ │ ├── configs │ │ │ └── transactions.sql │ │ └── run.sh │ ├── pgbench │ │ ├── cleanup.sh │ │ └── run.sh │ ├── pgbouncer │ │ ├── cleanup.sh │ │ ├── configs │ │ │ ├── pgbouncer-auth.sql │ │ │ └── post-start-hook.sh │ │ ├── env │ │ │ ├── pgbouncer-primary.list │ │ │ ├── pgbouncer-replica.list │ │ │ ├── pgsql-primary.list │ │ │ └── pgsql-replica.list │ │ └── run.sh │ ├── pgdump │ │ ├── backup │ │ │ ├── cleanup.sh │ │ │ └── run.sh │ │ └── pgrestore │ │ │ ├── cleanup.sh │ │ │ └── run.sh │ ├── pgpool │ │ ├── cleanup.sh │ │ └── run.sh │ ├── postgres-gis │ │ ├── cleanup.sh │ │ └── run.sh │ ├── primary-replica │ │ ├── cleanup.sh │ │ └── run.sh │ ├── primary │ │ ├── cleanup.sh │ │ └── run.sh │ ├── swarm-service │ │ ├── README │ │ ├── cleanup.sh │ │ ├── docker-compose.yml │ │ └── run.sh │ └── sync │ │ ├── cleanup.sh │ │ └── run.sh ├── helm │ ├── custom-config │ │ ├── Chart.yaml │ │ ├── README.md │ │ ├── configs │ │ │ ├── pg_hba.conf │ │ │ ├── postgresql.conf │ │ │ └── setup.sql │ │ ├── templates │ │ │ ├── NOTES.txt │ │ │ ├── custom-config-pod.yml │ │ │ ├── custom-config-service.yml │ │ │ └── custom-configmap.yaml │ │ └── values.yaml │ ├── primary-replica │ │ ├── Chart.yaml │ │ ├── README.md │ │ ├── templates │ │ │ ├── NOTES.txt │ │ │ ├── pgprimary-secret.yaml │ │ │ ├── pgroot-secret.yaml │ │ │ ├── pguser-secret.yaml │ │ │ ├── primary-pod.yaml │ │ │ ├── primary-pv.yaml │ │ │ ├── primary-pvc.yaml │ │ │ ├── primary-service.yaml │ │ │ ├── replica-deployment.yaml │ │ │ └── replica-service.yaml │ │ └── values.yaml │ ├── primary │ │ ├── Chart.yaml │ │ ├── README.md │ │ ├── templates │ │ │ ├── NOTES.txt │ │ │ ├── basic-pod.yaml │ │ │ └── basic-service.yaml │ │ └── values.yaml │ └── template-small │ │ ├── Chart.yaml │ │ ├── README.md │ │ ├── templates │ │ ├── NOTES.txt │ │ ├── deployment.yaml │ │ └── service.yaml │ │ └── values.yaml ├── kube │ ├── backrest │ │ ├── async-archiving │ │ │ ├── backrest-async-archive-pv-nfs.json │ │ │ ├── backrest-async-archive-pv.json │ │ │ ├── backrest-async-archive-pvc-sc.json │ │ │ ├── backrest-async-archive-pvc.json │ │ │ ├── backrest.json │ │ │ ├── cleanup.sh │ │ │ └── run.sh │ │ ├── backup │ │ │ ├── backrest-pv-nfs.json │ │ │ ├── backrest-pv.json │ │ │ ├── backrest-pvc-sc.json │ │ │ ├── backrest-pvc.json │ │ │ ├── backrest.json │ │ │ ├── cleanup.sh │ │ │ └── run.sh │ │ ├── delta │ │ │ ├── backrest-restored.json │ │ │ ├── cleanup.sh │ │ │ ├── delta-restore.json │ │ │ ├── post-restore.sh │ │ │ └── run.sh │ │ ├── full │ │ │ ├── backrest-full-restored-pv-nfs.json │ │ │ ├── backrest-full-restored-pv.json │ │ │ ├── backrest-full-restored-pvc-sc.json │ │ │ ├── backrest-full-restored-pvc.json │ │ │ ├── backrest-restored.json │ │ │ ├── cleanup.sh │ │ │ ├── full-restore.json │ │ │ ├── post-restore.sh │ │ │ └── run.sh │ │ └── pitr │ │ │ ├── backrest-restored.json │ │ │ ├── cleanup.sh │ │ │ ├── pitr-restore.json │ │ │ ├── post-restore.sh │ │ │ └── run.sh │ ├── centralized-logging │ │ ├── efk │ │ │ ├── cleanup-rbac.sh │ │ │ ├── cleanup.sh │ │ │ ├── elasticsearch-statefulset.yaml │ │ │ ├── fluentd-configmap.yaml │ │ │ ├── fluentd-daemonset.yaml │ │ │ ├── kibana-deployment.yaml │ │ │ └── run.sh │ │ └── postgres-cluster │ │ │ ├── cleanup.sh │ │ │ ├── configs │ │ │ └── postgresql.conf │ │ │ ├── postgres-cluster-pv-nfs.json │ │ │ ├── postgres-cluster-pv.json │ │ │ ├── postgres-cluster-pvc-sc.json │ │ │ ├── postgres-cluster-pvc.json │ │ │ ├── postgres-cluster.json │ │ │ └── run.sh │ ├── custom-config-ssl │ │ ├── cleanup.sh │ │ ├── configs │ │ │ ├── pg_hba.conf │ │ │ ├── pg_ident.conf │ │ │ └── postgresql.conf │ │ ├── custom-config-ssl-pv-nfs.json │ │ ├── custom-config-ssl-pv.json │ │ ├── custom-config-ssl-pvc-sc.json │ │ ├── custom-config-ssl-pvc.json │ │ ├── custom-config-ssl.json │ │ └── run.sh │ ├── custom-config │ │ ├── cleanup.sh │ │ ├── configs │ │ │ ├── pg_hba.conf │ │ │ ├── post-start-hook.sh │ │ │ ├── postgresql.conf │ │ │ ├── pre-start-hook.sh │ │ │ └── setup.sql │ │ ├── custom-config-pv-nfs.json │ │ ├── custom-config-pv.json │ │ ├── custom-config-pvc-sc.json │ │ ├── custom-config-pvc.json │ │ ├── custom-config.json │ │ └── run.sh │ ├── pgadmin4-http │ │ ├── cleanup.sh │ │ ├── pgadmin4-http-pv-nfs.json │ │ ├── pgadmin4-http-pv.json │ │ ├── pgadmin4-http-pvc-sc.json │ │ ├── pgadmin4-http-pvc.json │ │ ├── pgadmin4-http.json │ │ └── run.sh │ ├── pgadmin4-https │ │ ├── cleanup.sh │ │ ├── pgadmin4-https-pv-nfs.json │ │ ├── pgadmin4-https-pv.json │ │ ├── pgadmin4-https-pvc-sc.json │ │ ├── pgadmin4-https-pvc.json │ │ ├── pgadmin4-https.json │ │ └── run.sh │ ├── pgaudit │ │ ├── cleanup.sh │ │ ├── configs │ │ │ ├── pgaudit-test.sql │ │ │ └── postgresql.conf │ │ ├── pgaudit.json │ │ ├── run.sh │ │ └── test-pgaudit.sh │ ├── pgbadger │ │ ├── cleanup.sh │ │ ├── pgbadger.json │ │ └── run.sh │ ├── pgbasebackup │ │ ├── backup │ │ │ ├── backup-pv-nfs.json │ │ │ ├── backup-pv.json │ │ │ ├── backup-pvc-sc.json │ │ │ ├── backup-pvc.json │ │ │ ├── backup.json │ │ │ ├── cleanup.sh │ │ │ └── run.sh │ │ └── full │ │ │ ├── cleanup.sh │ │ │ ├── full-restored.json │ │ │ ├── post-restore.sh │ │ │ ├── restore-pv-nfs.json │ │ │ ├── restore-pv.json │ │ │ ├── restore-pvc-sc.json │ │ │ ├── restore-pvc.json │ │ │ ├── restore.json │ │ │ └── run.sh │ ├── pgbench-custom │ │ ├── cleanup.sh │ │ ├── configs │ │ │ ├── transactions.sql │ │ │ └── transactions95.sql │ │ ├── pgbench.json │ │ └── run.sh │ ├── pgbench │ │ ├── cleanup.sh │ │ ├── pgbench.json │ │ └── run.sh │ ├── pgbouncer │ │ ├── cleanup.sh │ │ ├── pgbouncer-primary.json │ │ ├── pgbouncer-pv.json │ │ ├── pgbouncer-pvc-sc.json │ │ ├── pgbouncer-pvc.json │ │ ├── pgbouncer-replica.json │ │ ├── post-configs │ │ │ ├── pgbouncer-auth.sql │ │ │ └── post-start-hook.sh │ │ ├── primary.json │ │ ├── replica.json │ │ └── run.sh │ ├── pgdump │ │ ├── backup │ │ │ ├── cleanup.sh │ │ │ ├── pgdump-pv-nfs.json │ │ │ ├── pgdump-pv.json │ │ │ ├── pgdump-pvc-sc.json │ │ │ ├── pgdump-pvc.json │ │ │ ├── pgdump.json │ │ │ └── run.sh │ │ └── pgrestore │ │ │ ├── cleanup.sh │ │ │ ├── pgrestore.json │ │ │ └── run.sh │ ├── pgpool │ │ ├── cleanup.sh │ │ ├── configs │ │ │ ├── pgpool.conf │ │ │ ├── pool_hba.conf │ │ │ └── pool_passwd │ │ ├── pgpool.json │ │ └── run.sh │ ├── postgres-gis │ │ ├── cleanup.sh │ │ ├── postgres-gis.json │ │ └── run.sh │ ├── primary-replica │ │ ├── cleanup.sh │ │ ├── primary-replica-pv-nfs.json │ │ ├── primary-replica-pv.json │ │ ├── primary-replica-pvc-sc.json │ │ ├── primary-replica-pvc.json │ │ ├── primary.json │ │ ├── replica.json │ │ └── run.sh │ ├── primary │ │ ├── cleanup.sh │ │ ├── primary-pv-nfs.json │ │ ├── primary-pv.json │ │ ├── primary-pvc-sc.json │ │ ├── primary-pvc.json │ │ ├── primary.json │ │ └── run.sh │ ├── secret │ │ ├── cleanup.sh │ │ ├── run.sh │ │ └── secret.json │ ├── sync │ │ ├── cleanup.sh │ │ ├── run.sh │ │ └── sync.json │ └── upgrade │ │ ├── cleanup.sh │ │ ├── post-upgrade.sh │ │ ├── primary-upgraded.json │ │ ├── run.sh │ │ ├── upgrade-pv-nfs.json │ │ ├── upgrade-pv.json │ │ ├── upgrade-pvc-sc.json │ │ ├── upgrade-pvc.json │ │ └── upgrade.json ├── ssl-creator.sh └── waitforterm.sh ├── generate-docs.sh ├── go.mod ├── go.sum ├── images ├── containers.png ├── containers_diagram.xml ├── crunchy_logo.png ├── grafana.png ├── pgadmin4.png └── pgbadger.png ├── licenses └── LICENSE.txt └── redhat └── atomic ├── help.1 └── help.md /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [**] 4 | indent_style = space 5 | indent_size = 4 6 | end_of_line = lf 7 | charset = utf-8 8 | trim_trailing_whitespace = true 9 | insert_final_newline = true 10 | 11 | [**.yml] 12 | indent_size = 2 13 | 14 | [Makefile] 15 | indent_style = tab 16 | indent_size = 8 17 | 18 | [**.sh] 19 | indent_style = space 20 | indent_size = 4 21 | 22 | [**.json] 23 | indent_style = space 24 | indent_size = 4 25 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | 5 | --- 6 | 7 | **Describe the bug** 8 | A clear and concise description of what the bug is. 9 | 10 | **To Reproduce** 11 | Steps to reproduce the behavior: 12 | 1. Go to '...' 13 | 2. Click on '....' 14 | 3. Scroll down to '....' 15 | 4. See error 16 | 17 | **Expected behavior** 18 | A clear and concise description of what you expected to happen. 19 | 20 | **Screenshots** 21 | If applicable, add screenshots to help explain your problem. 22 | 23 | **Please tell us about your environment:** 24 | 25 | * Operating System: 26 | * Where is this running ( Local, Cloud Provider) 27 | * Storage being used (NFS, Hostpath, Gluster, etc): 28 | * Container Image Tag: 29 | * PostgreSQL Version: 30 | * Platform (Docker, Kubernetes, OpenShift): 31 | * Platform Version: 32 | 33 | **Additional context** 34 | Add any other context about the problem here. 35 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/enhancement-request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Enhancement request 3 | about: Suggest an improvement to a current an existing feature 4 | 5 | --- 6 | 7 | **What is the motivation or use case for the change? ** 8 | 9 | **Describe the solution you'd like** 10 | A clear and concise description of what you want to happen. 11 | 12 | **Please tell us about your environment:** 13 | 14 | * Operating System: 15 | * Where is this running ( Local, Cloud Provider) 16 | * Storage being used (NFS, Hostpath, Gluster, etc): 17 | * Container Image Tag: 18 | * PostgreSQL Version: 19 | * Platform (Docker, Kubernetes, OpenShift): 20 | * Platform Version: 21 | 22 | **Additional context** 23 | Add any other context or screenshots about the enhancement request here. 24 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | 5 | --- 6 | 7 | **What is the motivation or use case for the feature? ** 8 | 9 | **Describe the solution you'd like** 10 | A clear and concise description of what you want to happen. 11 | 12 | **Describe any alternatives you've considered** 13 | A clear and concise description of any alternative solutions or features you've considered. 14 | 15 | **Please tell us about your environment:** 16 | 17 | * Operating System: 18 | * Where is this running ( Local , Cloud Provider) 19 | * Storage being used (NFS, Hostpath, Gluster, etc): 20 | * Container Image Tag: 21 | * PostgreSQL Version: 22 | * Platform (Docker, Kubernetes, OpenShift): 23 | * Platform Version: 24 | 25 | **Additional context** 26 | Add any other context or screenshots about the feature request here. 27 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/support---question-and-answer.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Support - Question and Answer 3 | about: " Have a quick question, let us know." 4 | 5 | --- 6 | 7 | ** Which example are you working with? ** 8 | 9 | **What is the current behavior?** 10 | 11 | **What is the expected behavior?** 12 | 13 | **Other information** (e.g. detailed explanation, related issues, etc) 14 | 15 | **Please tell us about your environment:** 16 | 17 | * Operating System: 18 | * Where is this running ( Local , Cloud Provider) 19 | * Storage being used (NFS, Hostpath, Gluster, etc): 20 | * Container Image Tag: 21 | * PostgreSQL Version: 22 | * Platform (Docker, Kubernetes, OpenShift): 23 | * Platform Version: 24 | 25 | If possible please run the following on the kubernetes or Openshit (oc) commands and provide the result: 26 | kubectl describe yourPodName 27 | kubectl describe pvc 28 | kubectl get nodes 29 | kubectl log yourPodName 30 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | bootstrap-*.zip* 2 | tools/test-harness/vendor 3 | tools/pgmonitor/ 4 | yq 5 | /vendor/ 6 | licenses/* 7 | !licenses/LICENSE.txt 8 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "hugo/themes/crunchy-hugo-theme"] 2 | path = docs/themes/crunchy-hugo-theme 3 | url = https://github.com/crunchydata/crunchy-hugo-theme 4 | -------------------------------------------------------------------------------- /ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | **I'm submitting a ...** 2 | 3 | 4 | - [ ] bug report 5 | - [ ] feature request 6 | - [ ] support request 7 | 8 | 9 | 10 | **Do you want to request a *feature* or report a *bug*?** 11 | 12 | 13 | 14 | **What is the current behavior?** 15 | 16 | 17 | 18 | **If the current behavior is a bug, please provide the steps to reproduce:** 19 | 20 | 21 | 22 | **What is the expected behavior?** 23 | 24 | 25 | 26 | **What is the motivation or use case for changing the behavior?** 27 | 28 | 29 | 30 | **Other information** (e.g. detailed explanation, related issues, suggestions how to fix, etc) 31 | 32 | 33 | 34 | **Please tell us about your environment:** 35 | 36 | - Operating System: 37 | - Container Image Tag: 38 | - PostgreSQL Version: 39 | - Storage (NFS, hostpath, storage class): 40 | - Platform (Docker, Kubernetes, OpenShift): 41 | - Platform Version: 42 | -------------------------------------------------------------------------------- /PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | **Checklist:** 2 | 3 | 4 | - [ ] Have you added an explanation of what your changes do and why you'd like them to be included? 5 | - [ ] Have you updated or added documentation for the change, as applicable? 6 | - [ ] Have you tested your changes on all related environments with successful results, as applicable? 7 | 8 | 9 | 10 | **Type of Changes:** 11 | 12 | 13 | - [ ] Bug fix (non-breaking change which fixes an issue) 14 | - [ ] New feature (non-breaking change which adds functionality) 15 | - [ ] Breaking change (fix or feature that would cause existing functionality to change) 16 | 17 | 18 | 19 | **What is the current behavior? (link to any open issues here)** 20 | 21 | 22 | 23 | **What is the new behavior (if this is a feature change)?** 24 | 25 | 26 | 27 | **Other information**: 28 | -------------------------------------------------------------------------------- /_config.yml: -------------------------------------------------------------------------------- 1 | theme: jekyll-theme-cayman -------------------------------------------------------------------------------- /bin/.gitignore: -------------------------------------------------------------------------------- 1 | badgerserver 2 | -------------------------------------------------------------------------------- /bin/common/nss_wrapper_env.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright 2021 - 2023 Crunchy Data Solutions, Inc. 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | # define nss_wrapper directory and passwd & group files that will be utilized by nss_wrapper 17 | NSS_WRAPPER_DIR="/tmp/nss_wrapper/${NSS_WRAPPER_SUBDIR}" 18 | NSS_WRAPPER_PASSWD="${NSS_WRAPPER_DIR}/passwd" 19 | NSS_WRAPPER_GROUP="${NSS_WRAPPER_DIR}/group" 20 | 21 | export LD_PRELOAD=/usr/lib64/libnss_wrapper.so 22 | export NSS_WRAPPER_PASSWD="${NSS_WRAPPER_PASSWD}" 23 | export NSS_WRAPPER_GROUP="${NSS_WRAPPER_GROUP}" 24 | -------------------------------------------------------------------------------- /bin/common/uid_daemon.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Copyright 2018 - 2023 Crunchy Data Solutions, Inc. 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | CRUNCHY_DIR=${CRUNCHY_DIR:-'/opt/crunchy'} 17 | 18 | export CRUNCHY_NSS_USERNAME="${USER_NAME:-default}" 19 | export CRUNCHY_NSS_USER_DESC="${USER_NAME:-default} user" 20 | 21 | source "${CRUNCHY_DIR}/bin/nss_wrapper.sh" 22 | 23 | exec "$@" 24 | -------------------------------------------------------------------------------- /bin/common/uid_postgres.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright 2018 - 2023 Crunchy Data Solutions, Inc. 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | CRUNCHY_DIR=${CRUNCHY_DIR:-'/opt/crunchy'} 17 | 18 | source "${CRUNCHY_DIR}/bin/uid_postgres_no_exec.sh" 19 | 20 | exec "$@" 21 | -------------------------------------------------------------------------------- /bin/common/uid_postgres_no_exec.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright 2019 - 2023 Crunchy Data Solutions, Inc. 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | CRUNCHY_DIR=${CRUNCHY_DIR:-'/opt/crunchy'} 17 | 18 | export CRUNCHY_NSS_USERNAME="${USER_NAME:-postgres}" 19 | export CRUNCHY_NSS_USER_DESC="PostgreSQL Server" 20 | 21 | source "${CRUNCHY_DIR}/bin/nss_wrapper.sh" 22 | -------------------------------------------------------------------------------- /bin/pgbackrest-repo/archive-push-gcs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright 2021 - 2023 Crunchy Data Solutions, Inc. 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | pgbackrest "$@" 17 | -------------------------------------------------------------------------------- /bin/pgbackrest-repo/archive-push-s3.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright 2020 - 2023 Crunchy Data Solutions, Inc. 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | pgbackrest "$@" 17 | -------------------------------------------------------------------------------- /bin/pgbackrest-repo/uid_pgbackrest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright 2020 - 2023 Crunchy Data Solutions, Inc. 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | CRUNCHY_DIR=${CRUNCHY_DIR:-'/opt/crunchy'} 17 | 18 | export CRUNCHY_NSS_USERNAME="${USER_NAME:-pgbackrest}" 19 | export CRUNCHY_NSS_USER_DESC="${USER_NAME:-pgbackrest} user" 20 | 21 | source "${CRUNCHY_DIR}/bin/nss_wrapper.sh" 22 | 23 | exec "$@" 24 | -------------------------------------------------------------------------------- /bin/pgbackrest/.gitignore: -------------------------------------------------------------------------------- 1 | pgbackrest 2 | -------------------------------------------------------------------------------- /bin/pgbouncer/.gitignore: -------------------------------------------------------------------------------- 1 | bounce 2 | kubectl 3 | oc 4 | -------------------------------------------------------------------------------- /bin/postgres-gis/setup.sql: -------------------------------------------------------------------------------- 1 | SET application_name="container_setup"; 2 | 3 | create extension postgis; 4 | create extension postgis_topology; 5 | create extension fuzzystrmatch; 6 | create extension postgis_tiger_geocoder; 7 | create extension pg_stat_statements; 8 | create extension pgaudit; 9 | 10 | alter user postgres password 'PG_ROOT_PASSWORD'; 11 | 12 | create user "PG_PRIMARY_USER" with REPLICATION PASSWORD 'PG_PRIMARY_PASSWORD'; 13 | create user "PG_USER" with password 'PG_PASSWORD'; 14 | 15 | create table primarytable (key varchar(20), value varchar(20)); 16 | grant all on primarytable to "PG_PRIMARY_USER"; 17 | 18 | create database "PG_DATABASE"; 19 | 20 | grant all privileges on database "PG_DATABASE" to "PG_USER"; 21 | 22 | \c "PG_DATABASE" 23 | 24 | create extension postgis; 25 | create extension postgis_topology; 26 | create extension fuzzystrmatch; 27 | create extension postgis_tiger_geocoder; 28 | create extension pg_stat_statements; 29 | create extension pgaudit; 30 | 31 | \c "PG_DATABASE" "PG_USER"; 32 | 33 | create schema "PG_USER"; 34 | -------------------------------------------------------------------------------- /bin/postgres_common/modules/pgaudit.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright 2016 - 2023 Crunchy Data Solutions, Inc. 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | CRUNCHY_DIR=${CRUNCHY_DIR:-'/opt/crunchy'} 17 | if [[ -v PGAUDIT_ANALYZE ]] 18 | then 19 | source "${CRUNCHY_DIR}/bin/common_lib.sh" 20 | echo_info "Applyed pgaudit module.." 21 | pgaudit_analyze ${PATRONI_POSTGRESQL_DATA_DIR:-$PGDATA}/pg_log --user=postgres --log-file /tmp/pgaudit_analyze.log & 22 | fi 23 | -------------------------------------------------------------------------------- /bin/postgres_common/postgres/.gitignore: -------------------------------------------------------------------------------- 1 | pgc 2 | -------------------------------------------------------------------------------- /bin/postgres_common/postgres/custom-configs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | CRUNCHY_DIR=${CRUNCHY_DIR:-'/opt/crunchy'} 4 | source "${CRUNCHY_DIR}/bin/common_lib.sh" 5 | enable_debugging 6 | 7 | function custom_config() { 8 | src=${1?} 9 | dest=${2?} 10 | mode=${3?} 11 | if [[ -f ${src?} ]] 12 | then 13 | echo_info "Custom ${src?} detected. Applying custom configuration.." 14 | 15 | cp ${src?} ${dest?} 16 | err_check "$?" "Applying custom configuration" "Could not copy ${src?} to ${dest?}" 17 | 18 | chmod ${mode?} ${dest?} 19 | err_check "$?" "Applying custom configuration" "Could not set mode ${mode?} on ${dest?}" 20 | fi 21 | } 22 | 23 | custom_config "/pgconf/postgresql.conf" "${PGDATA?}/postgresql.conf" 600 24 | custom_config "/pgconf/pg_hba.conf" "${PGDATA?}/pg_hba.conf" 600 25 | custom_config "/pgconf/pg_ident.conf" "${PGDATA?}/pg_ident.conf" 600 26 | custom_config "/pgconf/server.key" "${PGDATA?}/server.key" 600 27 | custom_config "/pgconf/server.crt" "${PGDATA?}/server.crt" 600 28 | custom_config "/pgconf/ca.crt" "${PGDATA?}/ca.crt" 600 29 | custom_config "/pgconf/ca.crl" "${PGDATA?}/ca.crl" 600 30 | -------------------------------------------------------------------------------- /bin/postgres_common/postgres/liveness.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright 2016 - 2023 Crunchy Data Solutions, Inc. 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | CRUNCHY_DIR=${CRUNCHY_DIR:-'/opt/crunchy'} 17 | source "${CRUNCHY_DIR}/bin/common_lib.sh" 18 | enable_debugging 19 | 20 | source "${CRUNCHY_DIR}/bin/postgres/setenv.sh" 21 | hostname=${HOSTNAME?} 22 | 23 | if [[ -v PGHOST ]] 24 | then 25 | hostname=${PGHOST} 26 | fi 27 | 28 | $PGROOT/bin/pg_isready -h ${hostname?} --port="${PG_PRIMARY_PORT}" --dbname=postgres --username=$PG_USER 29 | -------------------------------------------------------------------------------- /bin/postgres_common/postgres/pgbackrest_backup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright 2016 - 2023 Crunchy Data Solutions, Inc. 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | # This script is used by the Scheduler to run pgBackRest backups. 17 | 18 | set -e -u 19 | 20 | CRUNCHY_DIR=${CRUNCHY_DIR:-'/opt/crunchy'} 21 | source "${CRUNCHY_DIR}/bin/postgres/pgbackrest_env.sh" 22 | pgbackrest backup --type=${1?} 23 | 24 | exit 0 25 | -------------------------------------------------------------------------------- /bin/postgres_common/postgres/pgbackrest_env.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | pg_pid=$(pgrep -f "postgres -D /pgdata") 4 | echo pg_pid=${pg_pid} 5 | 6 | backrest_env_vars=$( tr '\0' '\n' < /proc/"${pg_pid}"/environ | grep PGBACKREST_ ) 7 | readarray -t backrest_env_var_arr <<< "${backrest_env_vars}" 8 | 9 | for env_var in "${!backrest_env_var_arr[@]}" 10 | do 11 | export "${backrest_env_var_arr[env_var]}" 12 | done 13 | -------------------------------------------------------------------------------- /bin/postgres_common/postgres/pgbackrest_info.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright 2019 - 2023 Crunchy Data Solutions, Inc. 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | source /tmp/pgbackrest_env.sh > /tmp/pgbackrest_env.stdout 2> /tmp/pgbackrest_env.stderr 17 | 18 | cmd_args=() 19 | # if TLS verification is disabled, pass in the appropriate flag 20 | # otherwise, leave the default behavior and verify TLS 21 | if [[ "${PGHA_PGBACKREST_S3_VERIFY_TLS}" == "false" ]] 22 | then 23 | cmd_args+=("--no-repo1-s3-verify-tls") 24 | fi 25 | 26 | echo $(echo -n "$conf|" | tr '/' '_'; pgbackrest --output=json ${cmd_args[*]} info | tr -d '\n') 27 | -------------------------------------------------------------------------------- /bin/postgres_common/postgres/promote.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright 2018 - 2023 Crunchy Data Solutions, Inc. 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | CRUNCHY_DIR=${CRUNCHY_DIR:-'/opt/crunchy'} 17 | source "${CRUNCHY_DIR}/bin/common_lib.sh" 18 | enable_debugging 19 | 20 | source "${CRUNCHY_DIR}/bin/postgres/setenv.sh" 21 | 22 | PGCTLTIMEOUT=${PG_CTL_PROMOTE_TIMEOUT} pg_ctl promote 23 | -------------------------------------------------------------------------------- /bin/postgres_common/postgres/readiness.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright 2016 - 2023 Crunchy Data Solutions, Inc. 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | CRUNCHY_DIR=${CRUNCHY_DIR:-'/opt/crunchy'} 17 | source "${CRUNCHY_DIR}/bin/common_lib.sh" 18 | enable_debugging 19 | source "${CRUNCHY_DIR}/bin/postgres/setenv.sh" 20 | 21 | $PGROOT/bin/psql -f "${CRUNCHY_DIR}/bin/postgres/readiness.sql" -U $PG_USER --port="${PG_PRIMARY_PORT}" postgres 22 | -------------------------------------------------------------------------------- /bin/postgres_common/postgres/readiness.sql: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 - 2023 Crunchy Data Solutions, Inc. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | select now(); 17 | -------------------------------------------------------------------------------- /bin/postgres_common/postgres/reload.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright 2018 - 2023 Crunchy Data Solutions, Inc. 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | CRUNCHY_DIR=${CRUNCHY_DIR:-'/opt/crunchy'} 17 | source "${CRUNCHY_DIR}/bin/common_lib.sh" 18 | enable_debugging 19 | 20 | source "${CRUNCHY_DIR}/bin/postgres/setenv.sh" 21 | pg_ctl reload 22 | -------------------------------------------------------------------------------- /bin/postgres_common/postgres/start-secrets.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright 2016 - 2023 Crunchy Data Solutions, Inc. 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | CRUNCHY_DIR=${CRUNCHY_DIR:-'/opt/crunchy'} 17 | source "${CRUNCHY_DIR}/bin/common_lib.sh" 18 | enable_debugging 19 | 20 | export PG_MODE=$PG_MODE 21 | export PG_PRIMARY_HOST=$PG_PRIMARY_HOST 22 | export PG_PRIMARY_PORT=$PG_PRIMARY_PORT 23 | export PG_PRIMARY_USER=$PG_PRIMARY_USER 24 | export PG_PRIMARY_PASSWORD=$PG_PRIMARY_PASSWORD 25 | export PG_USER=$PG_USER 26 | export PG_PASSWORD=$PG_PASSWORD 27 | export PG_DATABASE=$PG_DATABASE 28 | export PG_ROOT_PASSWORD=$PG_ROOT_PASSWORD 29 | 30 | source "${CRUNCHY_DIR}/bin/postgres/setenv.sh" 31 | 32 | -------------------------------------------------------------------------------- /bin/postgres_common/sqlrunner/start.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright 2019 - 2023 Crunchy Data Solutions, Inc. 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | set -e -u 17 | 18 | for sql in /pgconf/*.sql 19 | do 20 | PGPASSWORD="${PG_PASSWORD?}" psql -d ${PG_DATABASE?} -U ${PG_USER?} \ 21 | -p ${PG_PORT?} -h ${PG_HOST?} \ 22 | -f ${sql?} 23 | done 24 | 25 | exit 0 26 | -------------------------------------------------------------------------------- /bin/remove-all-images.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright 2016 - 2023 Crunchy Data Solutions, Inc. 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permi -fssions and 14 | # limitations under the License. 15 | 16 | # pgadmin4 pgbadger pgpool 17 | for i in \ 18 | postgres-gis postgres pgbouncer upgrade 19 | do 20 | docker rmi -f $CCP_IMAGE_PREFIX/crunchy-$i:$CCP_IMAGE_TAG 21 | docker rmi -f crunchy-$i 22 | done 23 | 24 | exit 25 | -------------------------------------------------------------------------------- /bin/setenv.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright 2016 - 2023 Crunchy Data Solutions, Inc. 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | CRUNCHY_DIR=${CRUNCHY_DIR:-'/opt/crunchy'} 17 | source "${CRUNCHY_DIR}/bin/common_lib.sh" 18 | 19 | enable_debugging 20 | 21 | export PGROOT=$(find /usr/ -type d -name 'pgsql-*') 22 | 23 | echo_info "Setting PGROOT to ${PGROOT?}." 24 | 25 | export PGDATA=/pgdata/$HOSTNAME 26 | export PATH="${CRUMCHY_DIR}/bin:$PGROOT/bin:$PATH" 27 | export LD_LIBRARY_PATH=$PGROOT/lib 28 | 29 | #chown postgres $PGDATA 30 | -------------------------------------------------------------------------------- /btn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CrunchyData/crunchy-containers/c7398a94d2419a05172b16d977c07f8794b62288/btn.png -------------------------------------------------------------------------------- /build/base-ext/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG BASEOS 2 | ARG BASEVER 3 | ARG PG_FULL 4 | ARG PREFIX 5 | FROM ${PREFIX}/crunchy-base:${BASEOS}-${PG_FULL}-${BASEVER} 6 | 7 | # For RHEL8 all arguments used in main code has to be specified after FROM 8 | ARG BASEOS 9 | ARG PACKAGER 10 | 11 | LABEL name="crunchy-base-ext" \ 12 | summary="Includes base extensions required to load in additional PostgreSQL extensions." \ 13 | description="Includes base extensions required to load in additional PostgreSQL extensions." 14 | 15 | RUN if [ "$BASEOS" = "centos8" ] ; then \ 16 | ${PACKAGER} -y install --nodocs \ 17 | --setopt=skip_missing_names_on_install=False \ 18 | --enablerepo="powertools" \ 19 | perl \ 20 | && ${PACKAGER} -y clean all ; \ 21 | fi 22 | 23 | RUN if [ "$BASEOS" = "ubi8" ] ; then \ 24 | ${PACKAGER} -y --enablerepo="epel" --enablerepo="codeready-builder-for-rhel-8-x86_64-rpms" --nodocs install libaec libdap armadillo \ 25 | && ${PACKAGER} -y install --nodocs \ 26 | --enablerepo="epel" \ 27 | hdf5 \ 28 | openldap \ 29 | perl \ 30 | && ${PACKAGER} -y clean all --enablerepo="epel" --enablerepo="codeready-builder-for-rhel-8-x86_64-rpms" ; \ 31 | fi 32 | -------------------------------------------------------------------------------- /conf/.gitignore: -------------------------------------------------------------------------------- 1 | *.repo 2 | *.public 3 | *.private 4 | *KEY* 5 | -------------------------------------------------------------------------------- /conf/backrest/group.template: -------------------------------------------------------------------------------- 1 | root:x:0: 2 | bin:x:1: 3 | daemon:x:2: 4 | sys:x:3: 5 | adm:x:4: 6 | tty:x:5: 7 | disk:x:6: 8 | lp:x:7: 9 | mem:x:8: 10 | kmem:x:9: 11 | wheel:x:10: 12 | cdrom:x:11: 13 | mail:x:12: 14 | man:x:15: 15 | dialout:x:18: 16 | floppy:x:19: 17 | games:x:20: 18 | tape:x:30: 19 | video:x:39: 20 | ftp:x:50: 21 | lock:x:54: 22 | audio:x:63: 23 | nobody:x:99: 24 | users:x:100: 25 | utmp:x:22: 26 | utempter:x:35: 27 | input:x:999: 28 | systemd-journal:x:190: 29 | systemd-network:x:192: 30 | dbus:x:81: 31 | ssh_keys:x:998: 32 | nfsnobody:x:65534: 33 | postgres:x:${USER_ID}:postgres 34 | -------------------------------------------------------------------------------- /conf/backrest/passwd.template: -------------------------------------------------------------------------------- 1 | root:x:0:0:root:/root:/bin/bash 2 | bin:x:1:1:bin:/bin:/sbin/nologin 3 | daemon:x:2:2:daemon:/sbin:/sbin/nologin 4 | adm:x:3:4:adm:/var/adm:/sbin/nologin 5 | lp:x:4:7:lp:/var/spool/lpd:/sbin/nologin 6 | sync:x:5:0:sync:/sbin:/bin/sync 7 | shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown 8 | halt:x:7:0:halt:/sbin:/sbin/halt 9 | mail:x:8:12:mail:/var/spool/mail:/sbin/nologin 10 | operator:x:11:0:operator:/root:/sbin/nologin 11 | games:x:12:100:games:/usr/games:/sbin/nologin 12 | ftp:x:14:50:FTP User:/var/ftp:/sbin/nologin 13 | nobody:x:99:99:Nobody:/:/sbin/nologin 14 | postgres:x:${USER_ID}:${GROUP_ID}:PostgreSQL Server:${HOME}:/bin/bash 15 | -------------------------------------------------------------------------------- /conf/collect/group.template: -------------------------------------------------------------------------------- 1 | root:x:0: 2 | bin:x:1: 3 | daemon:x:2: 4 | sys:x:3: 5 | adm:x:4: 6 | tty:x:5: 7 | disk:x:6: 8 | lp:x:7: 9 | mem:x:8: 10 | kmem:x:9: 11 | wheel:x:10: 12 | cdrom:x:11: 13 | mail:x:12: 14 | man:x:15: 15 | dialout:x:18: 16 | floppy:x:19: 17 | games:x:20: 18 | tape:x:30: 19 | video:x:39: 20 | ftp:x:50: 21 | lock:x:54: 22 | audio:x:63: 23 | nobody:x:99: 24 | users:x:100: 25 | utmp:x:22: 26 | utempter:x:35: 27 | input:x:999: 28 | systemd-journal:x:190: 29 | systemd-network:x:192: 30 | dbus:x:81: 31 | ssh_keys:x:998: 32 | nfsnobody:x:65534: 33 | daemon:x:${USER_ID}:daemon 34 | -------------------------------------------------------------------------------- /conf/collect/passwd.template: -------------------------------------------------------------------------------- 1 | root:x:0:0:root:/root:/bin/bash 2 | bin:x:1:1:bin:/bin:/sbin/nologin 3 | adm:x:3:4:adm:/var/adm:/sbin/nologin 4 | lp:x:4:7:lp:/var/spool/lpd:/sbin/nologin 5 | sync:x:5:0:sync:/sbin:/bin/sync 6 | shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown 7 | halt:x:7:0:halt:/sbin:/sbin/halt 8 | mail:x:8:12:mail:/var/spool/mail:/sbin/nologin 9 | operator:x:11:0:operator:/root:/sbin/nologin 10 | games:x:12:100:games:/usr/games:/sbin/nologin 11 | ftp:x:14:50:FTP User:/var/ftp:/sbin/nologin 12 | nobody:x:99:99:Nobody:/:/sbin/nologin 13 | daemon:x:${USER_ID}:${GROUP_ID}:daemon:/sbin:/sbin/nologin 14 | -------------------------------------------------------------------------------- /conf/demo-namespace.json: -------------------------------------------------------------------------------- 1 | { 2 | "kind": "Namespace", 3 | "apiVersion": "v1", 4 | "metadata": { 5 | "name": "demo", 6 | "labels": { 7 | "name": "demo" 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /conf/node-exporter/group.template: -------------------------------------------------------------------------------- 1 | root:x:0: 2 | bin:x:1: 3 | daemon:x:2: 4 | sys:x:3: 5 | adm:x:4: 6 | tty:x:5: 7 | disk:x:6: 8 | lp:x:7: 9 | mem:x:8: 10 | kmem:x:9: 11 | wheel:x:10: 12 | cdrom:x:11: 13 | mail:x:12: 14 | man:x:15: 15 | dialout:x:18: 16 | floppy:x:19: 17 | games:x:20: 18 | tape:x:30: 19 | video:x:39: 20 | ftp:x:50: 21 | lock:x:54: 22 | audio:x:63: 23 | nobody:x:99: 24 | users:x:100: 25 | utmp:x:22: 26 | utempter:x:35: 27 | input:x:999: 28 | systemd-journal:x:190: 29 | systemd-network:x:192: 30 | dbus:x:81: 31 | ssh_keys:x:998: 32 | nfsnobody:x:65534: 33 | daemon:x:${USER_ID}:daemon 34 | -------------------------------------------------------------------------------- /conf/node-exporter/passwd.template: -------------------------------------------------------------------------------- 1 | root:x:0:0:root:/root:/bin/bash 2 | bin:x:1:1:bin:/bin:/sbin/nologin 3 | adm:x:3:4:adm:/var/adm:/sbin/nologin 4 | lp:x:4:7:lp:/var/spool/lpd:/sbin/nologin 5 | sync:x:5:0:sync:/sbin:/bin/sync 6 | shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown 7 | halt:x:7:0:halt:/sbin:/sbin/halt 8 | mail:x:8:12:mail:/var/spool/mail:/sbin/nologin 9 | operator:x:11:0:operator:/root:/sbin/nologin 10 | games:x:12:100:games:/usr/games:/sbin/nologin 11 | ftp:x:14:50:FTP User:/var/ftp:/sbin/nologin 12 | nobody:x:99:99:Nobody:/:/sbin/nologin 13 | daemon:x:${USER_ID}:${GROUP_ID}:daemon:/sbin:/sbin/nologin 14 | -------------------------------------------------------------------------------- /conf/pgadmin4/config_local.py: -------------------------------------------------------------------------------- 1 | # overides for containerized compatibility of pgAdmin4 2 | 3 | # pgAdmin4 should be accessible publicly 4 | DEFAULT_SERVER = '0.0.0.0' 5 | 6 | # this is the default pgAdmin4 port, but this is left here for someone who wants 7 | # to override the default port 8 | DEFAULT_SERVER_PORT = 5050 9 | 10 | # this is the path to the local pgadmin4 database; this is part of the persisted 11 | # volume 12 | SQLITE_PATH = '/var/lib/pgadmin/pgadmin4.db' 13 | 14 | # this is the path to the local pgadmin4 sessions database; this is part of the 15 | # persisted volume 16 | SESSION_DB_PATH = '/var/lib/pgadmin/sessions' 17 | 18 | # this is the path to the local pgadmin4 storage; this is part of the persisted 19 | # volume 20 | STORAGE_DIR = '/var/lib/pgadmin/storage' 21 | 22 | # this allows for the default PostgreSQL binary path to be overwritten with the 23 | # directory that is in the container 24 | DEFAULT_BINARY_PATHS = { 25 | "pg": "", 26 | } 27 | -------------------------------------------------------------------------------- /conf/pgadmin4/group.template: -------------------------------------------------------------------------------- 1 | root:x:0: 2 | bin:x:1: 3 | daemon:x:2: 4 | sys:x:3: 5 | adm:x:4: 6 | tty:x:5: 7 | disk:x:6: 8 | lp:x:7: 9 | mem:x:8: 10 | kmem:x:9: 11 | wheel:x:10: 12 | cdrom:x:11: 13 | mail:x:12: 14 | man:x:15: 15 | dialout:x:18: 16 | floppy:x:19: 17 | games:x:20: 18 | tape:x:30: 19 | video:x:39: 20 | ftp:x:50: 21 | lock:x:54: 22 | audio:x:63: 23 | nobody:x:99: 24 | users:x:100: 25 | utmp:x:22: 26 | utempter:x:35: 27 | input:x:999: 28 | systemd-journal:x:190: 29 | systemd-network:x:192: 30 | dbus:x:81: 31 | ssh_keys:x:998: 32 | nfsnobody:x:65534: 33 | daemon:x:${USER_ID}:daemon 34 | -------------------------------------------------------------------------------- /conf/pgadmin4/passwd.template: -------------------------------------------------------------------------------- 1 | root:x:0:0:root:/root:/bin/bash 2 | bin:x:1:1:bin:/bin:/sbin/nologin 3 | adm:x:3:4:adm:/var/adm:/sbin/nologin 4 | lp:x:4:7:lp:/var/spool/lpd:/sbin/nologin 5 | sync:x:5:0:sync:/sbin:/bin/sync 6 | shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown 7 | halt:x:7:0:halt:/sbin:/sbin/halt 8 | mail:x:8:12:mail:/var/spool/mail:/sbin/nologin 9 | operator:x:11:0:operator:/root:/sbin/nologin 10 | games:x:12:100:games:/usr/games:/sbin/nologin 11 | ftp:x:14:50:FTP User:/var/ftp:/sbin/nologin 12 | nobody:x:99:99:Nobody:/:/sbin/nologin 13 | daemon:x:${USER_ID}:${GROUP_ID}:daemon:/sbin:/sbin/nologin 14 | -------------------------------------------------------------------------------- /conf/pgadmin4/pgadmin-http.conf: -------------------------------------------------------------------------------- 1 | 2 | LoadModule wsgi_module modules/mod_wsgi.so 3 | WSGIDaemonProcess pgadmin processes=1 threads=25 4 | WSGIScriptAlias SERVER_PATH /usr/lib/python3.6/site-packages/pgadmin4-web/pgAdmin4.wsgi 5 | 6 | 7 | WSGIProcessGroup pgadmin 8 | WSGIApplicationGroup %{GLOBAL} 9 | WSGIScriptReloading On 10 | WSGIPassAuthorization On 11 | 12 | # Apache 2.4 13 | Require all granted 14 | 15 | 16 | # Apache 2.2 17 | Order Deny,Allow 18 | Deny from All 19 | Allow from 127.0.0.1 20 | Allow from ::1 21 | 22 | 23 | 24 | RedirectMatch ^/$ SERVER_PATH 25 | 26 | -------------------------------------------------------------------------------- /conf/pgadmin4/pgadmin-https.conf: -------------------------------------------------------------------------------- 1 | 2 | 3 | LoadModule ssl_module modules/mod_ssl.so 4 | LoadModule wsgi_module modules/mod_wsgi.so 5 | 6 | SSLEngine on 7 | SSLCipherSuite HIGH:!aNULL:!MD5 8 | SSLProtocol +TLSv1.2 9 | SSLCertificateFile "/certs/server.crt" 10 | SSLCertificateKeyFile "/certs/server.key" 11 | 12 | WSGIDaemonProcess pgadmin processes=1 threads=25 13 | WSGIScriptAlias SERVER_PATH /usr/lib/python3.6/site-packages/pgadmin4-web/pgAdmin4.wsgi 14 | 15 | 16 | WSGIProcessGroup pgadmin 17 | WSGIApplicationGroup %{GLOBAL} 18 | 19 | # Apache 2.4 20 | Require all granted 21 | 22 | 23 | # Apache 2.2 24 | Order Deny,Allow 25 | Deny from All 26 | Allow from 127.0.0.1 27 | Allow from ::1 28 | 29 | 30 | 31 | RedirectMatch ^/$ SERVER_PATH 32 | 33 | -------------------------------------------------------------------------------- /conf/pgbackrest-repo/.gitignore: -------------------------------------------------------------------------------- 1 | authorized_keys 2 | id_rsa 3 | id_rsa.pub 4 | ssh_host_ecdsa_key 5 | ssh_host_ecdsa_key.pub 6 | ssh_host_ed25519_key 7 | ssh_host_ed25519_key.pub 8 | ssh_host_rsa_key 9 | ssh_host_rsa_key.pub 10 | -------------------------------------------------------------------------------- /conf/pgbackrest-repo/aws-s3-credentials.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | aws-s3-key: 3 | aws-s3-key-secret: 4 | gcs-key: 5 | -------------------------------------------------------------------------------- /conf/pgbackrest-restore/group.template: -------------------------------------------------------------------------------- 1 | root:x:0: 2 | bin:x:1: 3 | daemon:x:2: 4 | sys:x:3: 5 | adm:x:4: 6 | tty:x:5: 7 | disk:x:6: 8 | lp:x:7: 9 | mem:x:8: 10 | kmem:x:9: 11 | wheel:x:10: 12 | cdrom:x:11: 13 | mail:x:12: 14 | man:x:15: 15 | dialout:x:18: 16 | floppy:x:19: 17 | games:x:20: 18 | tape:x:30: 19 | video:x:39: 20 | ftp:x:50: 21 | lock:x:54: 22 | audio:x:63: 23 | nobody:x:99: 24 | users:x:100: 25 | utmp:x:22: 26 | utempter:x:35: 27 | input:x:999: 28 | systemd-journal:x:190: 29 | systemd-network:x:192: 30 | dbus:x:81: 31 | ssh_keys:x:998: 32 | nfsnobody:x:65534: 33 | postgres:x:${USER_ID}:postgres 34 | -------------------------------------------------------------------------------- /conf/pgbackrest-restore/passwd.template: -------------------------------------------------------------------------------- 1 | root:x:0:0:root:/root:/bin/bash 2 | bin:x:1:1:bin:/bin:/sbin/nologin 3 | daemon:x:2:2:daemon:/sbin:/sbin/nologin 4 | adm:x:3:4:adm:/var/adm:/sbin/nologin 5 | lp:x:4:7:lp:/var/spool/lpd:/sbin/nologin 6 | sync:x:5:0:sync:/sbin:/bin/sync 7 | shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown 8 | halt:x:7:0:halt:/sbin:/sbin/halt 9 | mail:x:8:12:mail:/var/spool/mail:/sbin/nologin 10 | operator:x:11:0:operator:/root:/sbin/nologin 11 | games:x:12:100:games:/usr/games:/sbin/nologin 12 | ftp:x:14:50:FTP User:/var/ftp:/sbin/nologin 13 | nobody:x:99:99:Nobody:/:/sbin/nologin 14 | postgres:x:${USER_ID}:${GROUP_ID}:PostgreSQL Server:${HOME}:/bin/bash 15 | -------------------------------------------------------------------------------- /conf/pgbadger/group.template: -------------------------------------------------------------------------------- 1 | root:x:0: 2 | bin:x:1: 3 | daemon:x:2: 4 | sys:x:3: 5 | adm:x:4: 6 | tty:x:5: 7 | disk:x:6: 8 | lp:x:7: 9 | mem:x:8: 10 | kmem:x:9: 11 | wheel:x:10: 12 | cdrom:x:11: 13 | mail:x:12: 14 | man:x:15: 15 | dialout:x:18: 16 | floppy:x:19: 17 | games:x:20: 18 | tape:x:30: 19 | video:x:39: 20 | ftp:x:50: 21 | lock:x:54: 22 | audio:x:63: 23 | nobody:x:99: 24 | users:x:100: 25 | utmp:x:22: 26 | utempter:x:35: 27 | input:x:999: 28 | systemd-journal:x:190: 29 | systemd-network:x:192: 30 | dbus:x:81: 31 | ssh_keys:x:998: 32 | nfsnobody:x:65534: 33 | postgres:x:${USER_ID}:postgres 34 | -------------------------------------------------------------------------------- /conf/pgbadger/passwd.template: -------------------------------------------------------------------------------- 1 | root:x:0:0:root:/root:/bin/bash 2 | bin:x:1:1:bin:/bin:/sbin/nologin 3 | daemon:x:2:2:daemon:/sbin:/sbin/nologin 4 | adm:x:3:4:adm:/var/adm:/sbin/nologin 5 | lp:x:4:7:lp:/var/spool/lpd:/sbin/nologin 6 | sync:x:5:0:sync:/sbin:/bin/sync 7 | shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown 8 | halt:x:7:0:halt:/sbin:/sbin/halt 9 | mail:x:8:12:mail:/var/spool/mail:/sbin/nologin 10 | operator:x:11:0:operator:/root:/sbin/nologin 11 | games:x:12:100:games:/usr/games:/sbin/nologin 12 | ftp:x:14:50:FTP User:/var/ftp:/sbin/nologin 13 | nobody:x:99:99:Nobody:/:/sbin/nologin 14 | postgres:x:${USER_ID}:${GROUP_ID}:PostgreSQL Server:${HOME}:/bin/bash 15 | -------------------------------------------------------------------------------- /conf/pgbouncer/group.template: -------------------------------------------------------------------------------- 1 | root:x:0: 2 | bin:x:1: 3 | daemon:x:2: 4 | sys:x:3: 5 | adm:x:4: 6 | tty:x:5: 7 | disk:x:6: 8 | lp:x:7: 9 | mem:x:8: 10 | kmem:x:9: 11 | wheel:x:10: 12 | cdrom:x:11: 13 | mail:x:12: 14 | man:x:15: 15 | dialout:x:18: 16 | floppy:x:19: 17 | games:x:20: 18 | tape:x:30: 19 | video:x:39: 20 | ftp:x:50: 21 | lock:x:54: 22 | audio:x:63: 23 | nobody:x:99: 24 | users:x:100: 25 | utmp:x:22: 26 | utempter:x:35: 27 | input:x:999: 28 | systemd-journal:x:190: 29 | systemd-network:x:192: 30 | dbus:x:81: 31 | ssh_keys:x:998: 32 | nfsnobody:x:65534: 33 | daemon:x:${USER_ID}:daemon 34 | -------------------------------------------------------------------------------- /conf/pgbouncer/passwd.template: -------------------------------------------------------------------------------- 1 | root:x:0:0:root:/root:/bin/bash 2 | bin:x:1:1:bin:/bin:/sbin/nologin 3 | adm:x:3:4:adm:/var/adm:/sbin/nologin 4 | lp:x:4:7:lp:/var/spool/lpd:/sbin/nologin 5 | sync:x:5:0:sync:/sbin:/bin/sync 6 | shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown 7 | halt:x:7:0:halt:/sbin:/sbin/halt 8 | mail:x:8:12:mail:/var/spool/mail:/sbin/nologin 9 | operator:x:11:0:operator:/root:/sbin/nologin 10 | games:x:12:100:games:/usr/games:/sbin/nologin 11 | ftp:x:14:50:FTP User:/var/ftp:/sbin/nologin 12 | nobody:x:99:99:Nobody:/:/sbin/nologin 13 | daemon:x:${USER_ID}:${GROUP_ID}:daemon:/sbin:/sbin/nologin 14 | -------------------------------------------------------------------------------- /conf/pgbouncer/pgbouncer.ini: -------------------------------------------------------------------------------- 1 | [databases] 2 | * = host=PG_SERVICE port=PG_PORT auth_user=pgbouncer 3 | 4 | [pgbouncer] 5 | listen_port = 6432 6 | listen_addr = * 7 | auth_type = md5 8 | auth_file = /pgconf/users.txt 9 | auth_query = SELECT username, password from pgbouncer.get_auth($1) 10 | pidfile = /tmp/pgbouncer.pid 11 | logfile = /dev/stdout 12 | admin_users = pgbouncer 13 | stats_users = pgbouncer 14 | default_pool_size = DEFAULT_POOL_SIZE 15 | max_client_conn = MAX_CLIENT_CONN 16 | max_db_connections = MAX_DB_CONNECTIONS 17 | min_pool_size = MIN_POOL_SIZE 18 | pool_mode = POOL_MODE 19 | reserve_pool_size = RESERVE_POOL_SIZE 20 | reserve_pool_timeout = RESERVE_POOL_TIMEOUT 21 | query_timeout = QUERY_TIMEOUT 22 | ignore_startup_parameters = IGNORE_STARTUP_PARAMETERS 23 | -------------------------------------------------------------------------------- /conf/pgbouncer/users.txt: -------------------------------------------------------------------------------- 1 | "pgbouncer" "PGBOUNCER_PASSWORD" 2 | -------------------------------------------------------------------------------- /conf/pgpool/group.template: -------------------------------------------------------------------------------- 1 | root:x:0: 2 | bin:x:1: 3 | daemon:x:2: 4 | sys:x:3: 5 | adm:x:4: 6 | tty:x:5: 7 | disk:x:6: 8 | lp:x:7: 9 | mem:x:8: 10 | kmem:x:9: 11 | wheel:x:10: 12 | cdrom:x:11: 13 | mail:x:12: 14 | man:x:15: 15 | dialout:x:18: 16 | floppy:x:19: 17 | games:x:20: 18 | tape:x:30: 19 | video:x:39: 20 | ftp:x:50: 21 | lock:x:54: 22 | audio:x:63: 23 | nobody:x:99: 24 | users:x:100: 25 | utmp:x:22: 26 | utempter:x:35: 27 | input:x:999: 28 | systemd-journal:x:190: 29 | systemd-network:x:192: 30 | dbus:x:81: 31 | ssh_keys:x:998: 32 | nfsnobody:x:65534: 33 | daemon:x:${USER_ID}:daemon 34 | -------------------------------------------------------------------------------- /conf/pgpool/passwd.template: -------------------------------------------------------------------------------- 1 | root:x:0:0:root:/root:/bin/bash 2 | bin:x:1:1:bin:/bin:/sbin/nologin 3 | adm:x:3:4:adm:/var/adm:/sbin/nologin 4 | lp:x:4:7:lp:/var/spool/lpd:/sbin/nologin 5 | sync:x:5:0:sync:/sbin:/bin/sync 6 | shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown 7 | halt:x:7:0:halt:/sbin:/sbin/halt 8 | mail:x:8:12:mail:/var/spool/mail:/sbin/nologin 9 | operator:x:11:0:operator:/root:/sbin/nologin 10 | games:x:12:100:games:/usr/games:/sbin/nologin 11 | ftp:x:14:50:FTP User:/var/ftp:/sbin/nologin 12 | nobody:x:99:99:Nobody:/:/sbin/nologin 13 | daemon:x:${USER_ID}:${GROUP_ID}:daemon:/sbin:/sbin/nologin 14 | -------------------------------------------------------------------------------- /conf/pgpool/pool_passwd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CrunchyData/crunchy-containers/c7398a94d2419a05172b16d977c07f8794b62288/conf/pgpool/pool_passwd -------------------------------------------------------------------------------- /conf/postgres_common/backup/group.template: -------------------------------------------------------------------------------- 1 | root:x:0: 2 | bin:x:1: 3 | daemon:x:2: 4 | sys:x:3: 5 | adm:x:4: 6 | tty:x:5: 7 | disk:x:6: 8 | lp:x:7: 9 | mem:x:8: 10 | kmem:x:9: 11 | wheel:x:10: 12 | cdrom:x:11: 13 | mail:x:12: 14 | man:x:15: 15 | dialout:x:18: 16 | floppy:x:19: 17 | games:x:20: 18 | tape:x:30: 19 | video:x:39: 20 | ftp:x:50: 21 | lock:x:54: 22 | audio:x:63: 23 | nobody:x:99: 24 | users:x:100: 25 | utmp:x:22: 26 | utempter:x:35: 27 | input:x:999: 28 | systemd-journal:x:190: 29 | systemd-network:x:192: 30 | dbus:x:81: 31 | ssh_keys:x:998: 32 | nfsnobody:x:65534: 33 | postgres:x:${USER_ID}:postgres 34 | -------------------------------------------------------------------------------- /conf/postgres_common/backup/passwd.template: -------------------------------------------------------------------------------- 1 | root:x:0:0:root:/root:/bin/bash 2 | bin:x:1:1:bin:/bin:/sbin/nologin 3 | daemon:x:2:2:daemon:/sbin:/sbin/nologin 4 | adm:x:3:4:adm:/var/adm:/sbin/nologin 5 | lp:x:4:7:lp:/var/spool/lpd:/sbin/nologin 6 | sync:x:5:0:sync:/sbin:/bin/sync 7 | shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown 8 | halt:x:7:0:halt:/sbin:/sbin/halt 9 | mail:x:8:12:mail:/var/spool/mail:/sbin/nologin 10 | operator:x:11:0:operator:/root:/sbin/nologin 11 | games:x:12:100:games:/usr/games:/sbin/nologin 12 | ftp:x:14:50:FTP User:/var/ftp:/sbin/nologin 13 | nobody:x:99:99:Nobody:/:/sbin/nologin 14 | postgres:x:${USER_ID}:${GROUP_ID}:PostgreSQL Server:${HOME}:/bin/bash 15 | -------------------------------------------------------------------------------- /conf/postgres_common/pgbench/group.template: -------------------------------------------------------------------------------- 1 | root:x:0: 2 | bin:x:1: 3 | daemon:x:2: 4 | sys:x:3: 5 | adm:x:4: 6 | tty:x:5: 7 | disk:x:6: 8 | lp:x:7: 9 | mem:x:8: 10 | kmem:x:9: 11 | wheel:x:10: 12 | cdrom:x:11: 13 | mail:x:12: 14 | man:x:15: 15 | dialout:x:18: 16 | floppy:x:19: 17 | games:x:20: 18 | tape:x:30: 19 | video:x:39: 20 | ftp:x:50: 21 | lock:x:54: 22 | audio:x:63: 23 | nobody:x:99: 24 | users:x:100: 25 | utmp:x:22: 26 | utempter:x:35: 27 | input:x:999: 28 | systemd-journal:x:190: 29 | systemd-network:x:192: 30 | dbus:x:81: 31 | ssh_keys:x:998: 32 | nfsnobody:x:65534: 33 | postgres:x:${USER_ID}:postgres 34 | -------------------------------------------------------------------------------- /conf/postgres_common/pgbench/passwd.template: -------------------------------------------------------------------------------- 1 | root:x:0:0:root:/root:/bin/bash 2 | bin:x:1:1:bin:/bin:/sbin/nologin 3 | daemon:x:2:2:daemon:/sbin:/sbin/nologin 4 | adm:x:3:4:adm:/var/adm:/sbin/nologin 5 | lp:x:4:7:lp:/var/spool/lpd:/sbin/nologin 6 | sync:x:5:0:sync:/sbin:/bin/sync 7 | shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown 8 | halt:x:7:0:halt:/sbin:/sbin/halt 9 | mail:x:8:12:mail:/var/spool/mail:/sbin/nologin 10 | operator:x:11:0:operator:/root:/sbin/nologin 11 | games:x:12:100:games:/usr/games:/sbin/nologin 12 | ftp:x:14:50:FTP User:/var/ftp:/sbin/nologin 13 | nobody:x:99:99:Nobody:/:/sbin/nologin 14 | postgres:x:${USER_ID}:${GROUP_ID}:PostgreSQL Server:${HOME}:/bin/bash 15 | -------------------------------------------------------------------------------- /conf/postgres_common/pgdump/group.template: -------------------------------------------------------------------------------- 1 | root:x:0: 2 | bin:x:1: 3 | daemon:x:2: 4 | sys:x:3: 5 | adm:x:4: 6 | tty:x:5: 7 | disk:x:6: 8 | lp:x:7: 9 | mem:x:8: 10 | kmem:x:9: 11 | wheel:x:10: 12 | cdrom:x:11: 13 | mail:x:12: 14 | man:x:15: 15 | dialout:x:18: 16 | floppy:x:19: 17 | games:x:20: 18 | tape:x:30: 19 | video:x:39: 20 | ftp:x:50: 21 | lock:x:54: 22 | audio:x:63: 23 | nobody:x:99: 24 | users:x:100: 25 | utmp:x:22: 26 | utempter:x:35: 27 | input:x:999: 28 | systemd-journal:x:190: 29 | systemd-network:x:192: 30 | dbus:x:81: 31 | ssh_keys:x:998: 32 | nfsnobody:x:65534: 33 | postgres:x:${USER_ID}:postgres 34 | -------------------------------------------------------------------------------- /conf/postgres_common/pgdump/passwd.template: -------------------------------------------------------------------------------- 1 | root:x:0:0:root:/root:/bin/bash 2 | bin:x:1:1:bin:/bin:/sbin/nologin 3 | daemon:x:2:2:daemon:/sbin:/sbin/nologin 4 | adm:x:3:4:adm:/var/adm:/sbin/nologin 5 | lp:x:4:7:lp:/var/spool/lpd:/sbin/nologin 6 | sync:x:5:0:sync:/sbin:/bin/sync 7 | shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown 8 | halt:x:7:0:halt:/sbin:/sbin/halt 9 | mail:x:8:12:mail:/var/spool/mail:/sbin/nologin 10 | operator:x:11:0:operator:/root:/sbin/nologin 11 | games:x:12:100:games:/usr/games:/sbin/nologin 12 | ftp:x:14:50:FTP User:/var/ftp:/sbin/nologin 13 | nobody:x:99:99:Nobody:/:/sbin/nologin 14 | postgres:x:${USER_ID}:${GROUP_ID}:PostgreSQL Server:${HOME}:/bin/bash 15 | -------------------------------------------------------------------------------- /conf/postgres_common/pgrestore/group.template: -------------------------------------------------------------------------------- 1 | root:x:0: 2 | bin:x:1: 3 | daemon:x:2: 4 | sys:x:3: 5 | adm:x:4: 6 | tty:x:5: 7 | disk:x:6: 8 | lp:x:7: 9 | mem:x:8: 10 | kmem:x:9: 11 | wheel:x:10: 12 | cdrom:x:11: 13 | mail:x:12: 14 | man:x:15: 15 | dialout:x:18: 16 | floppy:x:19: 17 | games:x:20: 18 | tape:x:30: 19 | video:x:39: 20 | ftp:x:50: 21 | lock:x:54: 22 | audio:x:63: 23 | nobody:x:99: 24 | users:x:100: 25 | utmp:x:22: 26 | utempter:x:35: 27 | input:x:999: 28 | systemd-journal:x:190: 29 | systemd-network:x:192: 30 | dbus:x:81: 31 | ssh_keys:x:998: 32 | nfsnobody:x:65534: 33 | postgres:x:${USER_ID}:postgres 34 | -------------------------------------------------------------------------------- /conf/postgres_common/pgrestore/passwd.template: -------------------------------------------------------------------------------- 1 | root:x:0:0:root:/root:/bin/bash 2 | bin:x:1:1:bin:/bin:/sbin/nologin 3 | daemon:x:2:2:daemon:/sbin:/sbin/nologin 4 | adm:x:3:4:adm:/var/adm:/sbin/nologin 5 | lp:x:4:7:lp:/var/spool/lpd:/sbin/nologin 6 | sync:x:5:0:sync:/sbin:/bin/sync 7 | shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown 8 | halt:x:7:0:halt:/sbin:/sbin/halt 9 | mail:x:8:12:mail:/var/spool/mail:/sbin/nologin 10 | operator:x:11:0:operator:/root:/sbin/nologin 11 | games:x:12:100:games:/usr/games:/sbin/nologin 12 | ftp:x:14:50:FTP User:/var/ftp:/sbin/nologin 13 | nobody:x:99:99:Nobody:/:/sbin/nologin 14 | postgres:x:${USER_ID}:${GROUP_ID}:PostgreSQL Server:${HOME}:/bin/bash 15 | -------------------------------------------------------------------------------- /conf/postgres_common/postgres/archive-command: -------------------------------------------------------------------------------- 1 | archive_command = 'test ! -f $PGWAL/%f && cp %p $PGWAL/%f' 2 | -------------------------------------------------------------------------------- /conf/postgres_common/postgres/backrest-archive-command: -------------------------------------------------------------------------------- 1 | archive_command = 'pgbackrest archive-push %p' 2 | -------------------------------------------------------------------------------- /conf/postgres_common/postgres/backrest-archive-command-local-and-gcs: -------------------------------------------------------------------------------- 1 | archive_command = 'pgbackrest archive-push %p && pgbackrest archive-push --repo-type=gcs %p' 2 | -------------------------------------------------------------------------------- /conf/postgres_common/postgres/backrest-archive-command-local-and-s3: -------------------------------------------------------------------------------- 1 | archive_command = 'pgbackrest archive-push %p && pgbackrest archive-push --repo-type=s3 %p' 2 | -------------------------------------------------------------------------------- /conf/postgres_common/postgres/group.template: -------------------------------------------------------------------------------- 1 | root:x:0: 2 | bin:x:1: 3 | daemon:x:2: 4 | sys:x:3: 5 | adm:x:4: 6 | tty:x:5: 7 | disk:x:6: 8 | lp:x:7: 9 | mem:x:8: 10 | kmem:x:9: 11 | wheel:x:10: 12 | cdrom:x:11: 13 | mail:x:12: 14 | man:x:15: 15 | dialout:x:18: 16 | floppy:x:19: 17 | games:x:20: 18 | tape:x:30: 19 | video:x:39: 20 | ftp:x:50: 21 | lock:x:54: 22 | audio:x:63: 23 | nobody:x:99: 24 | users:x:100: 25 | utmp:x:22: 26 | utempter:x:35: 27 | input:x:999: 28 | systemd-journal:x:190: 29 | systemd-network:x:192: 30 | dbus:x:81: 31 | ssh_keys:x:998: 32 | nfsnobody:x:65534: 33 | postgres:x:${USER_ID}:postgres 34 | -------------------------------------------------------------------------------- /conf/postgres_common/postgres/passwd.template: -------------------------------------------------------------------------------- 1 | root:x:0:0:root:/root:/bin/bash 2 | bin:x:1:1:bin:/bin:/sbin/nologin 3 | daemon:x:2:2:daemon:/sbin:/sbin/nologin 4 | adm:x:3:4:adm:/var/adm:/sbin/nologin 5 | lp:x:4:7:lp:/var/spool/lpd:/sbin/nologin 6 | sync:x:5:0:sync:/sbin:/bin/sync 7 | shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown 8 | halt:x:7:0:halt:/sbin:/sbin/halt 9 | mail:x:8:12:mail:/var/spool/mail:/sbin/nologin 10 | operator:x:11:0:operator:/root:/sbin/nologin 11 | games:x:12:100:games:/usr/games:/sbin/nologin 12 | ftp:x:14:50:FTP User:/var/ftp:/sbin/nologin 13 | nobody:x:99:99:Nobody:/:/sbin/nologin 14 | postgres:x:${USER_ID}:${GROUP_ID}:PostgreSQL Server:${HOME}:/bin/bash 15 | -------------------------------------------------------------------------------- /conf/sample-app/group.template: -------------------------------------------------------------------------------- 1 | root:x:0: 2 | bin:x:1: 3 | daemon:x:2: 4 | sys:x:3: 5 | adm:x:4: 6 | tty:x:5: 7 | disk:x:6: 8 | lp:x:7: 9 | mem:x:8: 10 | kmem:x:9: 11 | wheel:x:10: 12 | cdrom:x:11: 13 | mail:x:12: 14 | man:x:15: 15 | dialout:x:18: 16 | floppy:x:19: 17 | games:x:20: 18 | tape:x:30: 19 | video:x:39: 20 | ftp:x:50: 21 | lock:x:54: 22 | audio:x:63: 23 | nobody:x:99: 24 | users:x:100: 25 | utmp:x:22: 26 | utempter:x:35: 27 | input:x:999: 28 | systemd-journal:x:190: 29 | systemd-network:x:192: 30 | dbus:x:81: 31 | ssh_keys:x:998: 32 | nfsnobody:x:65534: 33 | daemon:x:${USER_ID}:daemon 34 | -------------------------------------------------------------------------------- /conf/sample-app/passwd.template: -------------------------------------------------------------------------------- 1 | root:x:0:0:root:/root:/bin/bash 2 | bin:x:1:1:bin:/bin:/sbin/nologin 3 | adm:x:3:4:adm:/var/adm:/sbin/nologin 4 | lp:x:4:7:lp:/var/spool/lpd:/sbin/nologin 5 | sync:x:5:0:sync:/sbin:/bin/sync 6 | shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown 7 | halt:x:7:0:halt:/sbin:/sbin/halt 8 | mail:x:8:12:mail:/var/spool/mail:/sbin/nologin 9 | operator:x:11:0:operator:/root:/sbin/nologin 10 | games:x:12:100:games:/usr/games:/sbin/nologin 11 | ftp:x:14:50:FTP User:/var/ftp:/sbin/nologin 12 | nobody:x:99:99:Nobody:/:/sbin/nologin 13 | daemon:x:${USER_ID}:${GROUP_ID}:daemon:/sbin:/sbin/nologin 14 | -------------------------------------------------------------------------------- /conf/scheduler/group.template: -------------------------------------------------------------------------------- 1 | root:x:0: 2 | bin:x:1: 3 | daemon:x:2: 4 | sys:x:3: 5 | adm:x:4: 6 | tty:x:5: 7 | disk:x:6: 8 | lp:x:7: 9 | mem:x:8: 10 | kmem:x:9: 11 | wheel:x:10: 12 | cdrom:x:11: 13 | mail:x:12: 14 | man:x:15: 15 | dialout:x:18: 16 | floppy:x:19: 17 | games:x:20: 18 | tape:x:30: 19 | video:x:39: 20 | ftp:x:50: 21 | lock:x:54: 22 | audio:x:63: 23 | nobody:x:99: 24 | users:x:100: 25 | utmp:x:22: 26 | utempter:x:35: 27 | input:x:999: 28 | systemd-journal:x:190: 29 | systemd-network:x:192: 30 | dbus:x:81: 31 | ssh_keys:x:998: 32 | nfsnobody:x:65534: 33 | daemon:x:${USER_ID}:daemon 34 | -------------------------------------------------------------------------------- /conf/scheduler/passwd.template: -------------------------------------------------------------------------------- 1 | root:x:0:0:root:/root:/bin/bash 2 | bin:x:1:1:bin:/bin:/sbin/nologin 3 | adm:x:3:4:adm:/var/adm:/sbin/nologin 4 | lp:x:4:7:lp:/var/spool/lpd:/sbin/nologin 5 | sync:x:5:0:sync:/sbin:/bin/sync 6 | shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown 7 | halt:x:7:0:halt:/sbin:/sbin/halt 8 | mail:x:8:12:mail:/var/spool/mail:/sbin/nologin 9 | operator:x:11:0:operator:/root:/sbin/nologin 10 | games:x:12:100:games:/usr/games:/sbin/nologin 11 | ftp:x:14:50:FTP User:/var/ftp:/sbin/nologin 12 | nobody:x:99:99:Nobody:/:/sbin/nologin 13 | daemon:x:${USER_ID}:${GROUP_ID}:daemon:/sbin:/sbin/nologin 14 | -------------------------------------------------------------------------------- /conf/upgrade/group.template: -------------------------------------------------------------------------------- 1 | root:x:0: 2 | bin:x:1: 3 | daemon:x:2: 4 | sys:x:3: 5 | adm:x:4: 6 | tty:x:5: 7 | disk:x:6: 8 | lp:x:7: 9 | mem:x:8: 10 | kmem:x:9: 11 | wheel:x:10: 12 | cdrom:x:11: 13 | mail:x:12: 14 | man:x:15: 15 | dialout:x:18: 16 | floppy:x:19: 17 | games:x:20: 18 | tape:x:30: 19 | video:x:39: 20 | ftp:x:50: 21 | lock:x:54: 22 | audio:x:63: 23 | nobody:x:99: 24 | users:x:100: 25 | utmp:x:22: 26 | utempter:x:35: 27 | input:x:999: 28 | systemd-journal:x:190: 29 | systemd-network:x:192: 30 | dbus:x:81: 31 | ssh_keys:x:998: 32 | nfsnobody:x:65534: 33 | postgres:x:${USER_ID}:postgres 34 | -------------------------------------------------------------------------------- /conf/upgrade/passwd.template: -------------------------------------------------------------------------------- 1 | root:x:0:0:root:/root:/bin/bash 2 | bin:x:1:1:bin:/bin:/sbin/nologin 3 | daemon:x:2:2:daemon:/sbin:/sbin/nologin 4 | adm:x:3:4:adm:/var/adm:/sbin/nologin 5 | lp:x:4:7:lp:/var/spool/lpd:/sbin/nologin 6 | sync:x:5:0:sync:/sbin:/bin/sync 7 | shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown 8 | halt:x:7:0:halt:/sbin:/sbin/halt 9 | mail:x:8:12:mail:/var/spool/mail:/sbin/nologin 10 | operator:x:11:0:operator:/root:/sbin/nologin 11 | games:x:12:100:games:/usr/games:/sbin/nologin 12 | ftp:x:14:50:FTP User:/var/ftp:/sbin/nologin 13 | nobody:x:99:99:Nobody:/:/sbin/nologin 14 | postgres:x:${USER_ID}:${GROUP_ID}:PostgreSQL Server:${HOME}:/bin/bash 15 | -------------------------------------------------------------------------------- /containers.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CrunchyData/crunchy-containers/c7398a94d2419a05172b16d977c07f8794b62288/containers.png -------------------------------------------------------------------------------- /crunchy_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CrunchyData/crunchy-containers/c7398a94d2419a05172b16d977c07f8794b62288/crunchy_logo.png -------------------------------------------------------------------------------- /docs/archetypes/default.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "{{ replace .Name "-" " " | title }}" 3 | date: {{ .Date }} 4 | draft: false 5 | --- 6 | 7 | -------------------------------------------------------------------------------- /docs/content/client-user-guide/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Client User Guide" 3 | date: 4 | draft: false 5 | weight: 3 6 | --- 7 | -------------------------------------------------------------------------------- /docs/content/container-specifications/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Container Specifications" 3 | date: 4 | draft: false 5 | weight: 6 6 | --- 7 | 8 | 9 | * [Crunchy pgadmin4](crunchy-pgadmin4) 10 | * [Crunchy pgbackrest](crunchy-pgbackrest) 11 | * [Crunchy pgbadger](crunchy-pgbadger) 12 | * [Crunchy pgbouncer](crunchy-pgbouncer) 13 | * [Crunchy pgpool](crunchy-pgpool) 14 | * [Crunchy postgres-gis](crunchy-postgres-gis) 15 | * [Crunchy postgres](crunchy-postgres) 16 | * [Crunchy upgrade](crunchy-upgrade) 17 | -------------------------------------------------------------------------------- /docs/content/container-specifications/crunchy-postgres/sqlrunner.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "sqlrunner" 3 | --- 4 | 5 | The `sqlrunner` running mode will use `psql` to issue specified queries, defined in SQL files, to your PostgreSQL database. 6 | 7 | MODE: `sqlrunner` 8 | 9 | ## Environment Variables 10 | 11 | ### Required 12 | **Name**|**Default**|**Description** 13 | :-----|:-----|:----- 14 | `MODE` | None | Set to `sqlrunner` to run as SQL running job 15 | `PG_HOST` | None | Hostname of the database the sql files will be run on. 16 | `PG_PORT` | None | The port to use when connecting to the database. 17 | `PG_DATABASE` | None | Name of the database the sql files will be run on. 18 | `PG_USER` | None | Username for the PostgreSQL role being used. 19 | `PG_PASSWORD` | None | Password for the PostgreSQL role being used. 20 | 21 | ## Custom Configuration 22 | 23 | All queries from sql files in the `/pgconf` volume will be issued to the specified `PG_DATABASE`. -------------------------------------------------------------------------------- /docs/content/contributing/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Contributing" 3 | date: 4 | draft: false 5 | weight: 7 6 | --- -------------------------------------------------------------------------------- /docs/content/contributing/issues.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Submitting Issues" 3 | date: 4 | draft: false 5 | weight: 252 6 | --- 7 | 8 | 9 | If you would like to submit an feature / issue for us to consider please submit an issue to the official [GitHub Repository](https://github.com/CrunchyData/crunchy-containers/issues/new/choose). 10 | 11 | If you would like to work any current or open issues, please update the issue with your efforts so that we can avoid redundant or unnecessary work. 12 | 13 | If you have any questions, you can submit a Support - Question and Answer issue and we will work with you on how you can get more involved. 14 | -------------------------------------------------------------------------------- /docs/content/contributing/pull-requests.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Submitting Pull Requests" 3 | date: 4 | draft: false 5 | weight: 253 6 | --- 7 | 8 | So you decided to submit an issue and work it. Great! Let's get it merged in to the codebase. The following will go a long way to helping get the fix merged in quicker: 9 | 10 | 1. Fork the [Github repository](https://github.com/CrunchyData/crunchy-containers) and make a branch off of the `master` branch 11 | 2. Create a Pull Request from your Fork back to the `master` branch. 12 | 3. Update the checklists in the Pull Request description. 13 | 4. Reference which issues this Pull Request is resolving. 14 | -------------------------------------------------------------------------------- /docs/content/examples/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Examples" 3 | date: 4 | draft: false 5 | weight: 4 6 | --- -------------------------------------------------------------------------------- /docs/content/examples/postgresql/custom-config.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Custom Configuration of PostgreSQL Container" 3 | date: 4 | draft: false 5 | weight: 2 6 | --- 7 | 8 | 9 | ## Custom Configuration 10 | 11 | You can use your own version of the SQL file `setup.sql` to customize 12 | the initialization of database data and objects when the container and 13 | database are created. 14 | 15 | This works by placing a file named `setup.sql` within the `/pgconf` mounted volume 16 | directory. Portions of the `setup.sql` file are required for the container 17 | to work; please see comments within the sample `setup.sql` file. 18 | 19 | If you mount a `/pgconf` volume, crunchy-postgres will look at that directory 20 | for `postgresql.conf`, `pg_hba.conf`, `pg_ident.conf`, SSL server/ca certificates and `setup.sql`. 21 | If it finds one of them it will use that file instead of the default files. 22 | 23 | ### Docker 24 | 25 | This example can be run as follows for the Docker environment: 26 | ``` 27 | cd $CCPROOT/examples/docker/custom-config 28 | ./run.sh 29 | ``` 30 | 31 | ### Kubernetes and OpenShift 32 | 33 | Running the example: 34 | ``` 35 | cd $CCPROOT/examples/kube/custom-config 36 | ./run.sh 37 | ``` 38 | -------------------------------------------------------------------------------- /docs/content/installation-guide/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Installation Guide" 3 | date: 4 | draft: false 5 | weight: 5 6 | --- -------------------------------------------------------------------------------- /docs/content/overview/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Overview" 3 | date: 4 | draft: false 5 | weight: 2 6 | --- -------------------------------------------------------------------------------- /docs/content/overview/supported.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Supported Platforms" 3 | date: 4 | draft: false 5 | weight: 3 6 | --- 7 | 8 | ## Supported Platforms 9 | 10 | Crunchy Container Suite supports the following platforms: 11 | 12 | * *Docker 1.13+* 13 | * *Kubernetes 1.12+* 14 | * *OpenShift Container Platform 3.11* 15 | * *VMWare Enterprise PKS 1.3+* -------------------------------------------------------------------------------- /docs/layouts/partials/flex/body-aftercontent.html: -------------------------------------------------------------------------------- 1 |
2 | {{ partial "next-prev-page.html" . }} 3 |
4 | 5 | 6 | 7 | 8 | 43 | 44 | {{ partial "flex/scripts.html" . }} 45 | -------------------------------------------------------------------------------- /docs/static/Operator-DR-Storage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CrunchyData/crunchy-containers/c7398a94d2419a05172b16d977c07f8794b62288/docs/static/Operator-DR-Storage.png -------------------------------------------------------------------------------- /docs/static/OperatorReferenceDiagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CrunchyData/crunchy-containers/c7398a94d2419a05172b16d977c07f8794b62288/docs/static/OperatorReferenceDiagram.png -------------------------------------------------------------------------------- /docs/static/after.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CrunchyData/crunchy-containers/c7398a94d2419a05172b16d977c07f8794b62288/docs/static/after.png -------------------------------------------------------------------------------- /docs/static/containers.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CrunchyData/crunchy-containers/c7398a94d2419a05172b16d977c07f8794b62288/docs/static/containers.png -------------------------------------------------------------------------------- /docs/static/crunchy_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CrunchyData/crunchy-containers/c7398a94d2419a05172b16d977c07f8794b62288/docs/static/crunchy_logo.png -------------------------------------------------------------------------------- /docs/static/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CrunchyData/crunchy-containers/c7398a94d2419a05172b16d977c07f8794b62288/docs/static/favicon.ico -------------------------------------------------------------------------------- /docs/static/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CrunchyData/crunchy-containers/c7398a94d2419a05172b16d977c07f8794b62288/docs/static/favicon.png -------------------------------------------------------------------------------- /docs/static/grafana-dashboard-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CrunchyData/crunchy-containers/c7398a94d2419a05172b16d977c07f8794b62288/docs/static/grafana-dashboard-1.png -------------------------------------------------------------------------------- /docs/static/grafana-dashboard-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CrunchyData/crunchy-containers/c7398a94d2419a05172b16d977c07f8794b62288/docs/static/grafana-dashboard-2.png -------------------------------------------------------------------------------- /docs/static/grafana-dashboard-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CrunchyData/crunchy-containers/c7398a94d2419a05172b16d977c07f8794b62288/docs/static/grafana-dashboard-3.png -------------------------------------------------------------------------------- /docs/static/grafana.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CrunchyData/crunchy-containers/c7398a94d2419a05172b16d977c07f8794b62288/docs/static/grafana.png -------------------------------------------------------------------------------- /docs/static/grafana_s1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CrunchyData/crunchy-containers/c7398a94d2419a05172b16d977c07f8794b62288/docs/static/grafana_s1.png -------------------------------------------------------------------------------- /docs/static/grafana_s2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CrunchyData/crunchy-containers/c7398a94d2419a05172b16d977c07f8794b62288/docs/static/grafana_s2.png -------------------------------------------------------------------------------- /docs/static/operator-diagram-cluster.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CrunchyData/crunchy-containers/c7398a94d2419a05172b16d977c07f8794b62288/docs/static/operator-diagram-cluster.png -------------------------------------------------------------------------------- /docs/static/operator-diagram-database.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CrunchyData/crunchy-containers/c7398a94d2419a05172b16d977c07f8794b62288/docs/static/operator-diagram-database.png -------------------------------------------------------------------------------- /docs/static/operator-diagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CrunchyData/crunchy-containers/c7398a94d2419a05172b16d977c07f8794b62288/docs/static/operator-diagram.png -------------------------------------------------------------------------------- /docs/static/pgadmin4-screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CrunchyData/crunchy-containers/c7398a94d2419a05172b16d977c07f8794b62288/docs/static/pgadmin4-screenshot.png -------------------------------------------------------------------------------- /docs/static/pgadmin4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CrunchyData/crunchy-containers/c7398a94d2419a05172b16d977c07f8794b62288/docs/static/pgadmin4.png -------------------------------------------------------------------------------- /docs/static/pgbadger.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CrunchyData/crunchy-containers/c7398a94d2419a05172b16d977c07f8794b62288/docs/static/pgbadger.png -------------------------------------------------------------------------------- /docs/static/prometheus-console.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CrunchyData/crunchy-containers/c7398a94d2419a05172b16d977c07f8794b62288/docs/static/prometheus-console.png -------------------------------------------------------------------------------- /docs/static/tty.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CrunchyData/crunchy-containers/c7398a94d2419a05172b16d977c07f8794b62288/docs/static/tty.gif -------------------------------------------------------------------------------- /examples/docker/backrest/async-archive/cleanup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 4 | 5 | docker stop backrest-async-archive 6 | docker rm backrest-async-archive 7 | docker volume rm br-aa-pgdata br-aa-backups 8 | -------------------------------------------------------------------------------- /examples/docker/backrest/async-archive/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 4 | 5 | $DIR/cleanup.sh 6 | 7 | docker run \ 8 | --publish 5432:5432 \ 9 | --volume br-aa-pgdata:/pgdata \ 10 | --volume br-aa-backups:/backrestrepo \ 11 | --env PG_MODE=primary \ 12 | --env PG_USER=testuser \ 13 | --env PG_PASSWORD=password \ 14 | --env PG_DATABASE=userdb \ 15 | --env PG_PRIMARY_USER=primaryuser \ 16 | --env PG_PRIMARY_PORT=5432 \ 17 | --env PG_PRIMARY_PASSWORD=password \ 18 | --env PG_ROOT_PASSWORD=password \ 19 | --env PGHOST=/tmp \ 20 | --env PGBACKREST=true \ 21 | --env PGBACKREST_ARCHIVE_ASYNC=y \ 22 | --name=backrest-async-archive \ 23 | --hostname=backrest-async-archive \ 24 | --detach ${CCP_IMAGE_PREFIX?}/crunchy-postgres:${CCP_IMAGE_TAG?} 25 | -------------------------------------------------------------------------------- /examples/docker/backrest/backup/cleanup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 4 | 5 | docker stop backrest 6 | docker rm backrest 7 | docker volume rm br-pgdata br-backups 8 | -------------------------------------------------------------------------------- /examples/docker/backrest/backup/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 4 | 5 | $DIR/cleanup.sh 6 | 7 | docker run \ 8 | --publish 5432:5432 \ 9 | --volume br-pgdata:/pgdata \ 10 | --volume br-backups:/backrestrepo \ 11 | --env PG_MODE=primary \ 12 | --env PG_USER=testuser \ 13 | --env PG_PASSWORD=password \ 14 | --env PG_DATABASE=userdb \ 15 | --env PG_PRIMARY_USER=primaryuser \ 16 | --env PG_PRIMARY_PORT=5432 \ 17 | --env PG_PRIMARY_PASSWORD=password \ 18 | --env PG_ROOT_PASSWORD=password \ 19 | --env PGHOST=/tmp \ 20 | --env PGBACKREST=true \ 21 | --name=backrest \ 22 | --hostname=backrest \ 23 | --detach ${CCP_IMAGE_PREFIX?}/crunchy-postgres:${CCP_IMAGE_TAG?} 24 | -------------------------------------------------------------------------------- /examples/docker/backrest/delta/cleanup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 4 | 5 | docker stop backrest-delta-restore backrest-delta-restored backrest 6 | docker rm backrest-delta-restore backrest-delta-restored backrest 7 | -------------------------------------------------------------------------------- /examples/docker/backrest/delta/post-restore.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 4 | 5 | docker run \ 6 | --publish 5432:5432 \ 7 | --volume br-pgdata:/pgdata \ 8 | --volume br-backups:/backrestrepo \ 9 | --env PG_MODE=primary \ 10 | --env PG_USER=testuser \ 11 | --env PG_PASSWORD=password \ 12 | --env PG_DATABASE=userdb \ 13 | --env PG_PRIMARY_USER=primaryuser \ 14 | --env PG_PRIMARY_PORT=5432 \ 15 | --env PG_PRIMARY_PASSWORD=password \ 16 | --env PG_ROOT_PASSWORD=password \ 17 | --env PGHOST=/tmp \ 18 | --env PGBACKREST=true \ 19 | --env PGBACKREST_PG1_PATH=/pgdata/backrest \ 20 | --env PGBACKREST_REPO1_PATH=/backrestrepo/backrest-backups \ 21 | --env PGDATA_PATH_OVERRIDE=backrest \ 22 | --name=backrest-delta-restored \ 23 | --hostname=backrest-delta-restored \ 24 | --detach ${CCP_IMAGE_PREFIX?}/crunchy-postgres:${CCP_IMAGE_TAG?} 25 | -------------------------------------------------------------------------------- /examples/docker/backrest/delta/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | source ${CCPROOT}/examples/common.sh 4 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 5 | 6 | if [[ -z ${CCP_BACKREST_TIMESTAMP} ]] 7 | then 8 | echo_err "Please provide a valid timestamp for the delta PITR using varibale CCP_BACKREST_TIMESTAMP." 9 | exit 1 10 | fi 11 | 12 | docker exec -ti backrest date > /dev/null 13 | if [[ $? -ne 0 ]] 14 | then 15 | echo_err "The backup example must be running prior to using this example." 16 | exit 1 17 | fi 18 | 19 | $DIR/cleanup.sh 20 | 21 | docker run \ 22 | --volume br-pgdata:/pgdata \ 23 | --volume br-backups:/backrestrepo \ 24 | --env PGBACKREST_STANZA=db \ 25 | --env PGBACKREST_PG1_PATH=/pgdata/backrest \ 26 | --env PGBACKREST_REPO1_PATH=/backrestrepo/backrest-backups \ 27 | --env PGBACKREST_DELTA=y \ 28 | --env PGBACKREST_TYPE=time \ 29 | --env PGBACKREST_TARGET="${CCP_BACKREST_TIMESTAMP}" \ 30 | --env PGBACKREST_LOG_PATH=/tmp \ 31 | --name=backrest-delta-restore \ 32 | --hostname=backrest-delta-restore \ 33 | --detach ${CCP_IMAGE_PREFIX?}/crunchy-backrest-restore:${CCP_IMAGE_TAG?} 34 | -------------------------------------------------------------------------------- /examples/docker/backrest/full/cleanup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 4 | 5 | docker stop backrest-full-restore backrest-full-restored backrest 6 | docker rm backrest-full-restore backrest-full-restored backrest 7 | docker volume rm br-new-pgdata 8 | -------------------------------------------------------------------------------- /examples/docker/backrest/full/post-restore.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 4 | 5 | docker run \ 6 | --publish 5432:5432 \ 7 | --volume br-new-pgdata:/pgdata \ 8 | --volume br-backups:/backrestrepo \ 9 | --env PG_MODE=primary \ 10 | --env PG_USER=testuser \ 11 | --env PG_PASSWORD=password \ 12 | --env PG_DATABASE=userdb \ 13 | --env PG_PRIMARY_USER=primaryuser \ 14 | --env PG_PRIMARY_PORT=5432 \ 15 | --env PG_PRIMARY_PASSWORD=password \ 16 | --env PG_ROOT_PASSWORD=password \ 17 | --env PGHOST=/tmp \ 18 | --env PGBACKREST=true \ 19 | --env PGBACKREST_REPO1_PATH=/backrestrepo/backrest-backups \ 20 | --name=backrest-full-restored \ 21 | --hostname=backrest-full-restored \ 22 | --detach ${CCP_IMAGE_PREFIX?}/crunchy-postgres:${CCP_IMAGE_TAG?} 23 | -------------------------------------------------------------------------------- /examples/docker/backrest/full/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | source ${CCPROOT}/examples/common.sh 4 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 5 | 6 | docker exec -ti backrest date > /dev/null 7 | if [[ $? -ne 0 ]] 8 | then 9 | echo_err "The backup example must be running prior to using this example." 10 | exit 1 11 | fi 12 | 13 | $DIR/cleanup.sh 14 | 15 | docker run \ 16 | --volume br-new-pgdata:/pgdata \ 17 | --volume br-backups:/backrestrepo \ 18 | --env PGBACKREST_STANZA=db \ 19 | --env PGBACKREST_PG1_PATH=/pgdata/backrest-full-restored \ 20 | --env PGBACKREST_REPO1_PATH=/backrestrepo/backrest-backups \ 21 | --name=backrest-full-restore \ 22 | --hostname=backrest-full-restore \ 23 | --detach ${CCP_IMAGE_PREFIX?}/crunchy-backrest-restore:${CCP_IMAGE_TAG?} 24 | -------------------------------------------------------------------------------- /examples/docker/backrest/pitr/cleanup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 4 | 5 | docker stop backrest-pitr-restore backrest-pitr-restored backrest 6 | docker rm backrest-pitr-restore backrest-pitr-restored backrest 7 | docker volume rm br-new-pgdata 8 | -------------------------------------------------------------------------------- /examples/docker/backrest/pitr/post-restore.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 4 | 5 | docker run \ 6 | --publish 5432:5432 \ 7 | --volume br-new-pgdata:/pgdata \ 8 | --volume br-backups:/backrestrepo \ 9 | --env PG_MODE=primary \ 10 | --env PG_USER=testuser \ 11 | --env PG_PASSWORD=password \ 12 | --env PG_DATABASE=userdb \ 13 | --env PG_PRIMARY_USER=primaryuser \ 14 | --env PG_PRIMARY_PORT=5432 \ 15 | --env PG_PRIMARY_PASSWORD=password \ 16 | --env PG_ROOT_PASSWORD=password \ 17 | --env PGHOST=/tmp \ 18 | --env PGBACKREST=true \ 19 | --env PGBACKREST_REPO1_PATH=/backrestrepo/backrest-backups \ 20 | --name=backrest-pitr-restored \ 21 | --hostname=backrest-pitr-restored \ 22 | --detach ${CCP_IMAGE_PREFIX?}/crunchy-postgres:${CCP_IMAGE_TAG?} 23 | -------------------------------------------------------------------------------- /examples/docker/backrest/pitr/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | source ${CCPROOT}/examples/common.sh 4 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 5 | 6 | if [[ -z ${CCP_BACKREST_TIMESTAMP} ]] 7 | then 8 | echo_err "Please provide a valid timestamp for the PITR using varibale CCP_BACKREST_TIMESTAMP." 9 | exit 1 10 | fi 11 | 12 | docker exec -ti backrest date > /dev/null 13 | if [[ $? -ne 0 ]] 14 | then 15 | echo_err "The backup example must be running prior to using this example." 16 | exit 1 17 | fi 18 | 19 | $DIR/cleanup.sh 20 | 21 | docker run \ 22 | --volume br-new-pgdata:/pgdata \ 23 | --volume br-backups:/backrestrepo \ 24 | --env PGBACKREST_STANZA=db \ 25 | --env PGBACKREST_PG1_PATH=/pgdata/backrest-pitr-restored \ 26 | --env PGBACKREST_REPO1_PATH=/backrestrepo/backrest-backups \ 27 | --env PGBACKREST_TYPE=time \ 28 | --env PGBACKREST_TARGET="${CCP_BACKREST_TIMESTAMP}" \ 29 | --env PGBACKREST_LOG_PATH=/tmp \ 30 | --name=backrest-pitr-restore \ 31 | --hostname=backrest-pitr-restore \ 32 | --detach ${CCP_IMAGE_PREFIX?}/crunchy-backrest-restore:${CCP_IMAGE_TAG?} 33 | -------------------------------------------------------------------------------- /examples/docker/custom-config-ssl/configs/pg_hba.conf: -------------------------------------------------------------------------------- 1 | # TYPE DATABASE USER ADDRESS METHOD 2 | 3 | # "local" is for Unix domain socket connections only 4 | local all postgres peer 5 | hostssl replication primaryuser 0.0.0.0/0 cert clientcert=1 6 | hostssl replication primaryuser 127.0.0.1/32 cert clientcert=1 7 | # IPv4 local connections: 8 | hostssl all testuser 127.0.0.1/32 cert clientcert=1 map=ssl-testuser 9 | hostssl all testuser 0.0.0.0/0 cert clientcert=1 map=ssl-testuser 10 | hostssl all all 127.0.0.1/32 cert clientcert=1 11 | hostssl all all 0.0.0.0/0 cert clientcert=1 12 | -------------------------------------------------------------------------------- /examples/docker/custom-config-ssl/configs/pg_ident.conf: -------------------------------------------------------------------------------- 1 | ssl-testuser testuser@crunchydata.com testuser 2 | -------------------------------------------------------------------------------- /examples/docker/custom-config-ssl/configs/postgresql.conf: -------------------------------------------------------------------------------- 1 | listen_addresses = '*' # what IP address(es) to listen on; 2 | ssl = on # (change requires restart) 3 | ssl_cert_file = 'server.crt' # (change requires restart) 4 | ssl_key_file = 'server.key' # (change requires restart) 5 | ssl_ca_file = 'ca.crt' # (change requires restart) 6 | ssl_crl_file = 'ca.crl' # (change requires restart) 7 | wal_level = hot_standby # minimal, archive, or hot_standby 8 | max_wal_senders = 10 # max number of walsender processes 9 | log_destination = 'stderr' 10 | logging_collector = off 11 | log_autovacuum_min_duration = 0 # -1 disables, 0 logs all actions and 12 | timezone = 'UTC' 13 | shared_preload_libraries = 'pg_stat_statements.so' 14 | -------------------------------------------------------------------------------- /examples/docker/custom-config/cleanup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright 2016 - 2023 Crunchy Data Solutions, Inc. 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | echo "Cleaning up..." 17 | 18 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 19 | CONTAINER_NAME='custom-config' 20 | PGDATA_VOL="${CONTAINER_NAME?}-pgdata" 21 | PGWAL_VOL="${CONTAINER_NAME?}-wal" 22 | BACKUP_VOL="${CONTAINER_NAME?}-backup" 23 | 24 | docker stop ${CONTAINER_NAME?} 25 | docker rm ${CONTAINER_NAME} 26 | docker volume rm ${PGDATA_VOL?} ${PGWAL_VOL?} ${BACKUP_VOL?} 27 | -------------------------------------------------------------------------------- /examples/docker/custom-config/configs/postgresql.conf: -------------------------------------------------------------------------------- 1 | listen_addresses = '*' # what IP address(es) to listen on; 2 | wal_level = hot_standby # minimal, archive, or hot_standby 3 | max_wal_senders = 10 # max number of walsender processes 4 | log_destination = 'stderr' 5 | logging_collector = off 6 | log_autovacuum_min_duration = 0 # -1 disables, 0 logs all actions and 7 | timezone = 'UTC' 8 | shared_preload_libraries = 'pg_stat_statements.so' 9 | -------------------------------------------------------------------------------- /examples/docker/custom-config/configs/setup.sql: -------------------------------------------------------------------------------- 1 | 2 | /* the following are required for other container operations */ 3 | alter user postgres password 'PG_ROOT_PASSWORD'; 4 | 5 | create user PG_PRIMARY_USER with REPLICATION PASSWORD 'PG_PRIMARY_PASSWORD'; 6 | create user PG_USER with password 'PG_PASSWORD'; 7 | 8 | create table primarytable (key varchar(20), value varchar(20)); 9 | grant all on primarytable to PG_PRIMARY_USER; 10 | 11 | create database PG_DATABASE; 12 | 13 | grant all privileges on database PG_DATABASE to PG_USER; 14 | 15 | \c PG_DATABASE 16 | 17 | /* the following can be customized for your purposes */ 18 | 19 | \c PG_DATABASE PG_USER; 20 | 21 | create table customtable ( 22 | key varchar(30) primary key, 23 | value varchar(50) not null, 24 | updatedt timestamp not null 25 | ); 26 | 27 | insert into customtable (key, value, updatedt) values ('CPU', '256', now()); 28 | 29 | grant all on customtable to PG_PRIMARY_USER; 30 | -------------------------------------------------------------------------------- /examples/docker/pgadmin4-http/cleanup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright 2018 - 2023 Crunchy Data Solutions, Inc. 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) 17 | 18 | echo "Cleaning up..." 19 | 20 | CONTAINER_NAME='pgadmin4-http' 21 | 22 | docker stop ${CONTAINER_NAME?} 23 | docker rm -v ${CONTAINER_NAME?} 24 | docker volume rm ${CONTAINER_NAME?}-data 25 | -------------------------------------------------------------------------------- /examples/docker/pgadmin4-https/cleanup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright 2018 - 2023 Crunchy Data Solutions, Inc. 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) 17 | 18 | echo "Cleaning up..." 19 | 20 | CONTAINER_NAME='pgadmin4-https' 21 | 22 | rm -rf ${DIR?}/out ${DIR?}/privkey.pem 23 | 24 | docker stop ${CONTAINER_NAME?} 25 | docker rm -v ${CONTAINER_NAME?} 26 | docker volume rm ${CONTAINER_NAME?}-data 27 | docker volume rm ${CONTAINER_NAME?}-certs 28 | -------------------------------------------------------------------------------- /examples/docker/pgaudit/cleanup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright 2016 - 2023 Crunchy Data Solutions, Inc. 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | echo "Cleaning up..." 17 | 18 | CONTAINER_NAME=pgaudit 19 | VOLUME_NAME=$CONTAINER_NAME-pgdata 20 | 21 | docker rm -f $CONTAINER_NAME 22 | docker volume rm $VOLUME_NAME 23 | -------------------------------------------------------------------------------- /examples/docker/pgaudit/test.sql: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 - 2023 Crunchy Data Solutions, Inc. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | set pgaudit.log = 'write, ddl'; 17 | set pgaudit.log_relation = on; 18 | 19 | create table audittest (id int); 20 | insert into audittest values (1); 21 | drop table audittest; 22 | -------------------------------------------------------------------------------- /examples/docker/pgbadger/cleanup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright 2016 - 2023 Crunchy Data Solutions, Inc. 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | echo "Cleaning up..." 17 | 18 | docker stop pg-primary pgbadger 19 | docker rm -v pg-primary pgbadger 20 | docker volume rm pg-primary report 21 | -------------------------------------------------------------------------------- /examples/docker/pgbadger/env/pgsql-primary.list: -------------------------------------------------------------------------------- 1 | # Crunchy Container Env 2 | TEMP_BUFFERS=9MB 3 | PGHOST=/tmp 4 | MAX_CONNECTIONS=100 5 | SHARED_BUFFERS=128MB 6 | MAX_WAL_SENDERS=1 7 | WORK_MEM=5MB 8 | PG_MODE=primary 9 | PG_PRIMARY_USER=primaryuser 10 | PG_PRIMARY_PASSWORD=password 11 | PG_DATABASE=userdb 12 | PG_USER=testuser 13 | PG_PASSWORD=password 14 | PG_ROOT_PASSWORD=password 15 | PG_PRIMARY_PORT=5432 16 | -------------------------------------------------------------------------------- /examples/docker/pgbasebackup/backup/cleanup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright 2016 - 2023 Crunchy Data Solutions, Inc. 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | echo "Cleaning up..." 17 | 18 | CONTAINER_NAME=backup 19 | VOLUME_NAME=backup-volume 20 | 21 | docker stop $CONTAINER_NAME 22 | docker rm -v $CONTAINER_NAME 23 | docker volume rm $VOLUME_NAME 24 | -------------------------------------------------------------------------------- /examples/docker/pgbasebackup/full/cleanup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright 2016 - 2023 Crunchy Data Solutions, Inc. 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | echo "Cleaning up..." 17 | 18 | RESTORE_CONTAINER_NAME=restore 19 | RESTORED_CONTAINER_NAME=pgbasebackup-full-restored 20 | 21 | docker stop "${RESTORED_CONTAINER_NAME}" 22 | docker rm -v "${RESTORED_CONTAINER_NAME}" 23 | 24 | docker stop "${RESTORE_CONTAINER_NAME}" 25 | docker rm -v "${RESTORE_CONTAINER_NAME}" 26 | docker volume rm full-restore-pgdata 27 | -------------------------------------------------------------------------------- /examples/docker/pgbasebackup/full/post-restore.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | CONTAINER_NAME=pgbasebackup-full-restored 4 | 5 | echo "Cleaning up..." 6 | 7 | sudo docker stop "${CONTAINER_NAME}" 8 | sudo docker rm "${CONTAINER_NAME}" 9 | 10 | docker run \ 11 | -p 12001:5432 \ 12 | --volume full-restore-pgdata:/pgdata \ 13 | --env PG_MODE=primary \ 14 | --env PG_USER=testuser \ 15 | --env PG_PASSWORD=password \ 16 | --env PG_DATABASE=userdb \ 17 | --env PG_PRIMARY_USER=primaryuser \ 18 | --env PG_PRIMARY_PORT=5432 \ 19 | --env PG_PRIMARY_PASSWORD=password \ 20 | --env PG_ROOT_PASSWORD=password \ 21 | --env PGHOST=/tmp \ 22 | --name="${CONTAINER_NAME}" \ 23 | --hostname="${CONTAINER_NAME}" \ 24 | --detach "${CCP_IMAGE_PREFIX?}"/crunchy-postgres:"${CCP_IMAGE_TAG?}" 25 | -------------------------------------------------------------------------------- /examples/docker/pgbench-custom/cleanup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright 2016 - 2023 Crunchy Data Solutions, Inc. 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | echo "Cleaning up..." 17 | 18 | CONTAINER_NAME='pgbench-custom' 19 | 20 | docker stop ${CONTAINER_NAME?} 21 | docker rm -v ${CONTAINER_NAME?} 22 | -------------------------------------------------------------------------------- /examples/docker/pgbench-custom/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -u 3 | 4 | # Copyright 2016 - 2023 Crunchy Data Solutions, Inc. 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | 17 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 18 | 19 | $DIR/cleanup.sh 20 | 21 | docker run \ 22 | --volume=${DIR?}/configs:/pgconf \ 23 | -e PG_DATABASE=userdb \ 24 | -e PG_HOSTNAME=primary \ 25 | -e PG_PASSWORD=password \ 26 | -e PG_PORT=5432 \ 27 | -e PG_USERNAME=testuser \ 28 | --name=pgbench-custom \ 29 | --hostname=pgbench-custom \ 30 | --network=pgnet \ 31 | -d $CCP_IMAGE_PREFIX/crunchy-pgbench:$CCP_IMAGE_TAG 32 | -------------------------------------------------------------------------------- /examples/docker/pgbench/cleanup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright 2016 - 2023 Crunchy Data Solutions, Inc. 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | echo "Cleaning up..." 17 | 18 | CONTAINER_NAME='pgbench' 19 | 20 | docker stop ${CONTAINER_NAME?} 21 | docker rm -v ${CONTAINER_NAME?} 22 | -------------------------------------------------------------------------------- /examples/docker/pgbouncer/cleanup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright 2016 - 2023 Crunchy Data Solutions, Inc. 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | echo "Cleaning up..." 17 | 18 | docker stop pgbouncer-primary pgbouncer-replica pg-primary pg-replica 19 | docker rm -v pgbouncer-primary pgbouncer-replica pg-primary pg-replica 20 | docker network rm pgnet 21 | docker volume rm pg-primary pg-replica 22 | -------------------------------------------------------------------------------- /examples/docker/pgbouncer/env/pgbouncer-primary.list: -------------------------------------------------------------------------------- 1 | # Crunchy Container Env 2 | PGBOUNCER_PASSWORD=password 3 | PG_SERVICE=pg-primary 4 | -------------------------------------------------------------------------------- /examples/docker/pgbouncer/env/pgbouncer-replica.list: -------------------------------------------------------------------------------- 1 | # Crunchy Container Env 2 | PGBOUNCER_PASSWORD=password 3 | PG_SERVICE=pg-replica 4 | -------------------------------------------------------------------------------- /examples/docker/pgbouncer/env/pgsql-primary.list: -------------------------------------------------------------------------------- 1 | # Crunchy Container Env 2 | TEMP_BUFFERS=9MB 3 | PGHOST=/tmp 4 | MAX_CONNECTIONS=100 5 | SHARED_BUFFERS=128MB 6 | MAX_WAL_SENDERS=1 7 | WORK_MEM=5MB 8 | PG_MODE=primary 9 | PG_PRIMARY_USER=primaryuser 10 | PG_PRIMARY_PASSWORD=password 11 | PG_DATABASE=userdb 12 | PG_USER=testuser 13 | PG_PASSWORD=password 14 | PG_ROOT_PASSWORD=password 15 | PG_PRIMARY_PORT=5432 16 | PGBOUNCER_PASSWORD=password 17 | -------------------------------------------------------------------------------- /examples/docker/pgbouncer/env/pgsql-replica.list: -------------------------------------------------------------------------------- 1 | # Crunchy Container Env 2 | TEMP_BUFFERS=9MB 3 | PGHOST=/tmp 4 | MAX_CONNECTIONS=100 5 | SHARED_BUFFERS=128MB 6 | MAX_WAL_SENDERS=1 7 | WORK_MEM=5MB 8 | PG_MODE=replica 9 | PG_PRIMARY_USER=primaryuser 10 | PG_PRIMARY_PASSWORD=password 11 | PG_DATABASE=userdb 12 | PG_USER=testuser 13 | PG_PASSWORD=password 14 | PG_ROOT_PASSWORD=password 15 | PG_PRIMARY_HOST=pg-primary 16 | PG_PRIMARY_PORT=5432 17 | PGBOUNCER_PASSWORD=password 18 | -------------------------------------------------------------------------------- /examples/docker/pgdump/backup/cleanup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright 2018 - 2023 Crunchy Data Solutions, Inc. 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | echo "Cleaning up..." 17 | 18 | docker stop pgdump 19 | docker rm -v pgdump 20 | docker volume rm pgdump 21 | docker network rm pgnet 22 | -------------------------------------------------------------------------------- /examples/docker/pgdump/backup/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright 2018 - 2023 Crunchy Data Solutions, Inc. 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 17 | $DIR/cleanup.sh 18 | 19 | docker network create --driver bridge pgnet 20 | 21 | docker run \ 22 | -v backups:/pgdata \ 23 | -e PGDUMP_HOST=primary \ 24 | -e PGDUMP_DB=postgres \ 25 | -e PGDUMP_USER=postgres\ 26 | -e PGDUMP_PASS=password \ 27 | --name=pgdump \ 28 | --hostname=pgdump \ 29 | --network=pgnet \ 30 | -d $CCP_IMAGE_PREFIX/crunchy-pgdump:$CCP_IMAGE_TAG 31 | -------------------------------------------------------------------------------- /examples/docker/pgdump/pgrestore/cleanup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright 2018 - 2023 Crunchy Data Solutions, Inc. 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | echo "Cleaning up..." 17 | 18 | docker stop pgrestore 19 | docker rm pgrestore 20 | docker network rm pgnet 21 | -------------------------------------------------------------------------------- /examples/docker/pgdump/pgrestore/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright 2018 - 2023 Crunchy Data Solutions, Inc. 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 17 | $DIR/cleanup.sh 18 | 19 | docker network create --driver bridge pgnet 20 | 21 | docker run \ 22 | -v backups:/pgdata \ 23 | -e PGRESTORE_HOST=primary \ 24 | -e PGRESTORE_DB=postgres \ 25 | -e PGRESTORE_USER=postgres\ 26 | -e PGRESTORE_PASS=password \ 27 | --name=pgrestore \ 28 | --hostname=pgrestore \ 29 | --network=pgnet \ 30 | -d $CCP_IMAGE_PREFIX/crunchy-pgrestore:$CCP_IMAGE_TAG 31 | -------------------------------------------------------------------------------- /examples/docker/pgpool/cleanup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright 2016 - 2023 Crunchy Data Solutions, Inc. 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | echo "Cleaning up..." 17 | 18 | CONTAINER_NAME=pgpool 19 | 20 | docker stop $CONTAINER_NAME 21 | docker rm -v $CONTAINER_NAME 22 | -------------------------------------------------------------------------------- /examples/docker/postgres-gis/cleanup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright 2017 - 2023 Crunchy Data Solutions, Inc. 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | echo "Cleaning up example..." 17 | 18 | CONTAINER_NAME=postgres-gis 19 | VOLUME_NAME=${CONTAINER_NAME}-pgdata 20 | 21 | docker stop $CONTAINER_NAME 22 | docker rm -v $CONTAINER_NAME 23 | docker volume rm $VOLUME_NAME 24 | -------------------------------------------------------------------------------- /examples/docker/primary-replica/cleanup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright 2017 - 2023 Crunchy Data Solutions, Inc. 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | echo "Cleaning up..." 17 | 18 | PRIMARY_CONTAINER_NAME=primary 19 | PRIMARY_VOLUME_NAME=${PRIMARY_CONTAINER_NAME?}-pgdata 20 | 21 | REPLICA_CONTAINER_NAME=replica 22 | REPLICA_VOLUME_NAME=${REPLICA_CONTAINER_NAME?}-pgdata 23 | 24 | docker stop ${PRIMARY_CONTAINER_NAME?} 25 | docker rm -v ${PRIMARY_CONTAINER_NAME?} 26 | docker volume rm ${PRIMARY_VOLUME_NAME?} 27 | 28 | docker stop ${REPLICA_CONTAINER_NAME?} 29 | docker rm -v ${REPLICA_CONTAINER_NAME?} 30 | docker volume rm ${REPLICA_VOLUME_NAME?} 31 | -------------------------------------------------------------------------------- /examples/docker/primary/cleanup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright 2016 - 2023 Crunchy Data Solutions, Inc. 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | echo "Cleaning up..." 17 | 18 | CONTAINER_NAME=primary 19 | VOLUME_NAME=$CONTAINER_NAME-pgdata 20 | 21 | docker stop $CONTAINER_NAME 22 | docker rm -v $CONTAINER_NAME 23 | docker volume rm $VOLUME_NAME 24 | docker network rm pgnet 25 | -------------------------------------------------------------------------------- /examples/docker/swarm-service/README: -------------------------------------------------------------------------------- 1 | This example only works on a Docker Swarm of version 1.12 or 2 | greater. Please see link:https://docs.docker.com/engine/swarm/swarm-tutorial/create-swarm 3 | for details on setting up a test Docker Swarm cluster. 4 | 5 | This *run.sh* script is run on the Swarm Manager node. 6 | -------------------------------------------------------------------------------- /examples/docker/swarm-service/cleanup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright 2016 - 2023 Crunchy Data Solutions, Inc. 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | echo "Cleaning up..." 17 | 18 | docker stack rm pg-stack 19 | 20 | exit 0 21 | -------------------------------------------------------------------------------- /examples/docker/swarm-service/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright 2016 - 2023 Crunchy Data Solutions, Inc. 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | docker stack deploy --compose-file=./docker-compose.yml pg-stack 17 | 18 | exit 0 19 | -------------------------------------------------------------------------------- /examples/docker/sync/cleanup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright 2016 - 2023 Crunchy Data Solutions, Inc. 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | echo "Cleaning up..." 17 | 18 | PRIMARY_CONTAINER_NAME=primarysync 19 | SYNC_CONTAINER_NAME=replicasync 20 | ASYNC_CONTAINER_NAME=replicaasync 21 | 22 | docker stop $PRIMARY_CONTAINER_NAME 23 | docker rm $PRIMARY_CONTAINER_NAME 24 | 25 | docker stop $SYNC_CONTAINER_NAME 26 | docker rm $SYNC_CONTAINER_NAME 27 | 28 | docker stop $ASYNC_CONTAINER_NAME 29 | docker rm $ASYNC_CONTAINER_NAME 30 | -------------------------------------------------------------------------------- /examples/helm/custom-config/Chart.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | name: custom-config 3 | description: Deploys a basic single PostgreSQL primary database with custom configurations. 4 | version: 5.3.1 5 | appVersion: 5.3.1 6 | keywords: 7 | - postgresql 8 | - postgres 9 | - database 10 | - sql 11 | - custom-config 12 | home: https://www.crunchydata.com/ 13 | icon: https://www.crunchydata.com/images/logo.svg 14 | sources: 15 | - https://github.com/CrunchyData/crunchy-containers 16 | -------------------------------------------------------------------------------- /examples/helm/custom-config/configs/postgresql.conf: -------------------------------------------------------------------------------- 1 | listen_addresses = '*' # what IP address(es) to listen on; 2 | wal_level = hot_standby # minimal, archive, or hot_standby 3 | max_wal_senders = 10 # max number of walsender processes 4 | log_destination = 'stderr' 5 | logging_collector = off 6 | log_autovacuum_min_duration = 0 # -1 disables, 0 logs all actions and 7 | timezone = 'UTC' 8 | shared_preload_libraries = 'pg_stat_statements.so' 9 | -------------------------------------------------------------------------------- /examples/helm/custom-config/templates/NOTES.txt: -------------------------------------------------------------------------------- 1 | Thank you for installing {{ .Chart.Name }} chart. 2 | 3 | Your release is named {{ .Release.Name }}. 4 | 5 | To learn more about the release, try: 6 | 7 | $ helm status {{ .Release.Name }} 8 | $ helm get {{ .Release.Name }} 9 | -------------------------------------------------------------------------------- /examples/helm/custom-config/templates/custom-config-service.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: "{{.Values.container.name}}" 5 | labels: 6 | name: "{{.Values.container.name}}" 7 | heritage: {{ .Release.Service | quote }} 8 | release: {{ .Release.Name | quote }} 9 | chart: "{{.Chart.Name}}-{{.Chart.Version}}" 10 | spec: 11 | type: "{{.Values.serviceType}}" 12 | ports: 13 | - protocol: TCP 14 | port: {{.Values.container.port}} 15 | targetPort: {{.Values.container.port}} 16 | nodePort: 0 17 | name: postgres 18 | selector: 19 | name: "{{.Values.container.name}}" 20 | sessionAffinity: None 21 | -------------------------------------------------------------------------------- /examples/helm/custom-config/templates/custom-configmap.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ConfigMap 3 | metadata: 4 | name: "{{.Values.configMap.name}}" 5 | data: 6 | {{ (.Files.Glob "configs/*").AsConfig | indent 2 }} 7 | -------------------------------------------------------------------------------- /examples/helm/custom-config/values.yaml: -------------------------------------------------------------------------------- 1 | name: custom-config 2 | container: 3 | port: 5432 4 | name: custom-config 5 | credentials: 6 | primary: password 7 | root: password 8 | user: password 9 | serviceType: ClusterIP 10 | image: 11 | repository: crunchydata 12 | container: crunchy-postgres 13 | tag: ubi8-15.2-0 14 | resources: 15 | cpu: 200m 16 | memory: 512Mi 17 | configMap: 18 | name: custom-config 19 | -------------------------------------------------------------------------------- /examples/helm/primary-replica/Chart.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | name: primary-replica 3 | description: Deploy a basic crunchy primary and replica cluster 4 | version: 5.3.1 5 | appVersion: 5.3.1 6 | keywords: 7 | - postgresql 8 | - postgres 9 | - database 10 | - sql 11 | home: https://www.crunchydata.com/ 12 | icon: https://www.crunchydata.com/images/logo.svg 13 | sources: 14 | - https://github.com/CrunchyData/crunchy-containers 15 | -------------------------------------------------------------------------------- /examples/helm/primary-replica/templates/NOTES.txt: -------------------------------------------------------------------------------- 1 | Thank you for installing {{ .Chart.Name }} chart. 2 | 3 | Your release is named {{ .Release.Name }}. 4 | 5 | To learn more about the release, try: 6 | 7 | $ helm status {{ .Release.Name }} 8 | $ helm get {{ .Release.Name }} 9 | -------------------------------------------------------------------------------- /examples/helm/primary-replica/templates/pgprimary-secret.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Secret 3 | metadata: 4 | name: pgprimary-secret 5 | data: 6 | username: bWFzdGVy 7 | password: cGFzc3dvcmQ= 8 | -------------------------------------------------------------------------------- /examples/helm/primary-replica/templates/pgroot-secret.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Secret 3 | metadata: 4 | name: pgroot-secret 5 | data: 6 | username: cGd1c2VyMQ== 7 | password: cGFzc3dvcmQ= 8 | -------------------------------------------------------------------------------- /examples/helm/primary-replica/templates/pguser-secret.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Secret 3 | metadata: 4 | name: pguser-secret 5 | data: 6 | username: cGd1c2VyMQ== 7 | password: cGFzc3dvcmQ= 8 | -------------------------------------------------------------------------------- /examples/helm/primary-replica/templates/primary-pv.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: PersistentVolume 3 | metadata: 4 | name: {{.Values.pv.name}} 5 | spec: 6 | capacity: 7 | storage: {{.Values.pv.storage}} 8 | accessModes: 9 | - {{.Values.pv.mode}} 10 | hostPath: 11 | path: "{{.Values.pv.path}}" 12 | persistentVolumeReclaimPolicy: Retain 13 | -------------------------------------------------------------------------------- /examples/helm/primary-replica/templates/primary-pvc.yaml: -------------------------------------------------------------------------------- 1 | kind: PersistentVolumeClaim 2 | apiVersion: v1 3 | metadata: 4 | name: {{.Values.pvc.name}} 5 | spec: 6 | accessModes: 7 | - ReadWriteMany 8 | resources: 9 | requests: 10 | storage: {{.Values.pv.storage}} 11 | -------------------------------------------------------------------------------- /examples/helm/primary-replica/templates/primary-service.yaml: -------------------------------------------------------------------------------- 1 | # This is a service gateway to the replica set created by the deployment. 2 | # Take a look at the deployment.yaml for general notes about this chart. 3 | apiVersion: v1 4 | kind: Service 5 | metadata: 6 | name: "{{.Values.container.name.primary}}" 7 | labels: 8 | name: "{{.Values.container.name.primary}}" 9 | heritage: {{ .Release.Service | quote }} 10 | release: {{ .Release.Name | quote }} 11 | chart: "{{.Chart.Name}}-{{.Chart.Version}}" 12 | spec: 13 | type: "{{.Values.serviceType}}" 14 | ports: 15 | - port: {{.Values.container.port}} 16 | targetPort: {{.Values.container.port}} 17 | protocol: TCP 18 | name: postgres 19 | selector: 20 | name: "{{.Values.container.name.primary}}" 21 | -------------------------------------------------------------------------------- /examples/helm/primary-replica/templates/replica-service.yaml: -------------------------------------------------------------------------------- 1 | # This is a service gateway to the replica set created by the deployment. 2 | # Take a look at the deployment.yaml for general notes about this chart. 3 | apiVersion: v1 4 | kind: Service 5 | metadata: 6 | name: "{{.Values.container.name.replica}}" 7 | labels: 8 | name: "{{.Values.container.name.replica}}" 9 | heritage: {{ .Release.Service | quote }} 10 | release: {{ .Release.Name | quote }} 11 | chart: "{{.Chart.Name}}-{{.Chart.Version}}" 12 | spec: 13 | type: "{{.Values.serviceType}}" 14 | ports: 15 | - port: {{.Values.container.port}} 16 | targetPort: {{.Values.container.port}} 17 | protocol: TCP 18 | name: postgres 19 | selector: 20 | name: "{{.Values.container.name.replica}}" 21 | -------------------------------------------------------------------------------- /examples/helm/primary-replica/values.yaml: -------------------------------------------------------------------------------- 1 | name: primary-replica 2 | container: 3 | port: 5432 4 | name: 5 | primary: primary 6 | replica: replica 7 | credentials: 8 | primary: password 9 | root: password 10 | user: password 11 | serviceType: ClusterIP 12 | image: 13 | repository: crunchydata 14 | container: crunchy-postgres 15 | tag: ubi8-15.2-0 16 | pv: 17 | storage: 400M 18 | name: primary-pv 19 | mode: ReadWriteMany 20 | path: /data 21 | pvc: 22 | name: primary-pvc 23 | resources: 24 | cpu: 200m 25 | memory: 512Mi 26 | -------------------------------------------------------------------------------- /examples/helm/primary/Chart.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | name: basic 3 | description: Deploys a single PostgreSQL primary database 4 | version: 5.3.1 5 | appVersion: 5.3.1 6 | keywords: 7 | - postgresql 8 | - postgres 9 | - database 10 | - sql 11 | home: https://www.crunchydata.com/ 12 | icon: https://www.crunchydata.com/images/logo.svg 13 | sources: 14 | - https://github.com/CrunchyData/crunchy-containers 15 | -------------------------------------------------------------------------------- /examples/helm/primary/templates/NOTES.txt: -------------------------------------------------------------------------------- 1 | Thank you for installing {{ .Chart.Name }} chart. 2 | 3 | Your release is named {{ .Release.Name }}. 4 | 5 | To learn more about the release, try: 6 | 7 | $ helm status {{ .Release.Name }} 8 | $ helm get {{ .Release.Name }} 9 | -------------------------------------------------------------------------------- /examples/helm/primary/templates/basic-service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: "{{.Values.container.name}}" 5 | labels: 6 | name: "{{.Values.container.name}}" 7 | heritage: {{ .Release.Service | quote }} 8 | release: {{ .Release.Name | quote }} 9 | chart: "{{.Chart.Name}}-{{.Chart.Version}}" 10 | spec: 11 | type: "{{.Values.serviceType}}" 12 | ports: 13 | - protocol: TCP 14 | port: {{.Values.container.port}} 15 | targetPort: {{.Values.container.port}} 16 | nodePort: 0 17 | name: postgres 18 | selector: 19 | name: "{{.Values.container.name}}" 20 | sessionAffinity: None 21 | -------------------------------------------------------------------------------- /examples/helm/primary/values.yaml: -------------------------------------------------------------------------------- 1 | name: primary 2 | container: 3 | port: 5432 4 | name: primary 5 | credentials: 6 | primary: password 7 | root: password 8 | user: password 9 | serviceType: ClusterIP 10 | image: 11 | repository: crunchydata 12 | container: crunchy-postgres 13 | tag: ubi8-15.2-0 14 | resources: 15 | cpu: 200m 16 | memory: 512Mi 17 | -------------------------------------------------------------------------------- /examples/helm/template-small/Chart.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | name: template-small 3 | description: The Crunchy template-small configuration includes a single primary with limited CPU and memory, suitable for development purposes. 4 | version: 5.3.1 5 | appVersion: 5.3.1 6 | keywords: 7 | - postgresql 8 | - postgres 9 | - database 10 | - sql 11 | home: https://www.crunchydata.com/ 12 | icon: https://www.crunchydata.com/images/logo.svg 13 | sources: 14 | - https://github.com/CrunchyData/crunchy-containers 15 | -------------------------------------------------------------------------------- /examples/helm/template-small/templates/NOTES.txt: -------------------------------------------------------------------------------- 1 | Thank you for installing {{ .Chart.Name }} chart. 2 | 3 | Your release is named {{ .Release.Name }}. 4 | 5 | To learn more about the release, try: 6 | 7 | $ helm status {{ .Release.Name }} 8 | $ helm get {{ .Release.Name }} 9 | -------------------------------------------------------------------------------- /examples/helm/template-small/templates/service.yaml: -------------------------------------------------------------------------------- 1 | kind: Service 2 | apiVersion: v1 3 | metadata: 4 | name: "{{.Values.container.name.primary}}" 5 | labels: 6 | name: "{{.Values.container.name.primary}}" 7 | heritage: {{ .Release.Service | quote }} 8 | release: {{ .Release.Name | quote }} 9 | chart: "{{.Chart.Name}}-{{.Chart.Version}}" 10 | spec: 11 | type: "{{.Values.serviceType}}" 12 | ports: 13 | - protocol: TCP 14 | port: {{.Values.container.port}} 15 | targetPort: {{.Values.container.port}} 16 | nodePort: 0 17 | selector: 18 | name: "{{.Values.container.name.primary}}" 19 | sessionAffinity: None 20 | -------------------------------------------------------------------------------- /examples/helm/template-small/values.yaml: -------------------------------------------------------------------------------- 1 | name: template-small 2 | container: 3 | port: 5432 4 | name: 5 | default: template-small 6 | primary: primary 7 | credentials: 8 | primary: password 9 | root: password 10 | user: password 11 | serviceType: ClusterIP 12 | image: 13 | repository: crunchydata 14 | container: crunchy-postgres 15 | tag: ubi8-15.2-0 16 | resources: 17 | cpu: 200m 18 | memory: 512Mi 19 | persistence: 20 | accessModes: ReadWriteMany 21 | -------------------------------------------------------------------------------- /examples/kube/backrest/async-archiving/backrest-async-archive-pvc-sc.json: -------------------------------------------------------------------------------- 1 | { 2 | "kind": "PersistentVolumeClaim", 3 | "apiVersion": "v1", 4 | "metadata": { 5 | "name": "br-aa-pgdata", 6 | "labels": { 7 | "cleanup": "$CCP_NAMESPACE-backrest-async-archive" 8 | } 9 | }, 10 | "spec": { 11 | "accessModes": [ 12 | "$CCP_STORAGE_MODE" 13 | ], 14 | "storageClassName": "$CCP_STORAGE_CLASS", 15 | "resources": { 16 | "requests": { 17 | "storage": "$CCP_STORAGE_CAPACITY" 18 | } 19 | } 20 | } 21 | } 22 | 23 | { 24 | "kind": "PersistentVolumeClaim", 25 | "apiVersion": "v1", 26 | "metadata": { 27 | "name": "br-aa-backups", 28 | "labels": { 29 | "cleanup": "$CCP_NAMESPACE-backrest-async-archive" 30 | } 31 | }, 32 | "spec": { 33 | "accessModes": [ 34 | "$CCP_STORAGE_MODE" 35 | ], 36 | "storageClassName": "$CCP_STORAGE_CLASS", 37 | "resources": { 38 | "requests": { 39 | "storage": "$CCP_STORAGE_CAPACITY" 40 | } 41 | } 42 | } 43 | } -------------------------------------------------------------------------------- /examples/kube/backrest/async-archiving/cleanup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright 2016 - 2023 Crunchy Data Solutions, Inc. 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | source ${CCPROOT}/examples/common.sh 16 | echo_info "Cleaning up.." 17 | 18 | cleanup "${CCP_NAMESPACE?}-backrest-async-archive" 19 | 20 | $CCPROOT/examples/waitforterm.sh backrest-async-archive ${CCP_CLI?} 21 | 22 | dir_check_rm "backrest-async-archive" 23 | -------------------------------------------------------------------------------- /examples/kube/backrest/async-archiving/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright 2016 - 2023 Crunchy Data Solutions, Inc. 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | source ${CCPROOT}/examples/common.sh 16 | 17 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 18 | 19 | # This var lets us change the image to gis by setting 20 | # CCP_PG_IMAGE='-gis'. 21 | export CCP_PG_IMAGE=${CCP_PG_IMAGE:-} 22 | 23 | ${DIR}/cleanup.sh 24 | 25 | create_storage "backrest-async-archive" 26 | if [[ $? -ne 0 ]] 27 | then 28 | echo_err "Failed to create storage, exiting.." 29 | exit 1 30 | fi 31 | 32 | cat $DIR/backrest.json | envsubst | ${CCP_CLI?} create --namespace=${CCP_NAMESPACE?} -f - 33 | -------------------------------------------------------------------------------- /examples/kube/backrest/backup/backrest-pvc-sc.json: -------------------------------------------------------------------------------- 1 | { 2 | "kind": "PersistentVolumeClaim", 3 | "apiVersion": "v1", 4 | "metadata": { 5 | "name": "br-pgdata", 6 | "labels": { 7 | "cleanup": "$CCP_NAMESPACE-backrest" 8 | } 9 | }, 10 | "spec": { 11 | "accessModes": [ 12 | "$CCP_STORAGE_MODE" 13 | ], 14 | "storageClassName": "$CCP_STORAGE_CLASS", 15 | "resources": { 16 | "requests": { 17 | "storage": "$CCP_STORAGE_CAPACITY" 18 | } 19 | } 20 | } 21 | } 22 | 23 | { 24 | "kind": "PersistentVolumeClaim", 25 | "apiVersion": "v1", 26 | "metadata": { 27 | "name": "br-backups", 28 | "labels": { 29 | "cleanup": "$CCP_NAMESPACE-backrest" 30 | } 31 | }, 32 | "spec": { 33 | "accessModes": [ 34 | "$CCP_STORAGE_MODE" 35 | ], 36 | "storageClassName": "$CCP_STORAGE_CLASS", 37 | "resources": { 38 | "requests": { 39 | "storage": "$CCP_STORAGE_CAPACITY" 40 | } 41 | } 42 | } 43 | } -------------------------------------------------------------------------------- /examples/kube/backrest/backup/cleanup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright 2016 - 2023 Crunchy Data Solutions, Inc. 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | source ${CCPROOT}/examples/common.sh 16 | echo_info "Cleaning up.." 17 | 18 | cleanup "${CCP_NAMESPACE?}-backrest" 19 | 20 | $CCPROOT/examples/waitforterm.sh backrest ${CCP_CLI?} 21 | 22 | dir_check_rm "backrest" 23 | -------------------------------------------------------------------------------- /examples/kube/backrest/backup/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright 2016 - 2023 Crunchy Data Solutions, Inc. 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | source ${CCPROOT}/examples/common.sh 16 | 17 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 18 | 19 | ${DIR}/cleanup.sh 20 | 21 | # This var lets us change the image to gis by setting 22 | # CCP_PG_IMAGE='-gis'. 23 | export CCP_PG_IMAGE=${CCP_PG_IMAGE:-} 24 | 25 | create_storage "backrest" 26 | if [[ $? -ne 0 ]] 27 | then 28 | echo_err "Failed to create storage, exiting.." 29 | exit 1 30 | fi 31 | 32 | cat $DIR/backrest.json | envsubst | ${CCP_CLI?} create --namespace=${CCP_NAMESPACE?} -f - 33 | -------------------------------------------------------------------------------- /examples/kube/backrest/delta/cleanup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright 2016 - 2023 Crunchy Data Solutions, Inc. 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | source ${CCPROOT}/examples/common.sh 16 | echo_info "Cleaning up.." 17 | 18 | cleanup "$CCP_NAMESPACE-backrest-delta-restore" 19 | 20 | # Cleanup backrest pods if they're running from backup examples 21 | ${CCP_CLI?} delete --namespace=${CCP_NAMESPACE?} deployment,service backrest 22 | 23 | $CCPROOT/examples/waitforterm.sh backrest-delta-restored ${CCP_CLI?} 24 | -------------------------------------------------------------------------------- /examples/kube/backrest/delta/post-restore.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright 2016 - 2023 Crunchy Data Solutions, Inc. 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | source ${CCPROOT}/examples/common.sh 16 | 17 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 18 | 19 | # This var lets us change the image to gis by setting 20 | # CCP_PG_IMAGE='-gis'. 21 | export CCP_PG_IMAGE=${CCP_PG_IMAGE:-} 22 | 23 | cat $DIR/backrest-restored.json | envsubst | ${CCP_CLI?} create --namespace=${CCP_NAMESPACE?} -f - 24 | -------------------------------------------------------------------------------- /examples/kube/backrest/full/backrest-full-restored-pv-nfs.json: -------------------------------------------------------------------------------- 1 | { 2 | "apiVersion": "v1", 3 | "kind": "PersistentVolume", 4 | "metadata": { 5 | "name": "$CCP_NAMESPACE-br-new-pgdata", 6 | "labels": { 7 | "name": "$CCP_NAMESPACE-br-new-pgdata", 8 | "cleanup": "$CCP_NAMESPACE-backrest-full-restore" 9 | } 10 | }, 11 | "spec": { 12 | "capacity": { 13 | "storage": "$CCP_STORAGE_CAPACITY" 14 | }, 15 | "accessModes": [ 16 | "$CCP_STORAGE_MODE" 17 | ], 18 | "nfs": { 19 | "path": "$CCP_STORAGE_PATH/$CCP_NAMESPACE-backrest-full-restored", 20 | "server": "$CCP_NFS_IP" 21 | }, 22 | "persistentVolumeReclaimPolicy": "Retain" 23 | } 24 | } -------------------------------------------------------------------------------- /examples/kube/backrest/full/backrest-full-restored-pv.json: -------------------------------------------------------------------------------- 1 | { 2 | "apiVersion": "v1", 3 | "kind": "PersistentVolume", 4 | "metadata": { 5 | "name": "$CCP_NAMESPACE-br-new-pgdata", 6 | "labels": { 7 | "name": "$CCP_NAMESPACE-br-new-pgdata", 8 | "cleanup": "$CCP_NAMESPACE-backrest-full-restore" 9 | } 10 | }, 11 | "spec": { 12 | "capacity": { 13 | "storage": "$CCP_STORAGE_CAPACITY" 14 | }, 15 | "accessModes": [ 16 | "$CCP_STORAGE_MODE" 17 | ], 18 | "hostPath": { 19 | "path": "$CCP_STORAGE_PATH/$CCP_NAMESPACE-backrest-full-restored" 20 | }, 21 | "persistentVolumeReclaimPolicy": "Retain" 22 | } 23 | } -------------------------------------------------------------------------------- /examples/kube/backrest/full/backrest-full-restored-pvc-sc.json: -------------------------------------------------------------------------------- 1 | { 2 | "kind": "PersistentVolumeClaim", 3 | "apiVersion": "v1", 4 | "metadata": { 5 | "name": "br-new-pgdata", 6 | "labels": { 7 | "cleanup": "$CCP_NAMESPACE-backrest-full-restore" 8 | } 9 | }, 10 | "spec": { 11 | "accessModes": [ 12 | "$CCP_STORAGE_MODE" 13 | ], 14 | "storageClassName": "$CCP_STORAGE_CLASS", 15 | "resources": { 16 | "requests": { 17 | "storage": "$CCP_STORAGE_CAPACITY" 18 | } 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /examples/kube/backrest/full/backrest-full-restored-pvc.json: -------------------------------------------------------------------------------- 1 | { 2 | "kind": "PersistentVolumeClaim", 3 | "apiVersion": "v1", 4 | "metadata": { 5 | "name": "br-new-pgdata", 6 | "labels": { 7 | "cleanup": "$CCP_NAMESPACE-backrest-full-restore" 8 | } 9 | }, 10 | "spec": { 11 | "selector": { 12 | "matchLabels": { 13 | "name": "$CCP_NAMESPACE-br-new-pgdata" 14 | } 15 | }, 16 | "accessModes": [ 17 | "$CCP_STORAGE_MODE" 18 | ], 19 | "resources": { 20 | "requests": { 21 | "storage": "$CCP_STORAGE_CAPACITY" 22 | } 23 | } 24 | } 25 | } -------------------------------------------------------------------------------- /examples/kube/backrest/full/cleanup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright 2016 - 2023 Crunchy Data Solutions, Inc. 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | source ${CCPROOT}/examples/common.sh 16 | echo_info "Cleaning up.." 17 | 18 | cleanup "$CCP_NAMESPACE-backrest-full-restore" 19 | 20 | ${CCP_CLI?} delete --namespace=${CCP_NAMESPACE?} deployment,service backrest 21 | 22 | $CCPROOT/examples/waitforterm.sh backrest-full-restored ${CCP_CLI?} 23 | 24 | dir_check_rm "backrest-full-restored" 25 | -------------------------------------------------------------------------------- /examples/kube/backrest/full/post-restore.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright 2016 - 2023 Crunchy Data Solutions, Inc. 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | source ${CCPROOT}/examples/common.sh 16 | 17 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 18 | 19 | # This var lets us change the image to gis by setting 20 | # CCP_PG_IMAGE='-gis'. 21 | export CCP_PG_IMAGE=${CCP_PG_IMAGE:-} 22 | 23 | cat $DIR/backrest-restored.json | envsubst | ${CCP_CLI?} create --namespace=${CCP_NAMESPACE?} -f - 24 | -------------------------------------------------------------------------------- /examples/kube/backrest/pitr/cleanup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright 2016 - 2023 Crunchy Data Solutions, Inc. 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | source ${CCPROOT}/examples/common.sh 16 | echo_info "Cleaning up.." 17 | 18 | cleanup "$CCP_NAMESPACE-backrest-pitr-restore" 19 | 20 | ${CCP_CLI?} delete --namespace=${CCP_NAMESPACE?} deployment,service backrest 21 | 22 | $CCPROOT/examples/waitforterm.sh backrest-pitr-restored ${CCP_CLI?} 23 | -------------------------------------------------------------------------------- /examples/kube/backrest/pitr/post-restore.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright 2016 - 2023 Crunchy Data Solutions, Inc. 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | source ${CCPROOT}/examples/common.sh 16 | 17 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 18 | 19 | # This var lets us change the image to gis by setting 20 | # CCP_PG_IMAGE='-gis'. 21 | export CCP_PG_IMAGE=${CCP_PG_IMAGE:-} 22 | 23 | cat $DIR/backrest-restored.json | envsubst | ${CCP_CLI?} create --namespace=${CCP_NAMESPACE?} -f - 24 | -------------------------------------------------------------------------------- /examples/kube/centralized-logging/efk/cleanup-rbac.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright 2016 - 2023 Crunchy Data Solutions, Inc. 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | source ${CCPROOT}/examples/common.sh 17 | echo_info "Cleaning up RBAC.." 18 | 19 | ${CCP_CLI?} delete --namespace=kube-system \ 20 | clusterrolebinding,clusterrole \ 21 | --selector=k8s-app=elasticsearch-logging 22 | 23 | ${CCP_CLI?} delete --namespace=kube-system \ 24 | clusterrolebinding,clusterrole \ 25 | --selector=k8s-app=fluentd-es 26 | 27 | ${CCP_CLI?} delete --namespace=kube-system \ 28 | clusterrolebinding,clusterrole \ 29 | --selector=k8s-app=kibana-logging 30 | -------------------------------------------------------------------------------- /examples/kube/centralized-logging/efk/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright 2016 - 2023 Crunchy Data Solutions, Inc. 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | source ${CCPROOT}/examples/common.sh 16 | 17 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 18 | 19 | ${DIR}/cleanup.sh 20 | 21 | ${CCP_CLI?} create -f ${DIR?}/elasticsearch-statefulset.yaml 22 | ${CCP_CLI?} create -f ${DIR?}/fluentd-configmap.yaml 23 | ${CCP_CLI?} create -f ${DIR?}/fluentd-daemonset.yaml 24 | ${CCP_CLI?} create -f ${DIR?}/kibana-deployment.yaml 25 | -------------------------------------------------------------------------------- /examples/kube/centralized-logging/postgres-cluster/cleanup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright 2017 - 2023 Crunchy Data Solutions, Inc. 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | source ${CCPROOT}/examples/common.sh 16 | echo_info "Cleaning up.." 17 | 18 | cleanup "${CCP_NAMESPACE?}-postgres-cluster" 19 | 20 | dir_check_rm "postgres-cluster" 21 | -------------------------------------------------------------------------------- /examples/kube/centralized-logging/postgres-cluster/configs/postgresql.conf: -------------------------------------------------------------------------------- 1 | listen_addresses = '*' # what IP address(es) to listen on; 2 | wal_level = hot_standby # minimal, archive, or hot_standby 3 | max_wal_senders = 10 # max number of walsender processes 4 | log_destination = 'stderr' 5 | logging_collector = off 6 | log_autovacuum_min_duration = 0 # -1 disables, 0 logs all actions and 7 | timezone = 'UTC' 8 | shared_preload_libraries = 'pg_stat_statements.so' 9 | -------------------------------------------------------------------------------- /examples/kube/centralized-logging/postgres-cluster/postgres-cluster-pvc-sc.json: -------------------------------------------------------------------------------- 1 | { 2 | "kind": "PersistentVolumeClaim", 3 | "apiVersion": "v1", 4 | "metadata": { 5 | "name": "primary-deployment-pgdata", 6 | "labels": { 7 | "cleanup": "$CCP_NAMESPACE-postgres-cluster" 8 | } 9 | }, 10 | "spec": { 11 | "accessModes": [ 12 | "$CCP_STORAGE_MODE" 13 | ], 14 | "storageClassName": "$CCP_STORAGE_CLASS", 15 | "resources": { 16 | "requests": { 17 | "storage": "$CCP_STORAGE_CAPACITY" 18 | } 19 | } 20 | } 21 | } 22 | 23 | { 24 | "kind": "PersistentVolumeClaim", 25 | "apiVersion": "v1", 26 | "metadata": { 27 | "name": "replica-deployment-pgdata", 28 | "labels": { 29 | "cleanup": "$CCP_NAMESPACE-postgres-cluster" 30 | } 31 | }, 32 | "spec": { 33 | "accessModes": [ 34 | "$CCP_STORAGE_MODE" 35 | ], 36 | "storageClassName": "$CCP_STORAGE_CLASS", 37 | "resources": { 38 | "requests": { 39 | "storage": "$CCP_STORAGE_CAPACITY" 40 | } 41 | } 42 | } 43 | } -------------------------------------------------------------------------------- /examples/kube/custom-config-ssl/configs/pg_hba.conf: -------------------------------------------------------------------------------- 1 | # TYPE DATABASE USER ADDRESS METHOD 2 | 3 | # "local" is for Unix domain socket connections only 4 | local all postgres trust 5 | local all testuser trust 6 | hostssl replication replication 0.0.0.0/0 cert clientcert=1 7 | hostssl replication replication 127.0.0.1/32 cert clientcert=1 8 | # IPv4 local connections: 9 | hostssl all testuser 127.0.0.1/32 cert clientcert=1 map=ssl-testuser 10 | hostssl all testuser 0.0.0.0/0 cert clientcert=1 map=ssl-testuser 11 | hostssl all all 127.0.0.1/32 cert clientcert=1 12 | hostssl all all 0.0.0.0/0 cert clientcert=1 13 | -------------------------------------------------------------------------------- /examples/kube/custom-config-ssl/configs/pg_ident.conf: -------------------------------------------------------------------------------- 1 | ssl-testuser testuser@crunchydata.com testuser 2 | -------------------------------------------------------------------------------- /examples/kube/custom-config-ssl/configs/postgresql.conf: -------------------------------------------------------------------------------- 1 | listen_addresses = '*' # what IP address(es) to listen on; 2 | ssl = on # (change requires restart) 3 | ssl_cert_file = 'server.crt' # (change requires restart) 4 | ssl_key_file = 'server.key' # (change requires restart) 5 | ssl_ca_file = 'ca.crt' # (change requires restart) 6 | ssl_crl_file = 'ca.crl' # (change requires restart) 7 | wal_level = hot_standby # minimal, archive, or hot_standby 8 | max_wal_senders = 10 # max number of walsender processes 9 | log_destination = 'stderr' 10 | logging_collector = off 11 | log_min_duration_statement = 0 12 | log_autovacuum_min_duration = 0 # -1 disables, 0 logs all actions and 13 | timezone = 'UTC' 14 | shared_preload_libraries = 'pgaudit.so,pg_stat_statements.so' 15 | pgaudit.log = 'write, ddl' 16 | pgaudit.log_relation = on 17 | -------------------------------------------------------------------------------- /examples/kube/custom-config-ssl/custom-config-ssl-pvc-sc.json: -------------------------------------------------------------------------------- 1 | { 2 | "kind": "PersistentVolumeClaim", 3 | "apiVersion": "v1", 4 | "metadata": { 5 | "name": "custom-config-ssl-pgdata", 6 | "labels": { 7 | "cleanup": "$CCP_NAMESPACE-custom-config-ssl" 8 | } 9 | }, 10 | "spec": { 11 | "accessModes": [ 12 | "$CCP_STORAGE_MODE" 13 | ], 14 | "storageClassName": "$CCP_STORAGE_CLASS", 15 | "resources": { 16 | "requests": { 17 | "storage": "$CCP_STORAGE_CAPACITY" 18 | } 19 | } 20 | } 21 | } 22 | 23 | { 24 | "kind": "PersistentVolumeClaim", 25 | "apiVersion": "v1", 26 | "metadata": { 27 | "name": "custom-config-ssl-backrestrepo", 28 | "labels": { 29 | "cleanup": "$CCP_NAMESPACE-custom-config-ssl" 30 | } 31 | }, 32 | "spec": { 33 | "accessModes": [ 34 | "$CCP_STORAGE_MODE" 35 | ], 36 | "storageClassName": "$CCP_STORAGE_CLASS", 37 | "resources": { 38 | "requests": { 39 | "storage": "$CCP_STORAGE_CAPACITY" 40 | } 41 | } 42 | } 43 | } -------------------------------------------------------------------------------- /examples/kube/custom-config/cleanup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright 2018 - 2023 Crunchy Data Solutions, Inc. 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | source ${CCPROOT}/examples/common.sh 17 | echo_info "Cleaning up.." 18 | 19 | cleanup "${CCP_NAMESPACE?}-custom-config" 20 | 21 | $CCPROOT/examples/waitforterm.sh custom-config ${CCP_CLI?} 22 | 23 | dir_check_rm "custom-config" 24 | -------------------------------------------------------------------------------- /examples/kube/custom-config/configs/post-start-hook.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # This file is sourced by the start.sh script. Changes made to environment 4 | # variables or adding environment variables will take effect in the shell 5 | # postgres is running in. Anything added to this file will be executed 6 | # after the database has been started. 7 | 8 | echo_info "Executing post-start-hook..." # add below this line 9 | -------------------------------------------------------------------------------- /examples/kube/custom-config/configs/postgresql.conf: -------------------------------------------------------------------------------- 1 | listen_addresses = '*' 2 | wal_level = hot_standby 3 | max_wal_senders = 10 4 | log_destination = 'stderr' 5 | logging_collector = off 6 | log_min_duration_statement = 0 7 | log_autovacuum_min_duration = 0 8 | timezone = 'UTC' 9 | shared_preload_libraries = 'pg_stat_statements.so' 10 | -------------------------------------------------------------------------------- /examples/kube/custom-config/configs/pre-start-hook.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # This file is sourced by the start.sh script. Changes made to environment 4 | # variables or adding environment variables will take effect in the shell 5 | # postgres is running in. Anything added to this file will be executed 6 | # prior to the start of the postgres server 7 | 8 | echo_info "Executing pre-start-hook..." # add below this line 9 | -------------------------------------------------------------------------------- /examples/kube/pgadmin4-http/cleanup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright 2018 - 2023 Crunchy Data Solutions, Inc. 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | source ${CCPROOT}/examples/common.sh 16 | echo_info "Cleaning up.." 17 | 18 | cleanup "${CCP_NAMESPACE?}-pgadmin4-http" 19 | 20 | $CCPROOT/examples/waitforterm.sh pgadmin4-http ${CCP_CLI?} 21 | 22 | dir_check_rm "pgadmin4-http" 23 | -------------------------------------------------------------------------------- /examples/kube/pgadmin4-http/pgadmin4-http-pv-nfs.json: -------------------------------------------------------------------------------- 1 | { 2 | "apiVersion": "v1", 3 | "kind": "PersistentVolume", 4 | "metadata": { 5 | "name": "$CCP_NAMESPACE-pgadmin4-http-data", 6 | "labels": { 7 | "name": "$CCP_NAMESPACE-pgadmin4-http-data", 8 | "cleanup": "$CCP_NAMESPACE-pgadmin4-http" 9 | } 10 | }, 11 | "spec": { 12 | "capacity": { 13 | "storage": "$CCP_STORAGE_CAPACITY" 14 | }, 15 | "accessModes": [ 16 | "$CCP_STORAGE_MODE" 17 | ], 18 | "nfs": { 19 | "path": "$CCP_STORAGE_PATH/$CCP_NAMESPACE-pgadmin4-http", 20 | "server": "$CCP_NFS_IP" 21 | }, 22 | "persistentVolumeReclaimPolicy": "Retain" 23 | } 24 | } -------------------------------------------------------------------------------- /examples/kube/pgadmin4-http/pgadmin4-http-pv.json: -------------------------------------------------------------------------------- 1 | { 2 | "apiVersion": "v1", 3 | "kind": "PersistentVolume", 4 | "metadata": { 5 | "name": "$CCP_NAMESPACE-pgadmin4-http-data", 6 | "labels": { 7 | "name": "$CCP_NAMESPACE-pgadmin4-http-data", 8 | "cleanup": "$CCP_NAMESPACE-pgadmin4-http" 9 | } 10 | }, 11 | "spec": { 12 | "capacity": { 13 | "storage": "$CCP_STORAGE_CAPACITY" 14 | }, 15 | "accessModes": [ 16 | "$CCP_STORAGE_MODE" 17 | ], 18 | "hostPath": { 19 | "path": "$CCP_STORAGE_PATH/$CCP_NAMESPACE-pgadmin4-http" 20 | }, 21 | "persistentVolumeReclaimPolicy": "Retain" 22 | } 23 | } -------------------------------------------------------------------------------- /examples/kube/pgadmin4-http/pgadmin4-http-pvc-sc.json: -------------------------------------------------------------------------------- 1 | { 2 | "kind": "PersistentVolumeClaim", 3 | "apiVersion": "v1", 4 | "metadata": { 5 | "name": "pgadmin4-http-data", 6 | "labels": { 7 | "cleanup": "$CCP_NAMESPACE-pgadmin4-http" 8 | } 9 | }, 10 | "spec": { 11 | "accessModes": [ 12 | "$CCP_STORAGE_MODE" 13 | ], 14 | "storageClassName": "$CCP_STORAGE_CLASS", 15 | "resources": { 16 | "requests": { 17 | "storage": "$CCP_STORAGE_CAPACITY" 18 | } 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /examples/kube/pgadmin4-http/pgadmin4-http-pvc.json: -------------------------------------------------------------------------------- 1 | { 2 | "kind": "PersistentVolumeClaim", 3 | "apiVersion": "v1", 4 | "metadata": { 5 | "name": "pgadmin4-http-data", 6 | "labels": { 7 | "cleanup": "$CCP_NAMESPACE-pgadmin4-http" 8 | } 9 | }, 10 | "spec": { 11 | "selector": { 12 | "matchLabels": { 13 | "name": "$CCP_NAMESPACE-pgadmin4-http-data" 14 | } 15 | }, 16 | "accessModes": [ 17 | "$CCP_STORAGE_MODE" 18 | ], 19 | "resources": { 20 | "requests": { 21 | "storage": "$CCP_STORAGE_CAPACITY" 22 | } 23 | } 24 | } 25 | } -------------------------------------------------------------------------------- /examples/kube/pgadmin4-https/cleanup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright 2018 - 2023 Crunchy Data Solutions, Inc. 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | source ${CCPROOT}/examples/common.sh 16 | 17 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 18 | echo_info "Cleaning up.." 19 | 20 | rm -f ${DIR?}/server.crt ${DIR?}/server.key ${DIR?}/privkey.pem 21 | 22 | cleanup "$CCP_NAMESPACE-pgadmin4-https" 23 | $CCPROOT/examples/waitforterm.sh pgadmin4-https ${CCP_CLI?} 24 | 25 | dir_check_rm "pgadmin4-https" 26 | -------------------------------------------------------------------------------- /examples/kube/pgadmin4-https/pgadmin4-https-pv-nfs.json: -------------------------------------------------------------------------------- 1 | { 2 | "apiVersion": "v1", 3 | "kind": "PersistentVolume", 4 | "metadata": { 5 | "name": "$CCP_NAMESPACE-pgadmin4-https-data", 6 | "labels": { 7 | "name": "$CCP_NAMESPACE-pgadmin4-https-data", 8 | "cleanup": "$CCP_NAMESPACE-pgadmin4-https" 9 | } 10 | }, 11 | "spec": { 12 | "capacity": { 13 | "storage": "$CCP_STORAGE_CAPACITY" 14 | }, 15 | "accessModes": [ 16 | "$CCP_STORAGE_MODE" 17 | ], 18 | "nfs": { 19 | "path": "$CCP_STORAGE_PATH/$CCP_NAMESPACE-pgadmin4-https", 20 | "server": "$CCP_NFS_IP" 21 | }, 22 | "persistentVolumeReclaimPolicy": "Retain" 23 | } 24 | } -------------------------------------------------------------------------------- /examples/kube/pgadmin4-https/pgadmin4-https-pv.json: -------------------------------------------------------------------------------- 1 | { 2 | "apiVersion": "v1", 3 | "kind": "PersistentVolume", 4 | "metadata": { 5 | "name": "$CCP_NAMESPACE-pgadmin4-https-data", 6 | "labels": { 7 | "name": "$CCP_NAMESPACE-pgadmin4-https-data", 8 | "cleanup": "$CCP_NAMESPACE-pgadmin4-https" 9 | } 10 | }, 11 | "spec": { 12 | "capacity": { 13 | "storage": "$CCP_STORAGE_CAPACITY" 14 | }, 15 | "accessModes": [ 16 | "$CCP_STORAGE_MODE" 17 | ], 18 | "hostPath": { 19 | "path": "$CCP_STORAGE_PATH/$CCP_NAMESPACE-pgadmin4-https" 20 | }, 21 | "persistentVolumeReclaimPolicy": "Retain" 22 | } 23 | } -------------------------------------------------------------------------------- /examples/kube/pgadmin4-https/pgadmin4-https-pvc-sc.json: -------------------------------------------------------------------------------- 1 | { 2 | "kind": "PersistentVolumeClaim", 3 | "apiVersion": "v1", 4 | "metadata": { 5 | "name": "pgadmin4-https-data", 6 | "labels": { 7 | "cleanup": "$CCP_NAMESPACE-pgadmin4-https" 8 | } 9 | }, 10 | "spec": { 11 | "accessModes": [ 12 | "$CCP_STORAGE_MODE" 13 | ], 14 | "storageClassName": "$CCP_STORAGE_CLASS", 15 | "resources": { 16 | "requests": { 17 | "storage": "$CCP_STORAGE_CAPACITY" 18 | } 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /examples/kube/pgadmin4-https/pgadmin4-https-pvc.json: -------------------------------------------------------------------------------- 1 | { 2 | "kind": "PersistentVolumeClaim", 3 | "apiVersion": "v1", 4 | "metadata": { 5 | "name": "pgadmin4-https-data", 6 | "labels": { 7 | "cleanup": "$CCP_NAMESPACE-pgadmin4-https" 8 | } 9 | }, 10 | "spec": { 11 | "selector": { 12 | "matchLabels": { 13 | "name": "$CCP_NAMESPACE-pgadmin4-https-data" 14 | } 15 | }, 16 | "accessModes": [ 17 | "$CCP_STORAGE_MODE" 18 | ], 19 | "resources": { 20 | "requests": { 21 | "storage": "$CCP_STORAGE_CAPACITY" 22 | } 23 | } 24 | } 25 | } -------------------------------------------------------------------------------- /examples/kube/pgaudit/cleanup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright 2018 - 2023 Crunchy Data Solutions, Inc. 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | source ${CCPROOT}/examples/common.sh 16 | echo_info "Cleaning up.." 17 | 18 | cleanup "${CCP_NAMESPACE?}-pgaudit" 19 | 20 | $CCPROOT/examples/waitforterm.sh pgaudit ${CCP_CLI?} ${CCP_NAMESPACE} 21 | -------------------------------------------------------------------------------- /examples/kube/pgaudit/configs/pgaudit-test.sql: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 - 2023 Crunchy Data Solutions, Inc. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | DROP TABLE IF EXISTS t_random; 17 | CREATE TABLE t_random AS SELECT s, md5(random()::text) FROM generate_series(1,50) s; 18 | -------------------------------------------------------------------------------- /examples/kube/pgaudit/configs/postgresql.conf: -------------------------------------------------------------------------------- 1 | listen_addresses = '*' # what IP address(es) to listen on; 2 | wal_level = hot_standby # minimal, archive, or hot_standby 3 | max_wal_senders = 10 # max number of walsender processes 4 | log_destination = 'stderr' 5 | logging_collector = off 6 | log_min_duration_statement = 0 7 | log_autovacuum_min_duration = 0 # -1 disables, 0 logs all actions and 8 | timezone = 'UTC' 9 | shared_preload_libraries = 'pgaudit.so,pg_stat_statements.so' 10 | pgaudit.log = 'write, ddl' 11 | pgaudit.log_relation = on 12 | -------------------------------------------------------------------------------- /examples/kube/pgbadger/cleanup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright 2016 - 2023 Crunchy Data Solutions, Inc. 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | source ${CCPROOT}/examples/common.sh 16 | echo_info "Cleaning up.." 17 | 18 | cleanup "${CCP_NAMESPACE?}-pgbadger" 19 | 20 | $CCPROOT/examples/waitforterm.sh pgbadger ${CCP_CLI?} 21 | -------------------------------------------------------------------------------- /examples/kube/pgbadger/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright 2016 - 2023 Crunchy Data Solutions, Inc. 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | source ${CCPROOT}/examples/common.sh 16 | 17 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 18 | 19 | ${DIR}/cleanup.sh 20 | 21 | echo_info "Creating the example components.." 22 | 23 | cat $DIR/pgbadger.json | envsubst | ${CCP_CLI?} create --namespace=${CCP_NAMESPACE?} -f - 24 | -------------------------------------------------------------------------------- /examples/kube/pgbasebackup/backup/backup-pv-nfs.json: -------------------------------------------------------------------------------- 1 | { 2 | "apiVersion": "v1", 3 | "kind": "PersistentVolume", 4 | "metadata": { 5 | "name": "$CCP_NAMESPACE-backup-pgdata", 6 | "labels": { 7 | "name": "$CCP_NAMESPACE-backup-pgdata", 8 | "cleanup": "$CCP_NAMESPACE-backup" 9 | } 10 | }, 11 | "spec": { 12 | "capacity": { 13 | "storage": "$CCP_STORAGE_CAPACITY" 14 | }, 15 | "accessModes": [ 16 | "$CCP_STORAGE_MODE" 17 | ], 18 | "nfs": { 19 | "path": "$CCP_STORAGE_PATH/$CCP_NAMESPACE-backup", 20 | "server": "$CCP_NFS_IP" 21 | }, 22 | "persistentVolumeReclaimPolicy": "Retain" 23 | } 24 | } -------------------------------------------------------------------------------- /examples/kube/pgbasebackup/backup/backup-pv.json: -------------------------------------------------------------------------------- 1 | { 2 | "apiVersion": "v1", 3 | "kind": "PersistentVolume", 4 | "metadata": { 5 | "name": "$CCP_NAMESPACE-backup-pgdata", 6 | "labels": { 7 | "name": "$CCP_NAMESPACE-backup-pgdata", 8 | "cleanup": "$CCP_NAMESPACE-backup" 9 | } 10 | }, 11 | "spec": { 12 | "capacity": { 13 | "storage": "$CCP_STORAGE_CAPACITY" 14 | }, 15 | "accessModes": [ 16 | "$CCP_STORAGE_MODE" 17 | ], 18 | "hostPath": { 19 | "path": "$CCP_STORAGE_PATH/$CCP_NAMESPACE-backup" 20 | }, 21 | "persistentVolumeReclaimPolicy": "Retain" 22 | } 23 | } -------------------------------------------------------------------------------- /examples/kube/pgbasebackup/backup/backup-pvc-sc.json: -------------------------------------------------------------------------------- 1 | { 2 | "kind": "PersistentVolumeClaim", 3 | "apiVersion": "v1", 4 | "metadata": { 5 | "name": "backup-pgdata", 6 | "labels": { 7 | "cleanup": "$CCP_NAMESPACE-backup" 8 | } 9 | }, 10 | "spec": { 11 | "accessModes": [ 12 | "$CCP_STORAGE_MODE" 13 | ], 14 | "storageClassName": "$CCP_STORAGE_CLASS", 15 | "resources": { 16 | "requests": { 17 | "storage": "$CCP_STORAGE_CAPACITY" 18 | } 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /examples/kube/pgbasebackup/backup/backup-pvc.json: -------------------------------------------------------------------------------- 1 | { 2 | "kind": "PersistentVolumeClaim", 3 | "apiVersion": "v1", 4 | "metadata": { 5 | "name": "backup-pgdata", 6 | "labels": { 7 | "cleanup": "$CCP_NAMESPACE-backup" 8 | } 9 | }, 10 | "spec": { 11 | "selector": { 12 | "matchLabels": { 13 | "name": "$CCP_NAMESPACE-backup-pgdata" 14 | } 15 | }, 16 | "accessModes": [ 17 | "$CCP_STORAGE_MODE" 18 | ], 19 | "resources": { 20 | "requests": { 21 | "storage": "$CCP_STORAGE_CAPACITY" 22 | } 23 | } 24 | } 25 | } -------------------------------------------------------------------------------- /examples/kube/pgbasebackup/backup/cleanup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright 2016 - 2023 Crunchy Data Solutions, Inc. 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | source ${CCPROOT}/examples/common.sh 16 | echo_info "Cleaning up.." 17 | 18 | cleanup "${CCP_NAMESPACE?}-backup" 19 | 20 | dir_check_rm "backup" 21 | -------------------------------------------------------------------------------- /examples/kube/pgbasebackup/backup/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright 2016 - 2023 Crunchy Data Solutions, Inc. 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | source ${CCPROOT}/examples/common.sh 16 | 17 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 18 | 19 | ${DIR}/cleanup.sh 20 | 21 | create_storage "backup" 22 | if [[ $? -ne 0 ]] 23 | then 24 | echo_err "Failed to create storage, exiting.." 25 | exit 1 26 | fi 27 | 28 | cat $DIR/backup.json | envsubst | ${CCP_CLI?} create --namespace=${CCP_NAMESPACE?} -f - 29 | -------------------------------------------------------------------------------- /examples/kube/pgbasebackup/full/cleanup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright 2017 - 2023 Crunchy Data Solutions, Inc. 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | source ${CCPROOT}/examples/common.sh 16 | 17 | echo_info "Cleaning up.." 18 | 19 | cleanup "${CCP_NAMESPACE?}-pgbasebackup-full-restored" 20 | 21 | cleanup "${CCP_NAMESPACE?}-restore" 22 | dir_check_rm "restore" 23 | -------------------------------------------------------------------------------- /examples/kube/pgbasebackup/full/post-restore.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright 2016 - 2023 Crunchy Data Solutions, Inc. 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | source ${CCPROOT}/examples/common.sh 16 | 17 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 18 | 19 | echo_info "Cleaning up.." 20 | 21 | cleanup "${CCP_NAMESPACE?}-pgbasebackup-full-restored" 22 | 23 | cat $DIR/full-restored.json | envsubst | ${CCP_CLI?} create --namespace="${CCP_NAMESPACE?}" -f - 24 | -------------------------------------------------------------------------------- /examples/kube/pgbasebackup/full/restore-pv-nfs.json: -------------------------------------------------------------------------------- 1 | { 2 | "apiVersion": "v1", 3 | "kind": "PersistentVolume", 4 | "metadata": { 5 | "name": "$CCP_NAMESPACE-restore-pgdata", 6 | "labels": { 7 | "name": "$CCP_NAMESPACE-restore-pgdata", 8 | "cleanup": "$CCP_NAMESPACE-restore" 9 | } 10 | }, 11 | "spec": { 12 | "capacity": { 13 | "storage": "$CCP_STORAGE_CAPACITY" 14 | }, 15 | "accessModes": [ 16 | "$CCP_STORAGE_MODE" 17 | ], 18 | "nfs": { 19 | "path": "$CCP_STORAGE_PATH/$CCP_NAMESPACE-restore", 20 | "server": "$CCP_NFS_IP" 21 | }, 22 | "persistentVolumeReclaimPolicy": "Retain" 23 | } 24 | } -------------------------------------------------------------------------------- /examples/kube/pgbasebackup/full/restore-pv.json: -------------------------------------------------------------------------------- 1 | { 2 | "apiVersion": "v1", 3 | "kind": "PersistentVolume", 4 | "metadata": { 5 | "name": "$CCP_NAMESPACE-restore-pgdata", 6 | "labels": { 7 | "name": "$CCP_NAMESPACE-restore-pgdata", 8 | "cleanup": "$CCP_NAMESPACE-restore" 9 | } 10 | }, 11 | "spec": { 12 | "capacity": { 13 | "storage": "$CCP_STORAGE_CAPACITY" 14 | }, 15 | "accessModes": [ 16 | "$CCP_STORAGE_MODE" 17 | ], 18 | "hostPath": { 19 | "path": "$CCP_STORAGE_PATH/$CCP_NAMESPACE-restore" 20 | }, 21 | "persistentVolumeReclaimPolicy": "Retain" 22 | } 23 | } -------------------------------------------------------------------------------- /examples/kube/pgbasebackup/full/restore-pvc-sc.json: -------------------------------------------------------------------------------- 1 | { 2 | "kind": "PersistentVolumeClaim", 3 | "apiVersion": "v1", 4 | "metadata": { 5 | "name": "restore-pgdata", 6 | "labels": { 7 | "name": "restore", 8 | "cleanup": "$CCP_NAMESPACE-restore" 9 | } 10 | }, 11 | "spec": { 12 | "accessModes": [ 13 | "$CCP_STORAGE_MODE" 14 | ], 15 | "storageClassName": "$CCP_STORAGE_CLASS", 16 | "resources": { 17 | "requests": { 18 | "storage": "$CCP_STORAGE_CAPACITY" 19 | } 20 | } 21 | } 22 | } -------------------------------------------------------------------------------- /examples/kube/pgbasebackup/full/restore-pvc.json: -------------------------------------------------------------------------------- 1 | { 2 | "kind": "PersistentVolumeClaim", 3 | "apiVersion": "v1", 4 | "metadata": { 5 | "name": "restore-pgdata", 6 | "labels": { 7 | "name": "restore", 8 | "cleanup": "$CCP_NAMESPACE-restore" 9 | } 10 | }, 11 | "spec": { 12 | "selector": { 13 | "matchLabels": { 14 | "name": "$CCP_NAMESPACE-restore-pgdata" 15 | } 16 | }, 17 | "accessModes": [ 18 | "$CCP_STORAGE_MODE" 19 | ], 20 | "resources": { 21 | "requests": { 22 | "storage": "$CCP_STORAGE_CAPACITY" 23 | } 24 | } 25 | } 26 | } -------------------------------------------------------------------------------- /examples/kube/pgbasebackup/full/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright 2017 - 2023 Crunchy Data Solutions, Inc. 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | source ${CCPROOT}/examples/common.sh 16 | 17 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 18 | 19 | echo_info "Cleaning up.." 20 | 21 | cleanup "${CCP_NAMESPACE?}-restore" 22 | dir_check_rm "restore" 23 | 24 | create_storage "restore" 25 | if [[ $? -ne 0 ]] 26 | then 27 | echo_err "Failed to create storage, exiting.." 28 | exit 1 29 | fi 30 | 31 | cat $DIR/restore.json | envsubst | ${CCP_CLI?} create --namespace=${CCP_NAMESPACE?} -f - 32 | -------------------------------------------------------------------------------- /examples/kube/pgbench-custom/cleanup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright 2018 - 2023 Crunchy Data Solutions, Inc. 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | source ${CCPROOT}/examples/common.sh 16 | echo_info "Cleaning up.." 17 | 18 | cleanup "${CCP_NAMESPACE?}-pgbench-custom" 19 | 20 | $CCPROOT/examples/waitforterm.sh pgbench ${CCP_CLI?} -------------------------------------------------------------------------------- /examples/kube/pgbench/cleanup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright 2018 - 2023 Crunchy Data Solutions, Inc. 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | source ${CCPROOT}/examples/common.sh 16 | echo_info "Cleaning up.." 17 | 18 | cleanup "${CCP_NAMESPACE?}-pgbench" 19 | 20 | $CCPROOT/examples/waitforterm.sh pgbench ${CCP_CLI?} -------------------------------------------------------------------------------- /examples/kube/pgbouncer/cleanup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright 2016 - 2023 Crunchy Data Solutions, Inc. 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | source ${CCPROOT}/examples/common.sh 17 | echo_info "Cleaning up.." 18 | 19 | cleanup "${CCP_NAMESPACE?}-pgbouncer" 20 | 21 | $CCPROOT/examples/waitforterm.sh pgbouncer-primary ${CCP_CLI?} 22 | $CCPROOT/examples/waitforterm.sh pgbouncer-replica ${CCP_CLI?} 23 | $CCPROOT/examples/waitforterm.sh pg-primary ${CCP_CLI?} 24 | $CCPROOT/examples/waitforterm.sh pg-replica ${CCP_CLI?} 25 | 26 | rm -f ./pgbouncer-auth.stderr 2>/dev/null 27 | -------------------------------------------------------------------------------- /examples/kube/pgbouncer/pgbouncer-pv.json: -------------------------------------------------------------------------------- 1 | { 2 | "apiVersion": "v1", 3 | "kind": "PersistentVolume", 4 | "metadata": { 5 | "name": "$CCP_NAMESPACE-pgbouncer-config-pgdata", 6 | "labels": { 7 | "name": "$CCP_NAMESPACE-pgbouncer-config-pgdata", 8 | "cleanup": "$CCP_NAMESPACE-pgbouncer" 9 | } 10 | }, 11 | "spec": { 12 | "capacity": { 13 | "storage": "$CCP_STORAGE_CAPACITY" 14 | }, 15 | "accessModes": [ 16 | "$CCP_STORAGE_MODE" 17 | ], 18 | "hostPath": { 19 | "path": "$CCP_STORAGE_PATH/$CCP_NAMESPACE-pgbouncer-config" 20 | }, 21 | "persistentVolumeReclaimPolicy": "Retain" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /examples/kube/pgbouncer/pgbouncer-pvc-sc.json: -------------------------------------------------------------------------------- 1 | { 2 | "kind": "PersistentVolumeClaim", 3 | "apiVersion": "v1", 4 | "metadata": { 5 | "name": "pgbouncer-config-pgdata", 6 | "labels": { 7 | "cleanup": "$CCP_NAMESPACE-pgbouncer" 8 | } 9 | }, 10 | "spec": { 11 | "accessModes": [ 12 | "$CCP_STORAGE_MODE" 13 | ], 14 | "storageClassName": "$CCP_STORAGE_CLASS", 15 | "resources": { 16 | "requests": { 17 | "storage": "$CCP_STORAGE_CAPACITY" 18 | } 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /examples/kube/pgbouncer/pgbouncer-pvc.json: -------------------------------------------------------------------------------- 1 | { 2 | "kind": "PersistentVolumeClaim", 3 | "apiVersion": "v1", 4 | "metadata": { 5 | "name": "pgbouncer-config-pgdata", 6 | "labels": { 7 | "cleanup": "$CCP_NAMESPACE-pgbouncer" 8 | } 9 | }, 10 | "spec": { 11 | "selector": { 12 | "matchLabels": { 13 | "name": "$CCP_NAMESPACE-pgbouncer-config-pgdata" 14 | } 15 | }, 16 | "accessModes": [ 17 | "$CCP_STORAGE_MODE" 18 | ], 19 | "resources": { 20 | "requests": { 21 | "storage": "$CCP_STORAGE_CAPACITY" 22 | } 23 | } 24 | } 25 | } 26 | 27 | -------------------------------------------------------------------------------- /examples/kube/pgdump/backup/cleanup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright 2018 - 2023 Crunchy Data Solutions, Inc. 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | source ${CCPROOT}/examples/common.sh 16 | echo_info "Cleaning up.." 17 | 18 | cleanup "${CCP_NAMESPACE?}-pgdump" 19 | 20 | $CCPROOT/examples/waitforterm.sh pgdump ${CCP_CLI?} 21 | 22 | dir_check_rm "pgdump" 23 | -------------------------------------------------------------------------------- /examples/kube/pgdump/backup/pgdump-pv-nfs.json: -------------------------------------------------------------------------------- 1 | { 2 | "apiVersion": "v1", 3 | "kind": "PersistentVolume", 4 | "metadata": { 5 | "name": "$CCP_NAMESPACE-pgdump-pgdata", 6 | "labels": { 7 | "name": "$CCP_NAMESPACE-pgdump-pgdata", 8 | "cleanup": "$CCP_NAMESPACE-pgdump" 9 | } 10 | }, 11 | "spec": { 12 | "capacity": { 13 | "storage": "$CCP_STORAGE_CAPACITY" 14 | }, 15 | "accessModes": [ 16 | "$CCP_STORAGE_MODE" 17 | ], 18 | "nfs": { 19 | "path": "$CCP_STORAGE_PATH/$CCP_NAMESPACE-pgdump", 20 | "server": "$CCP_NFS_IP" 21 | }, 22 | "persistentVolumeReclaimPolicy": "Retain" 23 | } 24 | } -------------------------------------------------------------------------------- /examples/kube/pgdump/backup/pgdump-pv.json: -------------------------------------------------------------------------------- 1 | { 2 | "apiVersion": "v1", 3 | "kind": "PersistentVolume", 4 | "metadata": { 5 | "name": "$CCP_NAMESPACE-pgdump-pgdata", 6 | "labels": { 7 | "name": "$CCP_NAMESPACE-pgdump-pgdata", 8 | "cleanup": "$CCP_NAMESPACE-pgdump" 9 | } 10 | }, 11 | "spec": { 12 | "capacity": { 13 | "storage": "$CCP_STORAGE_CAPACITY" 14 | }, 15 | "accessModes": [ 16 | "$CCP_STORAGE_MODE" 17 | ], 18 | "hostPath": { 19 | "path": "$CCP_STORAGE_PATH/$CCP_NAMESPACE-pgdump" 20 | }, 21 | "persistentVolumeReclaimPolicy": "Retain" 22 | } 23 | } -------------------------------------------------------------------------------- /examples/kube/pgdump/backup/pgdump-pvc-sc.json: -------------------------------------------------------------------------------- 1 | { 2 | "kind": "PersistentVolumeClaim", 3 | "apiVersion": "v1", 4 | "metadata": { 5 | "name": "pgdump-pgdata", 6 | "labels": { 7 | "cleanup": "$CCP_NAMESPACE-pgdump" 8 | } 9 | }, 10 | "spec": { 11 | "accessModes": [ 12 | "$CCP_STORAGE_MODE" 13 | ], 14 | "storageClassName": "$CCP_STORAGE_CLASS", 15 | "resources": { 16 | "requests": { 17 | "storage": "$CCP_STORAGE_CAPACITY" 18 | } 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /examples/kube/pgdump/backup/pgdump-pvc.json: -------------------------------------------------------------------------------- 1 | { 2 | "kind": "PersistentVolumeClaim", 3 | "apiVersion": "v1", 4 | "metadata": { 5 | "name": "pgdump-pgdata", 6 | "labels": { 7 | "cleanup": "$CCP_NAMESPACE-pgdump" 8 | } 9 | }, 10 | "spec": { 11 | "selector": { 12 | "matchLabels": { 13 | "name": "$CCP_NAMESPACE-pgdump-pgdata" 14 | } 15 | }, 16 | "accessModes": [ 17 | "$CCP_STORAGE_MODE" 18 | ], 19 | "resources": { 20 | "requests": { 21 | "storage": "$CCP_STORAGE_CAPACITY" 22 | } 23 | } 24 | } 25 | } -------------------------------------------------------------------------------- /examples/kube/pgdump/backup/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright 2018 - 2023 Crunchy Data Solutions, Inc. 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | source ${CCPROOT}/examples/common.sh 16 | 17 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 18 | 19 | ${DIR}/cleanup.sh 20 | 21 | create_storage "pgdump" 22 | if [[ $? -ne 0 ]] 23 | then 24 | echo_err "Failed to create storage, exiting.." 25 | exit 1 26 | fi 27 | 28 | cat $DIR/pgdump.json | envsubst | ${CCP_CLI?} create --namespace=${CCP_NAMESPACE?} -f - 29 | -------------------------------------------------------------------------------- /examples/kube/pgdump/pgrestore/cleanup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright 2018 - 2023 Crunchy Data Solutions, Inc. 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | source ${CCPROOT}/examples/common.sh 16 | echo_info "Cleaning up.." 17 | 18 | cleanup "${CCP_NAMESPACE?}-pgrestore" 19 | 20 | $CCPROOT/examples/waitforterm.sh pgrestore ${CCP_CLI?} 21 | -------------------------------------------------------------------------------- /examples/kube/pgdump/pgrestore/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright 2018 - 2023 Crunchy Data Solutions, Inc. 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | source ${CCPROOT}/examples/common.sh 16 | 17 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 18 | 19 | ${DIR}/cleanup.sh 20 | 21 | cat $DIR/pgrestore.json | envsubst | ${CCP_CLI?} create --namespace=${CCP_NAMESPACE?} -f - 22 | -------------------------------------------------------------------------------- /examples/kube/pgpool/cleanup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright 2018 - 2023 Crunchy Data Solutions, Inc. 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | source ${CCPROOT}/examples/common.sh 16 | echo_info "Cleaning up.." 17 | 18 | cleanup "${CCP_NAMESPACE?}-pgpool" 19 | -------------------------------------------------------------------------------- /examples/kube/pgpool/configs/pool_passwd: -------------------------------------------------------------------------------- 1 | testuser:md599e8713364988502fa6189781bcf648f 2 | -------------------------------------------------------------------------------- /examples/kube/postgres-gis/cleanup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright 2017 - 2023 Crunchy Data Solutions, Inc. 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | source ${CCPROOT}/examples/common.sh 16 | echo_info "Cleaning up.." 17 | 18 | cleanup "${CCP_NAMESPACE?}-postgres-gis" 19 | 20 | $CCPROOT/examples/waitforterm.sh postgres-gis ${CCP_CLI?} 21 | -------------------------------------------------------------------------------- /examples/kube/postgres-gis/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright 2017 - 2023 Crunchy Data Solutions, Inc. 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | source ${CCPROOT}/examples/common.sh 16 | 17 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 18 | 19 | $DIR/cleanup.sh 20 | 21 | echo_info "Creating the example components.." 22 | 23 | cat $DIR/postgres-gis.json | envsubst | ${CCP_CLI?} create --namespace=${CCP_NAMESPACE?} -f - 24 | -------------------------------------------------------------------------------- /examples/kube/primary-replica/cleanup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright 2017 - 2023 Crunchy Data Solutions, Inc. 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | source ${CCPROOT}/examples/common.sh 16 | echo_info "Cleaning up.." 17 | 18 | cleanup "${CCP_NAMESPACE?}-primary-replica" 19 | 20 | $CCPROOT/examples/waitforterm.sh pr-primary ${CCP_CLI?} 21 | $CCPROOT/examples/waitforterm.sh pr-replica ${CCP_CLI?} 22 | 23 | dir_check_rm "primary-replica" -------------------------------------------------------------------------------- /examples/kube/primary-replica/primary-replica-pvc-sc.json: -------------------------------------------------------------------------------- 1 | { 2 | "kind": "PersistentVolumeClaim", 3 | "apiVersion": "v1", 4 | "metadata": { 5 | "name": "pr-primary-pgdata", 6 | "labels": { 7 | "cleanup": "$CCP_NAMESPACE-primary-replica" 8 | } 9 | }, 10 | "spec": { 11 | "accessModes": [ 12 | "$CCP_STORAGE_MODE" 13 | ], 14 | "storageClassName": "$CCP_STORAGE_CLASS", 15 | "resources": { 16 | "requests": { 17 | "storage": "$CCP_STORAGE_CAPACITY" 18 | } 19 | } 20 | } 21 | } 22 | 23 | { 24 | "kind": "PersistentVolumeClaim", 25 | "apiVersion": "v1", 26 | "metadata": { 27 | "name": "pr-replica-pgdata", 28 | "labels": { 29 | "cleanup": "$CCP_NAMESPACE-primary-replica" 30 | } 31 | }, 32 | "spec": { 33 | "accessModes": [ 34 | "$CCP_STORAGE_MODE" 35 | ], 36 | "storageClassName": "$CCP_STORAGE_CLASS", 37 | "resources": { 38 | "requests": { 39 | "storage": "$CCP_STORAGE_CAPACITY" 40 | } 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /examples/kube/primary-replica/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright 2017 - 2023 Crunchy Data Solutions, Inc. 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | source ${CCPROOT}/examples/common.sh 16 | 17 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 18 | 19 | $DIR/cleanup.sh 20 | 21 | create_storage "primary-replica" "${CCP_NAMESPACE?}" 22 | if [[ $? -ne 0 ]] 23 | then 24 | echo_err "Failed to create storage, exiting.." 25 | exit 1 26 | fi 27 | 28 | echo_info "Creating the example components.." 29 | 30 | cat $DIR/primary.json | envsubst | ${CCP_CLI?} create --namespace=${CCP_NAMESPACE?} -f - 31 | cat $DIR/replica.json | envsubst | ${CCP_CLI?} create --namespace=${CCP_NAMESPACE?} -f - 32 | -------------------------------------------------------------------------------- /examples/kube/primary/cleanup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright 2017 - 2023 Crunchy Data Solutions, Inc. 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | source ${CCPROOT}/examples/common.sh 16 | echo_info "Cleaning up.." 17 | 18 | cleanup "${CCP_NAMESPACE?}-primary" 19 | 20 | $CCPROOT/examples/waitforterm.sh primary ${CCP_CLI?} 21 | 22 | dir_check_rm "primary" 23 | -------------------------------------------------------------------------------- /examples/kube/primary/primary-pv-nfs.json: -------------------------------------------------------------------------------- 1 | { 2 | "apiVersion": "v1", 3 | "kind": "PersistentVolume", 4 | "metadata": { 5 | "name": "$CCP_NAMESPACE-primary-pgdata", 6 | "labels": { 7 | "name": "$CCP_NAMESPACE-primary-pgdata", 8 | "cleanup": "$CCP_NAMESPACE-primary" 9 | } 10 | }, 11 | "spec": { 12 | "capacity": { 13 | "storage": "$CCP_STORAGE_CAPACITY" 14 | }, 15 | "accessModes": [ 16 | "$CCP_STORAGE_MODE" 17 | ], 18 | "nfs": { 19 | "path": "$CCP_STORAGE_PATH/$CCP_NAMESPACE-primary", 20 | "server": "$CCP_NFS_IP" 21 | }, 22 | "persistentVolumeReclaimPolicy": "Retain" 23 | } 24 | } -------------------------------------------------------------------------------- /examples/kube/primary/primary-pv.json: -------------------------------------------------------------------------------- 1 | { 2 | "apiVersion": "v1", 3 | "kind": "PersistentVolume", 4 | "metadata": { 5 | "name": "$CCP_NAMESPACE-primary-pgdata", 6 | "labels": { 7 | "name": "$CCP_NAMESPACE-primary-pgdata", 8 | "cleanup": "$CCP_NAMESPACE-primary" 9 | } 10 | }, 11 | "spec": { 12 | "capacity": { 13 | "storage": "$CCP_STORAGE_CAPACITY" 14 | }, 15 | "accessModes": [ 16 | "$CCP_STORAGE_MODE" 17 | ], 18 | "hostPath": { 19 | "path": "$CCP_STORAGE_PATH/$CCP_NAMESPACE-primary" 20 | }, 21 | "persistentVolumeReclaimPolicy": "Retain" 22 | } 23 | } -------------------------------------------------------------------------------- /examples/kube/primary/primary-pvc-sc.json: -------------------------------------------------------------------------------- 1 | { 2 | "kind": "PersistentVolumeClaim", 3 | "apiVersion": "v1", 4 | "metadata": { 5 | "name": "primary-pgdata", 6 | "labels": { 7 | "cleanup": "$CCP_NAMESPACE-primary" 8 | } 9 | }, 10 | "spec": { 11 | "accessModes": [ 12 | "$CCP_STORAGE_MODE" 13 | ], 14 | "storageClassName": "$CCP_STORAGE_CLASS", 15 | "resources": { 16 | "requests": { 17 | "storage": "$CCP_STORAGE_CAPACITY" 18 | } 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /examples/kube/primary/primary-pvc.json: -------------------------------------------------------------------------------- 1 | { 2 | "kind": "PersistentVolumeClaim", 3 | "apiVersion": "v1", 4 | "metadata": { 5 | "name": "primary-pgdata", 6 | "labels": { 7 | "cleanup": "$CCP_NAMESPACE-primary" 8 | } 9 | }, 10 | "spec": { 11 | "selector": { 12 | "matchLabels": { 13 | "name": "$CCP_NAMESPACE-primary-pgdata" 14 | } 15 | }, 16 | "accessModes": [ 17 | "$CCP_STORAGE_MODE" 18 | ], 19 | "resources": { 20 | "requests": { 21 | "storage": "$CCP_STORAGE_CAPACITY" 22 | } 23 | } 24 | } 25 | } -------------------------------------------------------------------------------- /examples/kube/primary/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright 2017 - 2023 Crunchy Data Solutions, Inc. 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | source ${CCPROOT}/examples/common.sh 16 | 17 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 18 | 19 | ${DIR}/cleanup.sh 20 | 21 | create_storage "primary" "${CCP_NAMESPACE?}" 22 | if [[ $? -ne 0 ]] 23 | then 24 | echo_err "Failed to create storage, exiting.." 25 | exit 1 26 | fi 27 | 28 | cat $DIR/primary.json | envsubst | ${CCP_CLI?} create --namespace=${CCP_NAMESPACE?} -f - 29 | -------------------------------------------------------------------------------- /examples/kube/secret/cleanup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright 2018 - 2023 Crunchy Data Solutions, Inc. 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | source ${CCPROOT}/examples/common.sh 16 | echo_info "Cleaning up.." 17 | 18 | cleanup "${CCP_NAMESPACE?}-secret" 19 | -------------------------------------------------------------------------------- /examples/kube/secret/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright 2018 - 2023 Crunchy Data Solutions, Inc. 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | source ${CCPROOT}/examples/common.sh 16 | 17 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 18 | 19 | $DIR/cleanup.sh 20 | 21 | echo_info "Creating the example components.." 22 | 23 | cat $DIR/secret.json | envsubst | ${CCP_CLI?} create --namespace=${CCP_NAMESPACE?} -f - 24 | -------------------------------------------------------------------------------- /examples/kube/sync/cleanup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright 2016 - 2023 Crunchy Data Solutions, Inc. 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | source ${CCPROOT}/examples/common.sh 16 | echo_info "Cleaning up.." 17 | 18 | cleanup "${CCP_NAMESPACE?}-sync" 19 | 20 | $CCPROOT/examples/waitforterm.sh primarysync ${CCP_CLI?} 21 | $CCPROOT/examples/waitforterm.sh replicasync ${CCP_CLI?} 22 | -------------------------------------------------------------------------------- /examples/kube/sync/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright 2016 - 2023 Crunchy Data Solutions, Inc. 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | source ${CCPROOT}/examples/common.sh 16 | 17 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 18 | 19 | $DIR/cleanup.sh 20 | 21 | echo_info "Creating the example components.." 22 | 23 | cat $DIR/sync.json | envsubst | ${CCP_CLI?} create --namespace=${CCP_NAMESPACE?} -f - 24 | -------------------------------------------------------------------------------- /examples/kube/upgrade/cleanup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright 2017 - 2023 Crunchy Data Solutions, Inc. 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | source ${CCPROOT}/examples/common.sh 16 | echo_info "Cleaning up.." 17 | 18 | cleanup "${CCP_NAMESPACE?}-upgrade" 19 | 20 | dir_check_rm "upgrade" 21 | -------------------------------------------------------------------------------- /examples/kube/upgrade/post-upgrade.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright 2016 - 2023 Crunchy Data Solutions, Inc. 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | source ${CCPROOT}/examples/common.sh 16 | 17 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 18 | 19 | cat $DIR/primary-upgraded.json | envsubst | ${CCP_CLI?} create --namespace=${CCP_NAMESPACE?} -f - 20 | -------------------------------------------------------------------------------- /examples/kube/upgrade/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright 2017 - 2023 Crunchy Data Solutions, Inc. 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | source ${CCPROOT}/examples/common.sh 16 | 17 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 18 | 19 | ${DIR}/cleanup.sh 20 | 21 | create_storage "upgrade" 22 | if [[ $? -ne 0 ]] 23 | then 24 | echo_err "Failed to create storage, exiting.." 25 | exit 1 26 | fi 27 | 28 | cat $DIR/upgrade.json | envsubst | ${CCP_CLI?} create --namespace=${CCP_NAMESPACE?} -f - 29 | -------------------------------------------------------------------------------- /examples/kube/upgrade/upgrade-pv-nfs.json: -------------------------------------------------------------------------------- 1 | { 2 | "apiVersion": "v1", 3 | "kind": "PersistentVolume", 4 | "metadata": { 5 | "name": "$CCP_NAMESPACE-upgrade-pgnewdata", 6 | "labels": { 7 | "name": "$CCP_NAMESPACE-upgrade-pgnewdata", 8 | "cleanup": "$CCP_NAMESPACE-upgrade" 9 | } 10 | }, 11 | "spec": { 12 | "capacity": { 13 | "storage": "$CCP_STORAGE_CAPACITY" 14 | }, 15 | "accessModes": ["$CCP_STORAGE_MODE"], 16 | "nfs": { 17 | "path": "$CCP_STORAGE_PATH/$CCP_NAMESPACE-upgrade", 18 | "server": "$CCP_NFS_IP" 19 | }, 20 | "persistentVolumeReclaimPolicy": "Retain" 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /examples/kube/upgrade/upgrade-pv.json: -------------------------------------------------------------------------------- 1 | { 2 | "apiVersion": "v1", 3 | "kind": "PersistentVolume", 4 | "metadata": { 5 | "name": "$CCP_NAMESPACE-upgrade-pgnewdata", 6 | "labels": { 7 | "name": "$CCP_NAMESPACE-upgrade-pgnewdata", 8 | "cleanup": "$CCP_NAMESPACE-upgrade" 9 | } 10 | }, 11 | "spec": { 12 | "capacity": { 13 | "storage": "$CCP_STORAGE_CAPACITY" 14 | }, 15 | "accessModes": ["$CCP_STORAGE_MODE"], 16 | "hostPath": { 17 | "path": "$CCP_STORAGE_PATH/$CCP_NAMESPACE-upgrade" 18 | }, 19 | "persistentVolumeReclaimPolicy": "Retain" 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /examples/kube/upgrade/upgrade-pvc-sc.json: -------------------------------------------------------------------------------- 1 | { 2 | "kind": "PersistentVolumeClaim", 3 | "apiVersion": "v1", 4 | "metadata": { 5 | "name": "upgrade-pgnewdata", 6 | "labels": { 7 | "cleanup": "$CCP_NAMESPACE-upgrade" 8 | } 9 | }, 10 | "spec": { 11 | "accessModes": [ 12 | "$CCP_STORAGE_MODE" 13 | ], 14 | "storageClassName": "$CCP_STORAGE_CLASS", 15 | "resources": { 16 | "requests": { 17 | "storage": "$CCP_STORAGE_CAPACITY" 18 | } 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /examples/kube/upgrade/upgrade-pvc.json: -------------------------------------------------------------------------------- 1 | { 2 | "kind": "PersistentVolumeClaim", 3 | "apiVersion": "v1", 4 | "metadata": { 5 | "name": "upgrade-pgnewdata", 6 | "labels": { 7 | "cleanup": "$CCP_NAMESPACE-upgrade" 8 | } 9 | }, 10 | "spec": { 11 | "selector": { 12 | "matchLabels": { 13 | "name": "$CCP_NAMESPACE-upgrade-pgnewdata" 14 | } 15 | }, 16 | "accessModes": [ 17 | "$CCP_STORAGE_MODE" 18 | ], 19 | "resources": { 20 | "requests": { 21 | "storage": "$CCP_STORAGE_CAPACITY" 22 | } 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /examples/waitforterm.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright 2016 - 2023 Crunchy Data Solutions, Inc. 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | # 17 | # wait for a pod to terminate 18 | # 19 | 20 | echo "waiting on " $1 21 | POD=$1 22 | CMD=$2 23 | NS=${CCP_NAMESPACE?} 24 | 25 | while true; do 26 | $CMD get pod $POD --namespace=$NS > /dev/null 27 | rc=$? 28 | if [ $rc -ne 0 ]; then 29 | echo "dead " $? 30 | break 31 | fi 32 | if [ $rc -eq 0 ]; then 33 | echo -n "." 34 | fi 35 | sleep 1 36 | done 37 | -------------------------------------------------------------------------------- /images/containers.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CrunchyData/crunchy-containers/c7398a94d2419a05172b16d977c07f8794b62288/images/containers.png -------------------------------------------------------------------------------- /images/crunchy_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CrunchyData/crunchy-containers/c7398a94d2419a05172b16d977c07f8794b62288/images/crunchy_logo.png -------------------------------------------------------------------------------- /images/grafana.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CrunchyData/crunchy-containers/c7398a94d2419a05172b16d977c07f8794b62288/images/grafana.png -------------------------------------------------------------------------------- /images/pgadmin4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CrunchyData/crunchy-containers/c7398a94d2419a05172b16d977c07f8794b62288/images/pgadmin4.png -------------------------------------------------------------------------------- /images/pgbadger.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CrunchyData/crunchy-containers/c7398a94d2419a05172b16d977c07f8794b62288/images/pgbadger.png -------------------------------------------------------------------------------- /redhat/atomic/help.md: -------------------------------------------------------------------------------- 1 | = crunchy-containers (1) 2 | Crunchy Data 3 | December 23, 2019 4 | 5 | == NAME 6 | crunchy-containers - Essential open source microservices for production PostgreSQL 7 | 8 | == DESCRIPTION 9 | The Crunchy Container Suite provides the essential microservices for running a 10 | enterprise-grade PostgreSQL cluster. These include: 11 | 12 | - PostgreSQL 13 | - PostGIS 14 | - pgBackRest 15 | - pgBouncer 16 | 17 | and more. 18 | 19 | == USAGE 20 | For more information on the Crunchy Container Suite, see the official 21 | [Crunchy Container Suite Documentation](https://access.crunchydata.com/documentation/crunchy-containers/) 22 | 23 | == LABELS 24 | The starter container includes the following LABEL settings: 25 | 26 | That atomic command runs the Docker command set in this label: 27 | 28 | `Name=` 29 | 30 | The registry location and name of the image. For example, Name="crunchydata/crunchy-postgres". 31 | 32 | `Version=` 33 | 34 | The Red Hat Enterprise Linux version from which the container was built. For example, Version="7.7" 35 | 36 | `Release=` 37 | 38 | The specific release number of the container. For example, Release="5.3.1" 39 | --------------------------------------------------------------------------------