Skip to content

Instantly share code, notes, and snippets.

@austbot austbot/Mongo.yml
Created Oct 26, 2017

Embed
What would you like to do?
Mongo Db as a Statefulset, Kube 1.8
apiVersion: v1
kind: Service
metadata:
name: mongo
labels:
name: mongo
spec:
ports:
- port: 27017
targetPort: 27017
clusterIP: None
selector:
role: mongo
---
apiVersion: apps/v1beta1
kind: StatefulSet
metadata:
name: mongo
spec:
serviceName: "mongo"
updateStrategy:
type: RollingUpdate
replicas: 3
template:
metadata:
labels:
role: "mongo"
environment: development
spec:
terminationGracePeriodSeconds: 10
containers:
- name: mongo
image: mongo
command:
- mongod
- "--replSet"
- rs0
- "--smallfiles"
- "--noprealloc"
ports:
- containerPort: 27017
volumeMounts:
- name: mongo-persistent-storage
mountPath: /data/db
- name: proposal-mongo-sidecar
image: austbot/mongo-k8s-sidecar
env:
- name: KUBERNETES_MONGO_SERVICE_NAME
value: "mongo"
- name: MONGO_SIDECAR_POD_LABELS
value: "role=mongo,environment=development"
volumeClaimTemplates:
- metadata:
name: mongo-persistent-storage
annotations:
volume.beta.kubernetes.io/storage-class: aws-efs
spec:
accessModes: [ "ReadWriteOnce" ]
resources:
requests:
storage: 1Mi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.