Skip to content

Commit

Permalink
update(operator): add iscsiadm file and related library mounts to ope…
Browse files Browse the repository at this point in the history
…rator yaml (#26)

Signed-off-by: Payes <payes.anand@mayadata.io>
  • Loading branch information
payes authored and vishnuitta committed Jul 23, 2019
1 parent 970295a commit a0b5947
Show file tree
Hide file tree
Showing 6 changed files with 103 additions and 7 deletions.
1 change: 0 additions & 1 deletion buildscripts/csi-driver/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
FROM ubuntu:16.04
RUN apt-get update; exit 0
RUN apt-get -y install rsyslog
RUN apt-get install -y open-iscsi
#RUN apt-get clean && rm -rf /var/lib/apt/lists/*

COPY csi-driver /usr/local/bin/
Expand Down
10 changes: 7 additions & 3 deletions ci/ci-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#!/usr/bin/env bash

OPENEBS_OPERATOR=https://raw.githubusercontent.com/openebs/openebs/master/k8s/openebs-operator.yaml
CSI_OPERATOR=https://raw.githubusercontent.com/openebs/csi/master/deploy/csi-operator.yaml
CSI_OPERATOR="$GOPATH/src/github.com/openebs/csi/deploy/csi-operator.yaml"

SRC_REPO="https://github.com/openebs/maya.git"
DST_PATH="$GOPATH/src/github.com/openebs"
Expand All @@ -33,13 +33,17 @@ cd $DST_PATH/maya
function dumpCSINodeLogs() {
LC=$1
CSINodePOD=$(kubectl get pods -l app=openebs-csi-node -o jsonpath='{.items[0].metadata.name}' -n kube-system)
kubectl logs --tail=${LC} $CSINodePOD -n kube-system -c openebs-csi-plugin
kubectl describe po $CSINodePOD -n kube-system
printf "\n\n"
kubectl logs --tail=${LC} $CSINodePOD -n kube-system -c openebs-csi-plugin
printf "\n\n"
}

function dumpCSIControllerLogs() {
LC=$1
CSIControllerPOD=$(kubectl get pods -l app=openebs-csi-controller -o jsonpath='{.items[0].metadata.name}' -n kube-system)
CSIControllerPOD=$(kubectl get pods -l app=openebs-csi-controller -o jsonpath='{.items[0].metadata.name}' -n kube-system)
kubectl describe po $CSIControllerPOD -n kube-system
printf "\n\n"
kubectl logs --tail=${LC} $CSIControllerPOD -n kube-system -c openebs-csi-plugin
printf "\n\n"
}
Expand Down
24 changes: 21 additions & 3 deletions deploy/csi-operator.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
# This manifest deploys the OpenEBS control plane components, with associated CRs & RBAC rules
# NOTE: On GKE, deploy the openebs-operator.yaml in admin context

# This manifest deploys the OpenEBS CSI control plane components, with associated CRs & RBAC rules
# This manifest will only work with Ubuntu 16.04 and CentOS hosts,
# due to dependencies on kernel components of iSCSI protocol.
# For other ubuntu flavours and linux distros, this needs to be modified.
#
# Instructions to modify:
# Ubuntu-18.04 and above: https://github.com/openebs/csi/blob/master/deploy/iscsiadm-ubuntu-18.04-and-above-deps.yaml
# SUSE Linux Enterprise Server 12: https://github.com/openebs/csi/blob/master/deploy/iscsiadm-suse-enterprise-server-12-deps.yaml
# SUSE Linux Enterprise Server 15: https://github.com/openebs/csi/blob/master/deploy/iscsiadm-suse-enterprise-server-15-deps.yaml
#
# For supporting a differnet OS other than the above,
# 1) Get the list of shared object files required for iscsiadm binary in that OS version.
# 2) Check which files are already present in the openebs-csi-plugin container present in csi node pod.
# 3) Mount the required missing files inside the container.
#
####################################################
########### ############
########### CSI Node and Driver CRDs ############
Expand Down Expand Up @@ -446,6 +458,8 @@ spec:
# needed so that any mounts setup inside this container are
# propagated back to the host machine.
mountPropagation: "Bidirectional"
- name: iscsiadm-bin
mountPath: /sbin/iscsiadm
volumes:
- name: device-dir
hostPath:
Expand All @@ -463,4 +477,8 @@ spec:
hostPath:
path: /var/lib/kubelet/pods
type: Directory
- name: iscsiadm-bin
hostPath:
path: /sbin/iscsiadm
type: File
---
28 changes: 28 additions & 0 deletions deploy/iscsiadm-suse-enterprise-server-12-deps.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# SUSE Linux Enterprise Server 12
# These files need to be mounted from host OS inside the conatiner
# at the specified paths as mentioned below for using CSI Volumes

spec:
containers:
- name: openebs-csi-plugin
volumeMounts:
- name: iscsiadm-bin
mountPath: /sbin/iscsiadm
- name: iscsiadm-lib-crypto
mountPath: /lib/x86_64-linux-gnu/libcrypto.so.1.0.0
- name: iscsiadm-lib-openiscsiusr
mountPath: /lib/x86_64-linux-gnu/libopeniscsiusr.so.0.2.0
volumes:
- name: iscsiadm-bin
hostPath:
path: /sbin/iscsiadm
type: File
- name: iscsiadm-lib-crypto
hostPath:
path: /lib64/libcrypto.so.1.0.0
type: File
- name: iscsiadm-lib-openiscsiusr
hostPath:
path: /usr/lib64/libopeniscsiusr.so.0.2.0
type: File

27 changes: 27 additions & 0 deletions deploy/iscsiadm-suse-enterprise-server-15-deps.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# SUSE Linux Enterprise Server 15
# These files need to be mounted from host OS inside the conatiner
# at the specified paths as mentioned below for using CSI Volumes

spec:
containers:
- name: openebs-csi-plugin
volumeMounts:
- name: iscsiadm-bin
mountPath: /sbin/iscsiadm
- name: iscsiadm-lib-crypto
mountPath: /lib/x86_64-linux-gnu/libcrypto.so.1.1
- name: iscsiadm-lib-openiscsiusr
mountPath: /lib/x86_64-linux-gnu/libopeniscsiusr.so.0.2.0
volumes:
- name: iscsiadm-bin
hostPath:
path: /sbin/iscsiadm
type: File
- name: iscsiadm-lib-crypto
hostPath:
path: /usr/lib64/libcrypto.so.1.1
type: File
- name: iscsiadm-lib-openiscsiusr
hostPath:
path: /usr/lib64/libopeniscsiusr.so.0.2.0
type: File
20 changes: 20 additions & 0 deletions deploy/iscsiadm-ubuntu-18.04-and-above-deps.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Ubuntu 18.04 and above
# These files need to be mounted from host OS inside the conatiner
# at the specified paths as mentioned below for using CSI Volumes
spec:
containers:
- name: openebs-csi-plugin
volumeMounts:
- name: iscsiadm-bin
mountPath: /sbin/iscsiadm
- name: iscsiadm-lib-isns-nocrypto
mountPath: /lib/x86_64-linux-gnu/libisns-nocrypto.so.0
volumes:
- name: iscsiadm-bin
hostPath:
path: /sbin/iscsiadm
type: File
- name: iscsiadm-lib-isns-nocrypto
hostPath:
path: /lib/x86_64-linux-gnu/libisns-nocrypto.so.0
type: File

0 comments on commit a0b5947

Please sign in to comment.