Add MongoDB catalog item to k8s

This commit is contained in:
galal-hussein
2016-04-02 03:53:45 +02:00
parent a45179fa86
commit 0610aabcab
7 changed files with 142 additions and 0 deletions
+5
View File
@@ -0,0 +1,5 @@
# MongoDB
MongoDB is an open-source, document database designed for ease of development and scaling.
This is a MongoDB replica set deployment on Kubernetes environment, it will create MongoDB replica set with the ability to scale it in the future.
@@ -0,0 +1,32 @@
kind: ReplicationController
apiVersion: v1
metadata:
name: mongo-rc
spec:
replicas: ${sec_no}
selector:
name: mongo-sec
template:
spec:
containers:
- name: mongo-sec
image: husseingalal/mongo-k8s
ports:
- containerPort: 27017
volumeMounts:
- name: mongo-ephermal-storage
mountPath: /data/db
command:
- /run.sh
- mongod
- "--replSet"
- rs0
- "--smallfiles"
- "--noprealloc"
volumes:
- name: mongo-ephermal-storage
emptyDir: {}
metadata:
labels:
secondary: "true"
name: mongo-sec
@@ -0,0 +1,41 @@
apiVersion: v1
kind: Service
metadata:
labels:
name: mongo-primary
name: mongo-primary
spec:
ports:
- port: 27017
targetPort: 27017
selector:
name: mongo-master
---
apiVersion: v1
kind: Pod
metadata:
labels:
name: mongo-master
name: mongo-master
spec:
containers:
- name: mongo-master
image: "husseingalal/mongo-k8s"
env:
- name: PRIMARY
value: "true"
ports:
- containerPort: 27017
command:
- /run.sh
- mongod
- "--replSet"
- rs0
- "--smallfiles"
- "--noprealloc"
volumeMounts:
- mountPath: /data/db
name: mongo-primary-ephermal-storage
volumes:
- name: mongo-primary-ephermal-storage
emptyDir: {}
@@ -0,0 +1,11 @@
apiVersion: v1
kind: Service
metadata:
labels:
name: mongo-sec
name: mongo-sec
spec:
ports:
- port: 27017
selector:
secondary: "true"
@@ -0,0 +1,11 @@
.catalog:
name: MongoDB
version: 3.2-rancher1
description: MongoDB Replica Set
questions:
- variable: "sec_no"
label: "Number of Secondary nodes"
required: true
type: int
default: 2
description: "should be even number"