Skip to content

Commit

Permalink
feat(ZFSPV): adding xfs filesystem support for zfs-localpv
Browse files Browse the repository at this point in the history
Signed-off-by: Pawan <pawan@mayadata.io>
  • Loading branch information
pawanpraka1 committed Nov 6, 2019
1 parent d0e97cd commit ebdb79b
Show file tree
Hide file tree
Showing 2 changed files with 77 additions and 1 deletion.
2 changes: 1 addition & 1 deletion buildscripts/zfs-driver/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

FROM ubuntu:18.04
RUN apt-get update; exit 0
RUN apt-get -y install rsyslog libssl-dev
RUN apt-get -y install rsyslog libssl-dev xfsprogs
#RUN apt-get clean && rm -rf /var/lib/apt/lists/*

COPY zfs-driver /usr/local/bin/
Expand Down
76 changes: 76 additions & 0 deletions deploy/sample/mongo-statefulset.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# Create a StorageClass suited for Mongo StatefulSet
# Since Mongo takes care of replication, one replica will suffice
# Can be configured with Anti affinity topology key of hostname (default)
# or across zone.
---
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: mongo-pv-az
parameters:
blocksize: "4k"
poolname: "zfspv-pool"
fsType: "xfs"
provisioner: zfs.csi.openebs.io
---
# Headless service for stable DNS entries of StatefulSet members.
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"
replicas: 3
template:
metadata:
labels:
role: mongo
environment: test
#This label will be used by openebs to place in replica
# pod anti-affinity to make sure data of different mongo
# instances are not co-located on the same node
openebs.io/replica-anti-affinity: vehicle-db
spec:
terminationGracePeriodSeconds: 10
containers:
- name: mongo
image: mongo
command:
- mongod
- "--replSet"
- rs0
- "--bind_ip_all"
ports:
- containerPort: 27017
volumeMounts:
- name: mongo-persistent-storage
mountPath: /data/db
- name: mongo-sidecar
image: cvallance/mongo-k8s-sidecar
env:
- name: MONGO_SIDECAR_POD_LABELS
value: "role=mongo,environment=test"
volumeClaimTemplates:
- metadata:
name: mongo-persistent-storage
spec:
storageClassName: mongo-pv-az
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 5Gi

0 comments on commit ebdb79b

Please sign in to comment.