Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hatamiarash7/kubernetes-mongodb
Deploy MongoDB replica set in Kubernetes
https://github.com/hatamiarash7/kubernetes-mongodb
database db kubernetes mongo mongodb mongodb-database replica replica-set replicaset replication
Last synced: 28 days ago
JSON representation
Deploy MongoDB replica set in Kubernetes
- Host: GitHub
- URL: https://github.com/hatamiarash7/kubernetes-mongodb
- Owner: hatamiarash7
- License: gpl-3.0
- Created: 2020-03-11T11:30:22.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2023-12-15T17:57:41.000Z (about 1 year ago)
- Last Synced: 2024-10-22T19:29:08.526Z (3 months ago)
- Topics: database, db, kubernetes, mongo, mongodb, mongodb-database, replica, replica-set, replicaset, replication
- Size: 14.6 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Kubernetes MongoDB
Deploy MongoDB replica set in Kubernetes## Prerequisites
You should disable THP ( transparent huge pages ). There is many ways to do that.
* Write a startup script using `gcr.io/google-containers/startup-script`
* Use `busybox` image and make DaemonSet to do this in all deployments.This one is not a critical problem. `gcr.io/google-containers/startup-scriptis` **12.5MB**, but since we are essentially just running a shell script, it can be changed to a slimmer image, like `busybox` which has an image size of **1.15MB**.
`busybox` is lacking the startup functionality of `gcr.io/google-containers/startup-script`. For this we can utilize `initContainers` which were unavailable at the time.Use [this one](https://gist.github.com/hatamiarash7/ae7fcc9c7155722df77ebbf459d467f5)
```
kubectl apply -f https://gist.githubusercontent.com/hatamiarash7/ae7fcc9c7155722df77ebbf459d467f5/raw/178d7bb870a266f86de2e881d795ebf57f6e6d77/daemon.yml
```## Install
```
kubectl apply -f replicaset.yml
kubectl apply -f services.yml
```## Usage
```
mongodb://localhost:27017/?readPreference=primary&ssl=false
```