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

chore(helm): add cstor operators and csi helm charts #180

Merged
merged 9 commits into from
Dec 30, 2020

Conversation

sonasingh46
Copy link
Contributor

@sonasingh46 sonasingh46 commented Sep 15, 2020

Why is this PR required? What issue does it fix?:

Add helm chart for openebs cstor operators and csi driver

Helm install dry-run output :

helm install openebs --dry-run --namespace openebs . --set openebsNDM.enabled=false
NAME: openebs
LAST DEPLOYED: Wed Dec 16 18:04:33 2020
NAMESPACE: openebs
STATUS: pending-install
REVISION: 1
TEST SUITE: None
HOOKS:
MANIFEST:
---
# Source: cstor/templates/csi-controller-rbac.yaml
kind: ServiceAccount
apiVersion: v1
metadata:
  name: openebs-cstor-csi-controller-sa
  namespace: openebs
---
# Source: cstor/templates/csi-node-rbac.yaml
apiVersion: v1
kind: ServiceAccount
metadata:
  name: openebs-cstor-csi-node-sa
  namespace: openebs
---
# Source: cstor/templates/rbac.yaml
apiVersion: v1
kind: ServiceAccount
metadata:
  name: openebs-cstor-operator
  labels:
    chart: cstor-2.4.0
    heritage: Helm
    openebs.io/version: "2.4.0"
---
# Source: cstor/templates/csi-iscsiadm-config.yaml
kind: ConfigMap
apiVersion: v1
metadata:
  name: openebs-cstor-csi-iscsiadm
data:
  iscsiadm: |
    #!/bin/sh
    if [ -x /host/sbin/iscsiadm ]; then
      chroot /host /sbin/iscsiadm "$@"
    elif [ -x /host/usr/local/sbin/iscsiadm ]; then
      chroot /host /usr/local/sbin/iscsiadm "$@"
    elif [ -x /host/bin/iscsiadm ]; then
      chroot /host /bin/iscsiadm "$@"
    elif [ -x /host/usr/local/bin/iscsiadm ]; then
      chroot /host /usr/local/bin/iscsiadm "$@"
    else
      chroot /host iscsiadm "$@"
    fi
---
# Source: cstor/templates/csi-controller-rbac.yaml
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  name: openebs-cstor-csi-snapshotter-role
rules:
  - apiGroups: [""]
    resources: ["persistentvolumes"]
    verbs: ["get", "list", "watch"]
  - apiGroups: [""]
    resources: ["persistentvolumeclaims"]
    verbs: ["get", "list", "watch"]
  - apiGroups: ["storage.k8s.io"]
    resources: ["storageclasses"]
    verbs: ["get", "list", "watch"]
  - apiGroups: [""]
    resources: ["events"]
    verbs: ["list", "watch", "create", "update", "patch"]
  - apiGroups: [""]
    resources: ["secrets"]
    verbs: ["get", "list"]
  - apiGroups: ["snapshot.storage.k8s.io"]
    resources: ["volumesnapshotclasses"]
    verbs: ["get", "list", "watch"]
  - apiGroups: ["snapshot.storage.k8s.io"]
    resources: ["volumesnapshotcontents"]
    verbs: ["create", "get", "list", "watch", "update", "delete"]
  - apiGroups: ["snapshot.storage.k8s.io"]
    resources: ["volumesnapshotcontents/status"]
    verbs: ["update"]
  - apiGroups: ["snapshot.storage.k8s.io"]
    resources: ["volumesnapshots"]
    verbs: ["get", "list", "watch", "update"]
  - apiGroups: ["snapshot.storage.k8s.io"]
    resources: ["volumesnapshots/status"]
    verbs: ["update"]
  - apiGroups: ["coordination.k8s.io"]
    resources: ["leases"]
    verbs: ["get", "watch", "list", "delete", "update", "create"]
  - apiGroups: ["apiextensions.k8s.io"]
    resources: ["customresourcedefinitions"]
    verbs: ["create", "list", "watch", "delete", "get", "update"]
---
# Source: cstor/templates/csi-controller-rbac.yaml
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  name: openebs-cstor-csi-provisioner-role
rules:
  - apiGroups: [""]
    resources: ["secrets","namespaces"]
    verbs: ["get", "list"]
  - apiGroups: [""]
    resources: ["persistentvolumes", "services"]
    verbs: ["get", "list", "watch", "create", "delete", "update", "patch"]
  - apiGroups: [""]
    resources: ["persistentvolumeclaims"]
    verbs: ["get", "list", "watch", "update"]
  - apiGroups: [""]
    resources: ["persistentvolumeclaims/status"]
    verbs: ["update", "patch"]
  - apiGroups: ["storage.k8s.io"]
    resources: ["storageclasses", "csinodes"]
    verbs: ["get", "list", "watch"]
  - apiGroups: [""]
    resources: ["events"]
    verbs: ["list", "watch", "create", "update", "patch"]
  - apiGroups: ["snapshot.storage.k8s.io"]
    resources: ["volumesnapshots"]
    verbs: ["get", "list"]
  - apiGroups: ["storage.k8s.io"]
    resources: ["volumeattachments"]
    verbs: ["get", "list", "watch", "create", "delete", "update", "patch"]
  - apiGroups: ["snapshot.storage.k8s.io"]
    resources: ["volumesnapshotcontents"]
    verbs: ["get", "list"]
  - apiGroups: ["coordination.k8s.io"]
    resources: ["leases"]
    verbs: ["*"]
  - apiGroups: ["*"]
    resources: ["cstorvolumeattachments", "cstorvolumes","cstorvolumeconfigs"]
    verbs: ["*"]
---
# Source: cstor/templates/csi-controller-rbac.yaml
############################## CSI- Attacher #######################
# Attacher must be able to work with PVs, nodes and VolumeAttachments
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  name: openebs-cstor-csi-attacher-role
rules:
  - apiGroups: [""]
    resources: ["persistentvolumes"]
    verbs: ["get", "list", "watch", "update"]
  - apiGroups: [""]
    resources: ["nodes"]
    verbs: ["get", "list", "watch"]
  - apiGroups: ["csi.storage.k8s.io"]
    resources: ["csinodeinfos"]
    verbs: ["get", "list", "watch"]
  - apiGroups: ["storage.k8s.io"]
    resources: ["volumeattachments", "csinodes"]
    verbs: ["get", "list", "watch", "update"]
---
# Source: cstor/templates/csi-controller-rbac.yaml
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  name: openebs-cstor-csi-cluster-registrar-role
rules:
  - apiGroups: ["csi.storage.k8s.io"]
    resources: ["csidrivers"]
    verbs: ["create", "delete"]
---
# Source: cstor/templates/csi-node-rbac.yaml
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  name: openebs-cstor-csi-registrar-role
rules:
  - apiGroups: [""]
    resources: ["events"]
    verbs: ["get", "list", "watch", "create", "update", "patch"]
  - apiGroups: [""]
    resources: ["persistentvolumes", "nodes", "services"]
    verbs: ["get", "list", "patch"]
  - apiGroups: ["*"]
    resources: ["cstorvolumeattachments", "cstorvolumes","cstorvolumeconfigs"]
    verbs: ["get", "list", "watch", "create", "update", "delete", "patch"]
---
# Source: cstor/templates/rbac.yaml
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  name: openebs-cstor-operator
  labels:
    chart: cstor-2.4.0
    heritage: Helm
    openebs.io/version: "2.4.0"
rules:
  - apiGroups: ["*"]
    resources: ["nodes", "nodes/proxy"]
    verbs: ["*"]
  - apiGroups: ["*"]
    resources: ["namespaces", "services", "pods", "deployments", "deployments/finalizers", "replicationcontrollers", "replicasets", "events", "endpoints", "configmaps", "secrets", "jobs", "cronjobs"]
    verbs: ["*"]
  - apiGroups: ["*"]
    resources: ["statefulsets", "daemonsets"]
    verbs: ["*"]
  - apiGroups: ["*"]
    resources: ["resourcequotas", "limitranges"]
    verbs: ["list", "watch"]
  - apiGroups: ["*"]
    resources: ["certificatesigningrequests"]
    verbs: ["list", "watch"]
  - apiGroups: ["*"]
    resources: ["storageclasses", "persistentvolumeclaims", "persistentvolumes"]
    verbs: ["*"]
  - apiGroups: ["apiextensions.k8s.io"]
    resources: ["customresourcedefinitions"]
    verbs: [ "get", "list", "create", "update", "delete", "patch"]
  - apiGroups: ["openebs.io"]
    resources: ["*"]
    verbs: ["*" ]
  - apiGroups: ["cstor.openebs.io"]
    resources: ["*"]
    verbs: ["*" ]
  - apiGroups: ["coordination.k8s.io"]
    resources: ["leases"]
    verbs: ["get", "watch", "list", "delete", "update", "create"]
  - apiGroups: ["admissionregistration.k8s.io"]
    resources: ["validatingwebhookconfigurations", "mutatingwebhookconfigurations"]
    verbs: ["get", "create", "list", "delete", "update", "patch"]
  - nonResourceURLs: ["/metrics"]
    verbs: ["get"]
  - apiGroups: ["*"]
    resources: ["upgradetasks", "migrationtasks"]
    verbs: ["*"]
  - apiGroups: ["*"]
    resources: ["poddisruptionbudgets"]
    verbs: ["get", "list", "create", "delete", "watch"]
---
# Source: cstor/templates/rbac.yaml
# Define Role that allows operations required for migration of snapshots
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  name: openebs-cstor-migration
rules:
  - apiGroups: ["snapshot.storage.k8s.io"]
    resources: ["volumesnapshotclasses"]
    verbs: ["get", "list"]
  - apiGroups: ["snapshot.storage.k8s.io"]
    resources: ["volumesnapshotcontents"]
    verbs: ["create", "get", "list"]
  - apiGroups: ["snapshot.storage.k8s.io"]
    resources: ["volumesnapshots"]
    verbs: ["create", "get", "list"]
---
# Source: cstor/templates/csi-controller-rbac.yaml
# cstor csi roles and bindings
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  name: openebs-cstor-csi-snapshotter-binding
subjects:
  - kind: ServiceAccount
    name: openebs-cstor-csi-controller-sa
    namespace: openebs
roleRef:
  kind: ClusterRole
  name: openebs-cstor-csi-snapshotter-role
  apiGroup: rbac.authorization.k8s.io
---
# Source: cstor/templates/csi-controller-rbac.yaml
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  name: openebs-cstor-csi-provisioner-binding
subjects:
  - kind: ServiceAccount
    name: openebs-cstor-csi-controller-sa
    namespace: openebs
roleRef:
  kind: ClusterRole
  name: openebs-cstor-csi-provisioner-role
  apiGroup: rbac.authorization.k8s.io
---
# Source: cstor/templates/csi-controller-rbac.yaml
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  name: openebs-cstor-csi-attacher-binding
subjects:
  - kind: ServiceAccount
    name: openebs-cstor-csi-controller-sa
    namespace: openebs
roleRef:
  kind: ClusterRole
  name: openebs-cstor-csi-attacher-role
  apiGroup: rbac.authorization.k8s.io
---
# Source: cstor/templates/csi-controller-rbac.yaml
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  name: openebs-cstor-csi-cluster-registrar-binding
subjects:
  - kind: ServiceAccount
    name: openebs-cstor-csi-controller-sa
    namespace: openebs
roleRef:
  kind: ClusterRole
  name: openebs-cstor-csi-cluster-registrar-role
  apiGroup: rbac.authorization.k8s.io
---
# Source: cstor/templates/csi-node-rbac.yaml
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  name: openebs-cstor-csi-registrar-binding
subjects:
  - kind: ServiceAccount
    name: openebs-cstor-csi-node-sa
    namespace: openebs
roleRef:
  kind: ClusterRole
  name: openebs-cstor-csi-registrar-role
  apiGroup: rbac.authorization.k8s.io
---
# Source: cstor/templates/rbac.yaml
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: openebs-cstor-operator
  labels:
    chart: cstor-2.4.0
    heritage: Helm
    openebs.io/version: "2.4.0"
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: openebs-cstor-operator
subjects:
- kind: ServiceAccount
  name: openebs-cstor-operator
  namespace: openebs
---
# Source: cstor/templates/rbac.yaml
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  name: openebs-cstor-migration
subjects:
- kind: ServiceAccount
  name: openebs-cstor-operator
  namespace: openebs
roleRef:
  kind: ClusterRole
  name: openebs-cstor-migration
  apiGroup: rbac.authorization.k8s.io
---
# Source: cstor/templates/cvc-operator-service.yaml
apiVersion: v1
kind: Service
metadata:
  name: openebs-cstor-cvc-operator-svc
  labels:
    openebs.io/component-name: cvc-operator-svc
spec:
  ports:
    - name: api
      port: 5757
      protocol: TCP
      targetPort: 5757
  selector:
    name: cvc-operator
  sessionAffinity: None
---
# Source: cstor/templates/csi-node.yaml
kind: DaemonSet
apiVersion: apps/v1
metadata:
  name: openebs-cstor-csi-node
  labels:
    chart: cstor-2.4.0
    heritage: Helm
    openebs.io/version: "2.4.0"
    name: "openebs-cstor-csi-node"
    release: openebs
    component: "openebs-cstor-csi-node"
    openebs.io/component-name: "openebs-cstor-csi-node"
spec:
  selector:
    matchLabels:
      name: "openebs-cstor-csi-node"
      release: openebs
      component: "openebs-cstor-csi-node"
  template:
    metadata:
      labels:
        chart: cstor-2.4.0
        heritage: Helm
        openebs.io/version: "2.4.0"
        name: "openebs-cstor-csi-node"
        release: openebs
        component: "openebs-cstor-csi-node"
        openebs.io/component-name: "openebs-cstor-csi-node"
    spec:
      priorityClassName: openebs-csi-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
          resources:
            {}
          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: cstor-csi-plugin
          securityContext:
            privileged: true
            capabilities:
              add: ["CAP_MKNOD", "CAP_SYS_ADMIN", "SYS_ADMIN"]
            allowPrivilegeEscalation: true
          image: "openebs/cstor-csi-driver:2.4.0"
          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_CSI_API_URL
              value: https://openebs.io
              # OpenEBS namespace where the openebs cstor operator components
              # has been installed
            - name: OPENEBS_NAMESPACE
              valueFrom:
                fieldRef:
                  fieldPath: metadata.namespace
              # Enable/Disable auto-remount feature, when volumes
              # recovers form the read-only state
            - name: REMOUNT
              value: "true"
          volumeMounts:
            - name: plugin-dir
              mountPath: /plugin
            - name: device-dir
              mountPath: /dev
            - name: pods-mount-dir
              mountPath: /var/lib/kubelet/
              # needed so that any mounts setup inside this container are
              # propagated back to the host machine.
              mountPropagation: "Bidirectional"
            - name: host-root
              mountPath: /host
              mountPropagation: "HostToContainer"
            - name: chroot-iscsiadm
              mountPath: /sbin/iscsiadm
              subPath: iscsiadm
      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/
            type: Directory
        - name: chroot-iscsiadm
          configMap:
            defaultMode: 0555
            name: openebs-cstor-csi-iscsiadm
        - name: host-root
          hostPath:
            path: /
            type: Directory
---
# Source: cstor/templates/admission-server.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: openebs-cstor-admission-server
  labels:
    chart: cstor-2.4.0
    heritage: Helm
    openebs.io/version: "2.4.0"
    app: "cstor-admission-webhook"
    release: openebs
    component: "cstor-admission-webhook"
    openebs.io/component-name: "cstor-admission-webhook"
spec:
  replicas: 
  strategy:
    type: Recreate
    rollingUpdate: null
  selector:
    matchLabels:
      app: "cstor-admission-webhook"
      release: openebs
      component: "cstor-admission-webhook"
  template:
    metadata:
      labels:
        chart: cstor-2.4.0
        heritage: Helm
        openebs.io/version: "2.4.0"
        app: "cstor-admission-webhook"
        release: openebs
        component: "cstor-admission-webhook"
        openebs.io/component-name: "cstor-admission-webhook"
    spec:
      serviceAccountName: openebs-cstor-operator
      containers:
        - name: openebs-cstor-admission-webhook
          image: "openebs/cstor-webhook:2.4.0"
          imagePullPolicy: IfNotPresent
          resources:
            {}
          args:
            - -alsologtostderr
            - -v=2
            - 2>&1
          env:
            - name: OPENEBS_NAMESPACE
              valueFrom:
                fieldRef:
                  fieldPath: metadata.namespace
            - name: ADMISSION_WEBHOOK_NAME
              value: "openebs-cstor-admission-server"
            - name: ADMISSION_WEBHOOK_FAILURE_POLICY
              value: Fail
---
# Source: cstor/templates/cspc-operator.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: openebs-cstor-cspc-operator
  labels:
    chart: cstor-2.4.0
    heritage: Helm
    openebs.io/version: "2.4.0"
    name: "cspc-operator"
    release: openebs
    component: "cspc-operator"
    openebs.io/component-name: "cspc-operator"
spec:
  selector:
    matchLabels:
      name: "cspc-operator"
      release: openebs
      component: "cspc-operator"
  replicas: 
  strategy:
    type: Recreate
  template:
    metadata:
      labels:
        chart: cstor-2.4.0
        heritage: Helm
        openebs.io/version: "2.4.0"
        name: "cspc-operator"
        release: openebs
        component: "cspc-operator"
        openebs.io/component-name: "cspc-operator"
    spec:
      serviceAccountName: openebs-cstor-operator
      containers:
        - name: openebs-cstor-cspc-operator
          imagePullPolicy: IfNotPresent
          image: "openebs/cspc-operator:2.4.0"
          resources:
            {}
          env:
            - name: OPENEBS_NAMESPACE
              valueFrom:
                fieldRef:
                  fieldPath: metadata.namespace
            - name: OPENEBS_SERVICEACCOUNT_NAME
              valueFrom:
                fieldRef:
                  fieldPath: spec.serviceAccountName
            - name: CSPC_OPERATOR_POD_NAME
              valueFrom:
                fieldRef:
                  fieldPath: metadata.name
            # OPENEBS_IO_BASE_DIR is used to configure base directory for openebs on host path.
            # Where OpenEBS can store required files. Default base path will be /var/openebs
            # - name: OPENEBS_IO_BASE_DIR
            #   value: "/var/openebs"
            # OPENEBS_IO_CSTOR_POOL_SPARSE_DIR can be used to specify the hostpath
            # to be used for saving the shared content between the side cars
            # of cstor pool pod. This ENV is also used to indicate the location
            # of the sparse devices.
            # The default path used is /var/openebs/sparse
            #- name: OPENEBS_IO_CSTOR_POOL_SPARSE_DIR
            #  value: "/var/openebs/sparse"
            - name: OPENEBS_IO_CSPI_MGMT_IMAGE
              value: "openebs/cstor-pool-manager:2.4.0"
            - name: OPENEBS_IO_CSTOR_POOL_IMAGE
              value: "openebs/cstor-pool:2.4.0"
            - name:  OPENEBS_IO_CSTOR_POOL_EXPORTER_IMAGE
              value: "openebs/m-exporter:2.4.0"
            - name: RESYNC_INTERVAL
              value: "30"
---
# Source: cstor/templates/cvc-operator.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: openebs-cstor-cvc-operator
  labels:
    chart: cstor-2.4.0
    heritage: Helm
    openebs.io/version: "2.4.0"
    name: "cvc-operator"
    release: openebs
    component: "cvc-operator"
    openebs.io/component-name: "cvc-operator"
spec:
  selector:
    matchLabels:
      name: "cvc-operator"
      release: openebs
      component: "cvc-operator"
  replicas: 
  strategy:
    type: Recreate
  template:
    metadata:
      labels:
        chart: cstor-2.4.0
        heritage: Helm
        openebs.io/version: "2.4.0"
        name: "cvc-operator"
        release: openebs
        component: "cvc-operator"
        openebs.io/component-name: "cvc-operator"
    spec:
      serviceAccountName: openebs-cstor-operator
      containers:
        - name: openebs-cstor-cvc-operator
          imagePullPolicy: IfNotPresent
          image: "openebs/cvc-operator:2.4.0"
          resources:
            {}
          env:
            # OPENEBS_IO_BASE_DIR is used to configure base directory for openebs on host path.
            # Where OpenEBS can store required files. Default base path will be /var/openebs
            # - name: OPENEBS_IO_BASE_DIR
            #   value: "/var/openebs"
            # OPENEBS_IO_CSTOR_TARGET_DIR can be used to specify the hostpath
            # that to be used for saving the core dump of cstor volume pod.
            # The default path used is /var/openebs/sparse
            #- name: OPENEBS_IO_CSTOR_TARGET_DIR
            #  value: "/var/openebs/sparse"
            - name: OPENEBS_NAMESPACE
              valueFrom:
                fieldRef:
                  fieldPath: metadata.namespace
            - name: OPENEBS_SERVICEACCOUNT_NAME
              valueFrom:
                fieldRef:
                  fieldPath: spec.serviceAccountName
            - name: OPENEBS_IO_CSTOR_TARGET_IMAGE
              value: "openebs/cstor-istgt:2.4.0"
            - name:  OPENEBS_IO_CSTOR_VOLUME_MGMT_IMAGE
              value: "openebs/cstor-volume-manager:2.4.0"
            - name:  OPENEBS_IO_VOLUME_MONITOR_IMAGE
              value: "openebs/m-exporter:2.4.0"
---
# Source: cstor/templates/csi-controller.yaml
kind: StatefulSet
apiVersion: apps/v1
metadata:
  name: openebs-cstor-csi-controller
  labels:
    chart: cstor-2.4.0
    heritage: Helm
    openebs.io/version: "2.4.0"
    name: "openebs-cstor-csi-controller"
    release: openebs
    component: "openebs-cstor-csi-controller"
    openebs.io/component-name: "openebs-cstor-csi-controller"
spec:
  selector:
    matchLabels:
      name: "openebs-cstor-csi-controller"
      release: openebs
      component: "openebs-cstor-csi-controller"
  serviceName: "openebs-csi"
  replicas: 
  template:
    metadata:
      labels:
        chart: cstor-2.4.0
        heritage: Helm
        openebs.io/version: "2.4.0"
        name: "openebs-cstor-csi-controller"
        release: openebs
        component: "openebs-cstor-csi-controller"
        openebs.io/component-name: "openebs-cstor-csi-controller"
    spec:
      priorityClassName: openebs-csi-controller-critical
      serviceAccount: openebs-cstor-csi-controller-sa
      containers:
        - name: csi-resizer
          image: "quay.io/k8scsi/csi-resizer:v0.4.0"
          resources:
            {}
          args:
            - "--v=5"
            - "--csi-address=$(ADDRESS)"
            - "--leader-election"
          env:
            - name: ADDRESS
              value: /var/lib/csi/sockets/pluginproxy/csi.sock
          imagePullPolicy: IfNotPresent
          volumeMounts:
            - name: socket-dir
              mountPath: /var/lib/csi/sockets/pluginproxy/
        - name: csi-snapshotter
          image: "quay.io/k8scsi/csi-snapshotter:v2.0.1"
          args:
            - "--csi-address=$(ADDRESS)"
          env:
            - name: ADDRESS
              value: /var/lib/csi/sockets/pluginproxy/csi.sock
          imagePullPolicy: IfNotPresent
          volumeMounts:
            - name: socket-dir
              mountPath: /var/lib/csi/sockets/pluginproxy/
        - name: snapshot-controller
          image: "quay.io/k8scsi/snapshot-controller:v2.0.1"
          args:
            - "--v=5"
            - "--leader-election=false"
          imagePullPolicy: IfNotPresent
        - name: csi-provisioner
          image: "quay.io/k8scsi/csi-provisioner:v1.6.0"
          imagePullPolicy: IfNotPresent
          args:
            - "--provisioner=cstor.csi.openebs.io"
            - "--csi-address=$(ADDRESS)"
            - "--v=5"
            - "--feature-gates=Topology=true"
            - "--extra-create-metadata=true"
          env:
            - name: MY_NAME
              valueFrom:
                fieldRef:
                  fieldPath: metadata.name
            - name: ADDRESS
              value: /var/lib/csi/sockets/pluginproxy/csi.sock
          volumeMounts:
            - name: socket-dir
              mountPath: /var/lib/csi/sockets/pluginproxy/
        - name: csi-attacher
          image: "quay.io/k8scsi/csi-attacher:v2.0.0"
          imagePullPolicy: IfNotPresent
          args:
            - "--v=5"
            - "--csi-address=$(ADDRESS)"
          env:
            - name: ADDRESS
              value: /var/lib/csi/sockets/pluginproxy/csi.sock
          volumeMounts:
            - name: socket-dir
              mountPath: /var/lib/csi/sockets/pluginproxy/
        - name: csi-cluster-driver-registrar
          image: "quay.io/k8scsi/csi-cluster-driver-registrar:v1.0.1"
          imagePullPolicy: IfNotPresent
          args:
            - "--v=5"
            - "--driver-requires-attachment=true"
            - "--csi-address=$(ADDRESS)"
          env:
            - name: ADDRESS
              value: /var/lib/csi/sockets/pluginproxy/csi.sock
          volumeMounts:
            - name: socket-dir
              mountPath: /var/lib/csi/sockets/pluginproxy/
        - name: cstor-csi-plugin
          image: "openebs/cstor-csi-driver:2.4.0"
          imagePullPolicy: IfNotPresent
          env:
            - name: OPENEBS_CONTROLLER_DRIVER
              value: controller
            - name: OPENEBS_CSI_ENDPOINT
              value: unix:///var/lib/csi/sockets/pluginproxy/csi.sock
            - name: OPENEBS_CSI_API_URL
              value: https://openebs.io
              # OpenEBS namespace where the openebs cstor operator components
              # has been installed
            - name: OPENEBS_NAMESPACE
              valueFrom:
                fieldRef:
                  fieldPath: metadata.namespace
            - name: OPENEBS_IO_INSTALLER_TYPE
              value: "cstor-helm"
            - name: OPENEBS_IO_ENABLE_ANALYTICS
              value: "true"
          args :
            - "--endpoint=$(OPENEBS_CSI_ENDPOINT)"
            - "--url=$(OPENEBS_CSI_API_URL)"
            - "--plugin=$(OPENEBS_CONTROLLER_DRIVER)"
          volumeMounts:
            - name: socket-dir
              mountPath: /var/lib/csi/sockets/pluginproxy/
      volumes:
        - name: socket-dir
          emptyDir: {}
---
# Source: cstor/templates/csi-driver.yaml
apiVersion: storage.k8s.io/v1beta1
kind: CSIDriver
metadata:
  name: cstor.csi.openebs.io
spec:
  # Supports persistent inline volumes.
  volumeLifecycleModes:
    - Persistent
    # Not yet supported but added just to support upgrade control plane seamlessly
    - Ephemeral
  # To determine at runtime which mode a volume uses, pod info and its
  # "csi.storage.k8s.io/ephemeral" entry are needed.
  podInfoOnMount: true
  attachRequired: true
---
# Source: cstor/templates/priority-class.yaml
apiVersion: scheduling.k8s.io/v1
kind: PriorityClass
metadata:
  name: openebs-csi-controller-critical
value: 900000000
globalDefault: false
description: "This priority class should be used for the CStor CSI driver controller deployment only."
---
# Source: cstor/templates/priority-class.yaml
apiVersion: scheduling.k8s.io/v1
kind: PriorityClass
metadata:
  name: openebs-csi-node-critical
value: 900001000
globalDefault: false
description: "This priority class should be used for the CStor CSI driver node deployment only."

NOTES:
The OpenEBS cstor has been installed check its status by running:
$ kubectl get pods -n openebs

Use `kubectl get bd -n openebs ` to see the list of 
blockdevices attached to the Kubernetes cluster nodes.

For more information, visit our Slack at https://openebs.io/community or view 
the documentation online at http://docs.openebs.io/.

For more information related to cstor pool and volume provisioning, visit
https://github.com/openebs/cstor-operators/tree/master/docs .

fixes #161
Signed-off-by: Ashutosh Kumar ashutosh.kumar@mayadata.io

@shubham14bajpai
Copy link
Contributor

helm/charts/crds/csinodeinfo.yaml Outdated Show resolved Hide resolved
helm/charts/crds/cstorrestore.yaml Outdated Show resolved Hide resolved
helm/charts/crds/csinodeinfo.yaml Outdated Show resolved Hide resolved
helm/charts/values.yaml Outdated Show resolved Hide resolved
helm/charts/values.yaml Outdated Show resolved Hide resolved
@shubham14bajpai
Copy link
Contributor

@sonasingh46 Another CRD needs to be added to the charts. Please include it.
https://github.com/openebs/upgrade/blob/master/ci/migrate/migrationCRD.yaml

Copy link
Contributor

@akhilerm akhilerm left a comment

Choose a reason for hiding this comment

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

given a few comments

Copy link
Contributor

@akhilerm akhilerm left a comment

Choose a reason for hiding this comment

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

@prateekpandey14 Can you change the NDM version also

Signed-off-by: prateekpandey14 <prateek.pandey@mayadata.io>
Signed-off-by: prateekpandey14 <prateek.pandey@mayadata.io>
Copy link
Contributor

@akhilerm akhilerm left a comment

Choose a reason for hiding this comment

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

@prateekpandey14 @sonasingh46 I have completed my round of reviews.
I would recommend someone who is more familiar with cstor to take a closer look at the components to make sure everything is perfect. cc: @shubham14bajpai

Signed-off-by: prateekpandey14 <prateek.pandey@mayadata.io>
Copy link
Contributor

@shubham14bajpai shubham14bajpai left a comment

Choose a reason for hiding this comment

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

lgtm

@sonasingh46
Copy link
Contributor Author

@prateekpandey14 -- Thanks a lot for raising commits in this PR and helping me out.
Looks good to me. Again, thank you very much.

Signed-off-by: prateekpandey14 <prateek.pandey@mayadata.io>
@kmova kmova merged commit cc3a50b into openebs-archive:master Dec 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add cstor-operator helm charts
5 participants