Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(zfspv): mounting the root filesystem to remove the dependency on the Operating system #204

Merged
merged 2 commits into from
Sep 7, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelogs/unreleased/204-pawanpraka1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
mounting the root filesystem to remove the dependency on the Operating system
65 changes: 31 additions & 34 deletions deploy/yamls/ubuntu/zfs-driver.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -701,6 +701,24 @@ roleRef:

---

kind: ConfigMap
apiVersion: v1
metadata:
name: openebs-zfspv-bin
namespace: kube-system # should be the same namespace where it is getting mounted
data:
zfs: |
#!/bin/sh
if [ -x /host/sbin/zfs ]; then
chroot /host /sbin/zfs "$@"
elif [ -x /host/usr/sbin/zfs ]; then
chroot /host /usr/sbin/zfs "$@"
else
chroot /host zfs "$@"
fi

---

kind: DaemonSet
apiVersion: apps/v1
metadata:
Expand Down Expand Up @@ -777,18 +795,13 @@ spec:
mountPath: /dev
- name: encr-keys
mountPath: /home/keys
- name: zfs-bin
- name: chroot-zfs
mountPath: /sbin/zfs
- name: libzpool
mountPath: /lib/libzpool.so.2
- name: libzfscore
mountPath: /lib/libzfs_core.so.1
- name: libzfs
mountPath: /lib/libzfs.so.2
- name: libuutil
mountPath: /lib/libuutil.so.1
- name: libnvpair
mountPath: /lib/libnvpair.so.1
subPath: zfs
- name: host-root
mountPath: /host
mountPropagation: "HostToContainer"
readOnly: true
- name: pods-mount-dir
mountPath: /var/lib/kubelet/
# needed so that any mounts setup inside this container are
Expand All @@ -803,30 +816,14 @@ spec:
hostPath:
path: /home/keys
type: DirectoryOrCreate
- name: zfs-bin
hostPath:
path: /sbin/zfs
type: File
- name: libzpool
- name: chroot-zfs
configMap:
defaultMode: 0555
name: openebs-zfspv-bin
- name: host-root
hostPath:
path: /lib/libzpool.so.2.0.0
type: File
- name: libzfscore
hostPath:
path: /lib/libzfs_core.so.1.0.0
type: File
- name: libzfs
hostPath:
path: /lib/libzfs.so.2.0.0
type: File
- name: libuutil
hostPath:
path: /lib/libuutil.so.1.0.1
type: File
- name: libnvpair
hostPath:
path: /lib/libnvpair.so.1.0.1
type: File
path: /
type: Directory
- name: registration-dir
hostPath:
path: /var/lib/kubelet/plugins_registry/
Expand Down
65 changes: 31 additions & 34 deletions deploy/zfs-operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1531,6 +1531,24 @@ roleRef:

---

kind: ConfigMap
apiVersion: v1
metadata:
name: openebs-zfspv-bin
namespace: kube-system # should be the same namespace where it is getting mounted
data:
zfs: |
#!/bin/sh
if [ -x /host/sbin/zfs ]; then
chroot /host /sbin/zfs "$@"
elif [ -x /host/usr/sbin/zfs ]; then
chroot /host /usr/sbin/zfs "$@"
else
chroot /host zfs "$@"
fi

---

kind: DaemonSet
apiVersion: apps/v1
metadata:
Expand Down Expand Up @@ -1607,18 +1625,13 @@ spec:
mountPath: /dev
- name: encr-keys
mountPath: /home/keys
- name: zfs-bin
- name: chroot-zfs
mountPath: /sbin/zfs
- name: libzpool
mountPath: /lib/libzpool.so.2
- name: libzfscore
mountPath: /lib/libzfs_core.so.1
- name: libzfs
mountPath: /lib/libzfs.so.2
- name: libuutil
mountPath: /lib/libuutil.so.1
- name: libnvpair
mountPath: /lib/libnvpair.so.1
subPath: zfs
- name: host-root
mountPath: /host
mountPropagation: "HostToContainer"
readOnly: true
- name: pods-mount-dir
mountPath: /var/lib/kubelet/
# needed so that any mounts setup inside this container are
Expand All @@ -1633,30 +1646,14 @@ spec:
hostPath:
path: /home/keys
type: DirectoryOrCreate
- name: zfs-bin
hostPath:
path: /sbin/zfs
type: File
- name: libzpool
- name: chroot-zfs
configMap:
defaultMode: 0555
name: openebs-zfspv-bin
- name: host-root
hostPath:
path: /lib/libzpool.so.2.0.0
type: File
- name: libzfscore
hostPath:
path: /lib/libzfs_core.so.1.0.0
type: File
- name: libzfs
hostPath:
path: /lib/libzfs.so.2.0.0
type: File
- name: libuutil
hostPath:
path: /lib/libuutil.so.1.0.1
type: File
- name: libnvpair
hostPath:
path: /lib/libnvpair.so.1.0.1
type: File
path: /
type: Directory
- name: registration-dir
hostPath:
path: /var/lib/kubelet/plugins_registry/
Expand Down