{"id":20542753,"url":"https://github.com/jerryshell/k8s-postgres-longhorn","last_synced_at":"2026-05-16T17:05:44.795Z","repository":{"id":231875867,"uuid":"782930481","full_name":"jerryshell/k8s-postgres-longhorn","owner":"jerryshell","description":"K8s PostgreSQL Longhorn","archived":false,"fork":false,"pushed_at":"2024-09-07T13:37:14.000Z","size":15,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-29T11:46:45.873Z","etag":null,"topics":["homelab","k8s","kubernetes","longhorn","postgresql"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jerryshell.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-04-06T13:01:50.000Z","updated_at":"2025-10-16T08:45:52.000Z","dependencies_parsed_at":"2024-04-06T14:25:20.192Z","dependency_job_id":"318766c5-1565-4be7-aae3-a3868894afa7","html_url":"https://github.com/jerryshell/k8s-postgres-longhorn","commit_stats":null,"previous_names":["jerryshell/k8s-postgres-longhorn"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jerryshell/k8s-postgres-longhorn","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jerryshell%2Fk8s-postgres-longhorn","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jerryshell%2Fk8s-postgres-longhorn/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jerryshell%2Fk8s-postgres-longhorn/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jerryshell%2Fk8s-postgres-longhorn/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jerryshell","download_url":"https://codeload.github.com/jerryshell/k8s-postgres-longhorn/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jerryshell%2Fk8s-postgres-longhorn/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33111497,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-16T04:41:52.686Z","status":"ssl_error","status_checked_at":"2026-05-16T04:41:52.009Z","response_time":115,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["homelab","k8s","kubernetes","longhorn","postgresql"],"created_at":"2024-11-16T01:34:09.855Z","updated_at":"2026-05-16T17:05:44.757Z","avatar_url":"https://github.com/jerryshell.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# K8s PostgreSQL Longhorn\n\n[K8s](https://kubernetes.io/) + [PostgreSQL](https://www.postgresql.org/) + [Longhorn](https://longhorn.io/)\n\n## Install Longhorn\n\nEnvironment Check Script\n\n```bash\ncurl -sSfL https://raw.githubusercontent.com/longhorn/longhorn/v1.6.1/scripts/environment_check.sh | bash\n```\n\nInstalling open-iscsi\n\n```bash\nkubectl apply -f https://raw.githubusercontent.com/longhorn/longhorn/v1.6.1/deploy/prerequisite/longhorn-iscsi-installation.yaml\n```\n\nInstalling NFSv4 client\n\n```bash\nkubectl apply -f https://raw.githubusercontent.com/longhorn/longhorn/v1.6.1/deploy/prerequisite/longhorn-nfs-installation.yaml\n```\n\nInstalling Longhorn\n\n```bash\nkubectl apply -f https://raw.githubusercontent.com/longhorn/longhorn/v1.6.1/deploy/longhorn.yaml\n```\n\n## Git clone\n\n```bash\ngit clone https://github.com/jerryshell/k8s-postgres-longhorn.git\ncd k8s-postgres-longhorn\n```\n\n## ConfigMap\n\n```bash\nexport POSTGRES_DB=postgres\nexport POSTGRES_USER=postgres\nexport POSTGRES_PASSWORD=your_password\ncat k8s/configmap/configmap.yaml | envsubst | kubectl apply -f -\n```\n\n## PVC + Deployment + Service\n\n```bash\nkubectl apply -f k8s/\n```\n\n## Delete\n\n```bash\nkubectl delete --ignore-not-found=true -f k8s/ -f k8s/configmap/\n```\n\n## Connect to PostgreSQL via kubectl\n\n```bash\nkubectl exec -it postgres-UUID -- psql -h localhost -U postgres --password -p 5432 postgres\n```\n\n## Backup and Restore PostgreSQL Database\n\nBackup\n\n```bash\nkubectl exec -it postgres-UUID -- pg_dump -U postgres -d postgres \u003e db_backup.sql\n```\n\nRestore\n\n```bash\nkubectl cp db_backup.sql postgres-UUID:/tmp/db_backup.sql\nkubectl exec -it postgres-UUID -- /bin/bash\npsql -U postgres -d postgres -f /tmp/db_backup.sql\n```\n\n## LICENSE\n\n[GNU Affero General Public License v3.0](https://choosealicense.com/licenses/agpl-3.0/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjerryshell%2Fk8s-postgres-longhorn","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjerryshell%2Fk8s-postgres-longhorn","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjerryshell%2Fk8s-postgres-longhorn/lists"}