{"id":31697676,"url":"https://github.com/markpeterfejes/mongo-repl-init-container","last_synced_at":"2026-04-05T23:02:37.025Z","repository":{"id":265361974,"uuid":"98631749","full_name":"markpeterfejes/mongo-repl-init-container","owner":"markpeterfejes","description":"A simple init-container for setting up replication in a kubernetes Stateful-set","archived":false,"fork":false,"pushed_at":"2017-10-11T14:06:10.000Z","size":7,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-02-18T01:41:10.443Z","etag":null,"topics":["database","docker","init-containers","kubernetes","mongodb","nodejs","statefulsets"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/markpeterfejes.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":"2017-07-28T09:10:03.000Z","updated_at":"2022-02-23T15:24:34.000Z","dependencies_parsed_at":"2024-11-29T04:07:33.488Z","dependency_job_id":"6123ee1c-e532-4936-b286-24d736be3e75","html_url":"https://github.com/markpeterfejes/mongo-repl-init-container","commit_stats":null,"previous_names":["markpeterfejes/mongo-repl-init-container"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/markpeterfejes/mongo-repl-init-container","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markpeterfejes%2Fmongo-repl-init-container","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markpeterfejes%2Fmongo-repl-init-container/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markpeterfejes%2Fmongo-repl-init-container/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markpeterfejes%2Fmongo-repl-init-container/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/markpeterfejes","download_url":"https://codeload.github.com/markpeterfejes/mongo-repl-init-container/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markpeterfejes%2Fmongo-repl-init-container/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31452901,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-05T21:22:52.476Z","status":"ssl_error","status_checked_at":"2026-04-05T21:22:51.943Z","response_time":75,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":["database","docker","init-containers","kubernetes","mongodb","nodejs","statefulsets"],"created_at":"2025-10-08T18:02:40.542Z","updated_at":"2026-04-05T23:02:36.808Z","avatar_url":"https://github.com/markpeterfejes.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mongo-repl-init-container\n\nThis 'small' container let's your use mongodb as a Stateful Set in your kubernetes cluster. It will automatically find any other instances in the same namespace, if you have a headless service specified.\n\n### Example kubernetes headless Service:\n\n```json\n{\n    \"apiVersion\": \"v1\",\n    \"kind\": \"Service\",\n    \"metadata\": {\n        \"name\": \"mongo\",\n        \"annotations\": {\n            \"service.alpha.kubernetes.io/tolerate-unready-endpoints\": \"true\"\n        },\n        \"labels\": {\n            \"app\": \"mongo\"\n        }\n    },\n    \"spec\": {\n        \"ports\": [\n            {\n                \"port\": 27017,\n                \"name\": \"mongo-port\"\n            }\n        ],\n        \"type\": \"ClusterIP\",\n        \"clusterIP\": \"None\",\n        \"selector\": {\n            \"app\": \"mongo\"\n        }\n    }\n}\n```\n\n### Example kubernetes StatefulSet:\n\n```json\n{\n    \"apiVersion\": \"apps/v1beta1\",\n    \"kind\": \"StatefulSet\",\n    \"metadata\": {\n        \"name\": \"mongodb\"\n    },\n    \"spec\": {\n        \"serviceName\": \"mongo\",\n        \"replicas\": 3,\n        \"template\": {\n            \"metadata\": {\n                \"labels\": {\n                    \"app\": \"mongo\"\n                }\n            },\n            \"spec\": {\n                \"initContainers\": [\n                    {\n                        \"name\": \"mongo-init\",\n                        \"image\": \"markpeterfejes/mongo-repl-init-container:latest\",\n                        \"volumeMounts\": [\n                            {\n                                \"name\": \"mongo\",\n                                \"mountPath\": \"/data/db\"\n                            },\n                            {\n                                \"name\": \"mongod-config\",\n                                \"mountPath\": \"/mongod-config\"\n                            },\n                            {\n                                \"name\": \"workdir\",\n                                \"mountPath\": \"/workdir\"\n                            }\n                        ]\n                    }\n                ],\n                \"containers\": [\n                    {\n                        \"name\": \"mongo\",\n                        \"image\": \"mongo:3.4.9\",\n                        \"command\": [\n                            \"mongod\",\n                            \"--config\",\n                            \"/mongod-config/mongod.conf\"\n                        ],\n                        \"ports\": [\n                            {\n                                \"containerPort\": 27017,\n                                \"name\": \"mongo\"\n                            }\n                        ],\n                        \"volumeMounts\": [\n                            {\n                                \"name\": \"mongo\",\n                                \"mountPath\": \"/data/db\"\n                            },\n                            {\n                                \"name\": \"mongod-config\",\n                                \"mountPath\": \"/mongod-config\"\n                            },\n                            {\n                                \"name\": \"workdir\",\n                                \"mountPath\": \"/workdir\"\n                            }\n                        ],\n                        \"readinessProbe\": {\n                            \"exec\": {\n                                \"command\": [\n                                    \"bash\",\n                                    \"/workdir/health-check.sh\"\n                                ]\n                            },\n                            \"initialDelaySeconds\": 5,\n                            \"timeoutSeconds\": 1\n                        },\n                        \"livenessProbe\": {\n                            \"exec\": {\n                                \"command\": [\n                                    \"bash\",\n                                    \"/workdir/health-check.sh\"\n                                ]\n                            },\n                            \"initialDelaySeconds\": 30,\n                            \"periodSeconds\": 10,\n                            \"timeoutSeconds\": 2\n                        }\n                    }\n                ],\n                \"volumes\": [\n                    {\n                        \"name\": \"mongod-config\",\n                        \"configMap\": {\n                            \"name\": \"mongodb-config\"\n                        }\n                    },\n                    {\n                        \"name\": \"workdir\",\n                        \"emptyDir\": {\n                            \"medium\": \"Memory\"\n                        }\n                    }\n                ]\n            }\n        },\n        \"volumeClaimTemplates\": [\n            {\n                \"metadata\": {\n                    \"name\": \"mongo\"\n                },\n                \"spec\": {\n                    \"accessModes\": [\n                        \"ReadWriteOnce\"\n                    ],\n                    \"resources\": {\n                        \"requests\": {\n                            \"storage\": \"50Gi\"\n                        }\n                    }\n                }\n            }\n        ]\n    }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarkpeterfejes%2Fmongo-repl-init-container","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarkpeterfejes%2Fmongo-repl-init-container","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarkpeterfejes%2Fmongo-repl-init-container/lists"}