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

fix(cStor, deployments): add OpenEBS base directory in deployments #1583

Merged
merged 4 commits into from
Jan 9, 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
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