Skip to content
New issue

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

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

Already on GitHub? # to your account

Add(env): Add environment variable to enable remount feature #56

Merged
merged 4 commits into from
Nov 20, 2019
Merged

Conversation

payes
Copy link
Contributor

@payes payes commented Nov 17, 2019

To enable the auto remount feature when the volume goes into read only mode, REMOUNT env can be added to the csi node driver section in csi operator yaml:

kind: DaemonSet
apiVersion: apps/v1
metadata:
  name: openebs-cstor-csi-node
  namespace: kube-system
spec:
  selector:
    matchLabels:
      app: openebs-cstor-csi-node
  template:
    metadata:
      labels:
        app: openebs-cstor-csi-node
        role: openebs-cstor-csi
    spec:
      priorityClassName: system-node-critical
      serviceAccount: openebs-cstor-csi-node-sa
      hostNetwork: true
      containers:
        - name: csi-node-driver-registrar
          image: quay.io/k8scsi/csi-node-driver-registrar:v1.0.1
          imagePullPolicy: IfNotPresent
          args:
            - "--v=5"
            - "--csi-address=$(ADDRESS)"
            - "--kubelet-registration-path=$(DRIVER_REG_SOCK_PATH)"
          lifecycle:
            preStop:
              exec:
                command: ["/bin/sh", "-c", "rm -rf /registration/cstor.csi.openebs.io /registration/cstor.csi.openebs.io-reg.sock"]
          env:
            - name: ADDRESS
              value: /plugin/csi.sock
            - name: DRIVER_REG_SOCK_PATH
              value: /var/lib/kubelet/plugins/cstor.csi.openebs.io/csi.sock
            - name: KUBE_NODE_NAME
              valueFrom:
                fieldRef:
                  fieldPath: spec.nodeName
            - name: NODE_DRIVER
              value: openebs-cstor-csi
          volumeMounts:
            - name: plugin-dir
              mountPath: /plugin
            - name: registration-dir
              mountPath: /registration
        - name: openebs-csi-plugin
          securityContext:
            privileged: true
            capabilities:
              add: ["CAP_MKNOD", "CAP_SYS_ADMIN", "SYS_ADMIN"]
            allowPrivilegeEscalation: true
          image: quay.io/openebs/cstor-csi-driver:ci
          imagePullPolicy: IfNotPresent
          args:
            - "--nodeid=$(OPENEBS_NODE_ID)"
            - "--endpoint=$(OPENEBS_CSI_ENDPOINT)"
            - "--url=$(OPENEBS_CSI_API_URL)"
            - "--plugin=$(OPENEBS_NODE_DRIVER)"
          env:
            - name: OPENEBS_NODE_ID
              valueFrom:
                fieldRef:
                  fieldPath: spec.nodeName
            - name: OPENEBS_CSI_ENDPOINT
              value: unix:///plugin/csi.sock
            - name: OPENEBS_NODE_DRIVER
              value: node
            - name: OPENEBS_API_URL
              value: https://api.openebs.com/
            - name: OPENEBS_MAPI_SVC
              value: maya-apiserver-service
            - name: OPENEBS_NAMESPACE
              value: openebs
            - name: REMOUNT
              value: "true"
          volumeMounts:
            - name: plugin-dir
              mountPath: /plugin
            - name: device-dir
              mountPath: /dev
            - name: pods-mount-dir
              mountPath: /var/lib/kubelet/pods
              # needed so that any mounts setup inside this container are
              # propagated back to the host machine.
              mountPropagation: "Bidirectional"
            - name: iscsiadm-bin
              mountPath: /sbin/iscsiadm
            #Enable the following for Ubuntu 18.04
            - name: iscsiadm-lib-isns-nocrypto
              mountPath: /lib/x86_64-linux-gnu/libisns-nocrypto.so.0
      volumes:
        - name: device-dir
          hostPath:
            path: /dev
            type: Directory
        - name: registration-dir
          hostPath:
            path: /var/lib/kubelet/plugins_registry/
            type: DirectoryOrCreate
        - name: plugin-dir
          hostPath:
            path: /var/lib/kubelet/plugins/cstor.csi.openebs.io/
            type: DirectoryOrCreate
        - name: pods-mount-dir
          hostPath:
            path: /var/lib/kubelet/pods
            type: Directory
        - name: iscsiadm-bin
          hostPath:
            path: /sbin/iscsiadm
            type: File
        #Enable the following for Ubuntu 18.04
        - name: iscsiadm-lib-isns-nocrypto
          hostPath:
            path: /lib/x86_64-linux-gnu/libisns-nocrypto.so.0
            type: File

@codecov-io
Copy link

codecov-io commented Nov 17, 2019

Codecov Report

Merging #56 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master      #56   +/-   ##
=======================================
  Coverage   53.72%   53.72%           
=======================================
  Files          12       12           
  Lines         631      631           
=======================================
  Hits          339      339           
  Misses        272      272           
  Partials       20       20

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1b0eee1...2e62434. Read the comment docs.

Signed-off-by: Payes <payes.anand@mayadata.io>
Copy link
Contributor

@prateekpandey14 prateekpandey14 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Signed-off-by: Payes <payes.anand@mayadata.io>
@kmova kmova merged commit 710be25 into openebs-archive:master Nov 20, 2019
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants