From 57b3acf079236778e66729ca4fee0b2270dc290e Mon Sep 17 00:00:00 2001 From: Pawan Date: Wed, 6 Nov 2019 18:06:46 +0530 Subject: [PATCH] feat(ZFSPV): adding xfs filesystem support for zfs-localpv Signed-off-by: Pawan --- buildscripts/zfs-driver/Dockerfile | 2 +- deploy/sample/mongo-statefulset.yaml | 71 ++++++++++++++++++++++++++++ 2 files changed, 72 insertions(+), 1 deletion(-) create mode 100644 deploy/sample/mongo-statefulset.yaml diff --git a/buildscripts/zfs-driver/Dockerfile b/buildscripts/zfs-driver/Dockerfile index ff73daf2b..1353f5b1c 100644 --- a/buildscripts/zfs-driver/Dockerfile +++ b/buildscripts/zfs-driver/Dockerfile @@ -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/ diff --git a/deploy/sample/mongo-statefulset.yaml b/deploy/sample/mongo-statefulset.yaml new file mode 100644 index 000000000..0655d6022 --- /dev/null +++ b/deploy/sample/mongo-statefulset.yaml @@ -0,0 +1,71 @@ +# Create a StorageClass suited for Mongo StatefulSet +# 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 + 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