-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ZFSPV): adding xfs filesystem support for zfs-localpv
Signed-off-by: Pawan <pawan@mayadata.io>
- Loading branch information
1 parent
d0e97cd
commit ebdb79b
Showing
2 changed files
with
77 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |