Skip to content

Commit

Permalink
fix(cStor, deployments): add OpenEBS base directory in deployments (o…
Browse files Browse the repository at this point in the history
…penebs-archive#1583)

Signed-off-by: mittachaitu <sai.chaithanya@mayadata.io>
  • Loading branch information
sai chaithanya committed Jan 10, 2020
1 parent 5228dc2 commit 90a0eba
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 3 deletions.
21 changes: 18 additions & 3 deletions pkg/install/v1alpha1/cstor_pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ spec:
# nothing exists at the given path i.e. an empty directory will be created.
- name: HostPathType
value: DirectoryOrCreate
# OpenebsBaseDir is a hostPath directory to store process files on host machine
- name: OpenebsBaseDir
value: {{env "OPENEBS_IO_BASE_DIR" | default "/var/openebs"}}
# SparseDir is a hostPath directory where to look for sparse files
- name: SparseDir
value: {{env "OPENEBS_IO_CSTOR_POOL_SPARSE_DIR" | default "/var/openebs/sparse"}}
Expand Down Expand Up @@ -277,6 +280,8 @@ spec:
volumeMounts:
- name: device
mountPath: /dev
- name: storagepath
mountPath: /var/openebs
- name: tmp
mountPath: /tmp
- name: sparse
Expand Down Expand Up @@ -315,6 +320,8 @@ spec:
mountPath: /dev
- name: tmp
mountPath: /tmp
- name: storagepath
mountPath: /var/openebs
- name: sparse
mountPath: {{ .Config.SparseDir.value }}
- name: udev
Expand Down Expand Up @@ -360,8 +367,10 @@ spec:
volumeMounts:
- mountPath: /dev
name: device
- mountPath: /tmp
name: tmp
- name: tmp
mountPath: /tmp
- name: storagepath
mountPath: /var/openebs
- mountPath: {{ .Config.SparseDir.value }}
name: sparse
- mountPath: /run/udev
Expand All @@ -382,10 +391,16 @@ spec:
path: /dev
# this field is optional
type: Directory
- name: storagepath
hostPath:
# host dir {{ .Config.OpenebsBaseDir.value }}/cstor-pool/<spc_name> is
# created to avoid clash if two pool pods run on same node.
path: {{ .Config.OpenebsBaseDir.value }}/cstor-pool/{{.Storagepool.owner}}
type: {{ .Config.HostPathType.value }}
- name: tmp
hostPath:
# host dir {{ .Config.SparseDir.value }}/shared-<uid> is
# created to avoid clash if two replicas run on same node.
# created to avoid clash if two pool pods run on same node.
path: {{ .Config.SparseDir.value }}/shared-{{.Storagepool.owner}}
type: {{ .Config.HostPathType.value }}
- name: sparse
Expand Down
11 changes: 11 additions & 0 deletions pkg/install/v1alpha1/cstor_volume.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ spec:
value: {{env "OPENEBS_IO_VOLUME_MONITOR_IMAGE" | default "openebs/m-exporter:latest"}}
- name: ReplicaCount
value: "3"
# OpenebsBaseDir is a hostPath directory to store process files on host machine
- name: OpenebsBaseDir
value: {{env "OPENEBS_IO_BASE_DIR" | default "/var/openebs"}}
# Target Dir is a hostPath directory for target pod
- name: TargetDir
value: {{env "OPENEBS_IO_CSTOR_TARGET_DIR" | default "/var/openebs"}}
Expand Down Expand Up @@ -579,6 +582,8 @@ spec:
mountPath: /var/run
- name: conf
mountPath: /usr/local/etc/istgt
- name: storagepath
mountPath: /var/openebs
- name: tmp
mountPath: /tmp
mountPropagation: Bidirectional
Expand Down Expand Up @@ -648,6 +653,8 @@ spec:
mountPath: /var/run
- name: conf
mountPath: /usr/local/etc/istgt
- name: storagepath
mountPath: /var/openebs
- name: tmp
mountPath: /tmp
mountPropagation: Bidirectional
Expand All @@ -656,6 +663,10 @@ spec:
emptyDir: {}
- name: conf
emptyDir: {}
- name: storagepath
hostPath:
path: {{ .Config.OpenebsBaseDir.value }}/cstor-target/{{ .Volume.owner }}-target
type: DirectoryOrCreate
- name: tmp
hostPath:
path: {{ .Config.TargetDir.value }}/shared-{{ .Volume.owner }}-target
Expand Down

0 comments on commit 90a0eba

Please sign in to comment.