{"id":15104846,"url":"https://github.com/arthurdw/cloud-sdk-pg","last_synced_at":"2025-04-11T13:42:45.201Z","repository":{"id":255183069,"uuid":"848775372","full_name":"Arthurdw/cloud-sdk-pg","owner":"Arthurdw","description":"Utility container for postgres backups to google cloud storage (container with the google cloud sdk installed and postgres client)","archived":false,"fork":false,"pushed_at":"2024-10-24T01:37:51.000Z","size":18,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-10-24T13:13:43.726Z","etag":null,"topics":["backup","cloud","docker","google","kubernetes","oci","postgres"],"latest_commit_sha":null,"homepage":"https://hub.docker.com/r/arthurdw/cloud-sdk-pg","language":"Dockerfile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Arthurdw.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-28T11:41:59.000Z","updated_at":"2024-10-24T01:37:54.000Z","dependencies_parsed_at":"2024-10-28T02:59:58.299Z","dependency_job_id":null,"html_url":"https://github.com/Arthurdw/cloud-sdk-pg","commit_stats":{"total_commits":50,"total_committers":3,"mean_commits":"16.666666666666668","dds":"0.040000000000000036","last_synced_commit":"def0a9622a8fd2a7f8a528778418fe438dc16862"},"previous_names":["arthurdw/cloud-sdk-pg"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Arthurdw%2Fcloud-sdk-pg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Arthurdw%2Fcloud-sdk-pg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Arthurdw%2Fcloud-sdk-pg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Arthurdw%2Fcloud-sdk-pg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Arthurdw","download_url":"https://codeload.github.com/Arthurdw/cloud-sdk-pg/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248410835,"owners_count":21098780,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["backup","cloud","docker","google","kubernetes","oci","postgres"],"created_at":"2024-09-25T20:02:59.177Z","updated_at":"2025-04-11T13:42:45.172Z","avatar_url":"https://github.com/Arthurdw.png","language":"Dockerfile","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Google Cloud Postgres Image\n\n![Docker Image Version](https://img.shields.io/badge/version-latest-blue.svg)\n\nThis Docker image is designed for use of the Google Cloud SDK and Postgres client. This can be used for example to perform backups of a Postgres instance to Google Cloud Storage.\n\n## Features\n\n- **Base Image**: Built on the latest image of the google cloud SDK\n- **Postgres Client**: The Postgres client is installed in the image\n\n## Installation\n\nYou can pull this image from Docker Hub by running:\n\n```bash\ndocker pull arthurdw/cloud-sdk-pg:latest\n```\n\n## Usage\n\nThis image is intended for use in pods or cron jobs that need to interact with Google Cloud and Postgres. You can run the image interactively to use the Google Cloud SDK and Postgres client:\n\n```bash\ndocker run -it --rm arthurdw/cloud-sdk-pg\n```\n\nOnce inside the container, you can use `kubectl` to manage your Kubernetes resources. For example:\n\n```bash\nkubectl get pods\n```\n\n## Example Deployment\n\nYou can use it in a Kubernetes cron job:\n\n```yaml\napiVersion: batch/v1\nkind: CronJob\nmetadata:\n  name: postgres-backup\nspec:\n  schedule: \"0 2 * * *\"\n  jobTemplate:\n    spec:\n      template:\n        spec:\n          serviceAccountName: impersonator-sa\n          containers:\n            - name: backup\n              image: arthurdw/cloud-sdk-pg:latest\n              command: [\"/bin/sh\", \"-c\"]\n              args:\n                - |\n                  gcloud config set auth/impersonate_service_account impersonated-sa@\u003cproject-id\u003e.iam.gserviceaccount.com \u0026\u0026\n\n                  TIMESTAMP=$(date +%Y%m%d%H%M%S) \u0026\u0026\n                  BACKUP_FILE=\"/tmp/backup_$TIMESTAMP.sql\" \u0026\u0026\n                  pg_dump -h postgres -U postgres -F c -b -v -f $BACKUP_FILE postgres \u0026\u0026\n                  gsutil cp $BACKUP_FILE gs://\u003cyour-bucket-name\u003e/backups/\n          restartPolicy: OnFailure\n```\n\n## Contributing\n\nIf you have suggestions for improvements or new features, feel free to submit a pull request or open an issue in this repository.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farthurdw%2Fcloud-sdk-pg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farthurdw%2Fcloud-sdk-pg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farthurdw%2Fcloud-sdk-pg/lists"}