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

cherry pick from master #891

Merged
merged 12 commits into from Jan 18, 2019

Conversation

Projects
None yet
3 participants
@ashishranjan738
Copy link
Contributor

ashishranjan738 commented Jan 16, 2019

This PR contains cherrypicks of bugfixes and enhancements of CASTemplates and mayactl from the master branch.

Output of mayactl:

bash-4.3# mayactl volume list
Namespace  Name                                      Status   Type   Capacity  StorageClass          Access Mode
---------  ----                                      ------   ----   --------  -------------         -----------
default    pvc-ff9dbb31-3676-11e9-b4c3-b4b686bd0cff  Running  jiva   5G        openebs-jiva-default  ReadWriteOnce
openebs    pvc-ff9b9337-3676-11e9-b4c3-b4b686bd0cff  Running  cstor  5G        openebs-cstor-sparse  ReadWriteOnce

bash-4.3# mayactl volume describe --volname=pvc-ff9dbb31-3676-11e9-b4c3-b4b686bd0cff

Portal Details :
----------------
IQN               :   iqn.2016-09.com.openebs.jiva:pvc-ff9dbb31-3676-11e9-b4c3-b4b686bd0cff
Volume            :   pvc-ff9dbb31-3676-11e9-b4c3-b4b686bd0cff
Portal            :   10.101.73.201:3260
Size              :   5G
Controller Status :   running,running
Controller Node   :   minikube
Replica Count     :   1

Application Details:
--------------------
Application Pod Name      : N/A
Application Pod Namespace : N/A

Replica Details :
-----------------
NAME                                                              ACCESSMODE      STATUS      IP             NODE
-----                                                             -----------     -------     ---            ----- 
pvc-ff9dbb31-3676-11e9-b4c3-b4b686bd0cff-rep-857575fc46-8d2cd     RW              running     172.17.0.8     minikube 


bash-4.3# mayactl volume describe --volname=pvc-ff9b9337-3676-11e9-b4c3-b4b686bd0cff -n openebs

Portal Details :
----------------
IQN               :   iqn.2016-09.com.openebs.cstor:pvc-ff9b9337-3676-11e9-b4c3-b4b686bd0cff
Volume            :   pvc-ff9b9337-3676-11e9-b4c3-b4b686bd0cff
Portal            :   10.111.149.126:3260
Size              :   5G
Controller Status :   running,running,running
Controller Node   :   minikube
Replica Count     :   1

Application Details:
--------------------
Application Pod Name      : N/A
Application Pod Namespace : N/A

Replica Details :
-----------------
NAME                                                                STATUS      POOL NAME                  NODE    
----                                                                ------      ---------                  ----- 
pvc-ff9b9337-3676-11e9-b4c3-b4b686bd0cff-cstor-sparse-pool-wqt1     Running     cstor-sparse-pool-wqt1     minikube 

ashishranjan738 added some commits Dec 20, 2018

fix(mayactl): intermittent error with mayactl stats (#861)
mayactl stats intermittently displays invalid status, since the length of the metrics don't match on the consecutive runs. as it turns out, the length can vary for the metrics. 

- removed the check on the length
- refactored the code to check for the named metric availability


Signed-off-by: Ashish Ranjan <ashishranjan738@gmail.com>
fix(cstor_volume): Missing namespace and target details in volume lis…
…t response when target is deployed in PVC namespace

Volume list run task currently searches target pods and services in openebs namespace due to which the namespace name and other target details can be populated when the target is deployed in PVC namespace.

Signed-off-by: Ashish Ranjan <ashishranjan738@gmail.com>
enhance(cstor_volume): add toleration time of 30s in cstor target dep…
…loyment

Currently the default toleration time for cstor target deployment is 300s which can be reduced to 30s for faster provisioning in case of node taint scenarios

Signed-off-by: Ashish Ranjan <ashishranjan738@gmail.com>
enhance(CASEngine): add support to list PV in CASEngine
Signed-off-by: Ashish Ranjan <ashishranjan738@gmail.com>

This PR adds support for listing Persistent Volume in CASEngine which was missing earlier.This will help in listing information from PV.
enhance(CASTemplate,RunTask): add SC and access mode info in volume l…
…ist output

Signed-off-by: Ashish Ranjan <ashishranjan738@gmail.com>

This commit adds StorageClass and access mode information in volume list runtask and CASTemplate for CStor and jiva.This information can be used by third party clients.
enhance(CASEngine): add support to list PV in CASEngine
Signed-off-by: Ashish Ranjan <ashishranjan738@gmail.com>

This PR does the following things.
-> Adds StorageClass and access mode information in mayactl volume list command which will be useful for users.
-> Output of mayactl volume list:

```
Namespace  Name                                      Status   Type   Capacity  Storage Class         Access Mode
---------  ----                                      ------   ----   --------  -------------         -----------
default    pvc-c530cae3-140c-11e9-9348-b4b686bd0cff  Running  jiva   5G        openebs-jiva-default  ReadWriteOnce
openebs    pvc-c53033e9-140c-11e9-9348-b4b686bd0cff  Running  cstor  5G        openebs-cstor-sparse  ReadWriteOnce
```

Signed-off-by: Ashish Ranjan <ashishranjan738@gmail.com>
refactor(CASVolume): move access mode info from CASVolume annotation …
…to CASVolume spec

Signed-off-by: Ashish Ranjan <ashishranjan738@gmail.com>

This PR moves access mode information from annotation to spec as access mode is a spec of CASVolume
refactor(CASVolume): improves CASTemplate and comments on CASVolumeSp…
…ec struct

Signed-off-by: Ashish Ranjan <ashishranjan738@gmail.com>

This PR adds default check on cstor volume list CASTemplate and improves comment on CASVolumeSpec struct

Signed-off-by: Ashish Ranjan <ashishranjan738@gmail.com>
refactor(cstor-sparse-pool): add replica count field in cstor sparse sc
Signed-off-by: Ashish Ranjan <ashishranjan738@gmail.com>

This commit adds replica count field in openebs-sparse-default storage class to make it similar to openebs-jiva-default storageclass
enhance(volume-read): adds application name and namespace in CASVolum…
…e read response

Signed-off-by: Ashish Ranjan <ashishranjan738@gmail.com>

This commit adds application name and namespace in CASVolume read response which will make it easy to map volumes with their respective applications.

Note: The default value is N/A if application information is not found

Example:

When application is attached to the volume:

{
  "apiVersion": "v1alpha1",
  "kind": "CASVolume",
  "metadata": {
    "annotations": {
      "openebs.io/controller-ips": "172.17.0.8",
      "openebs.io/controller-node-name": "127.0.0.1",
      "openebs.io/controller-status": "running,running,running",
      "openebs.io/cvr-names": "pvc-4be46c41-15a1-11e9-a262-b4b686bd0cff-cstor-sparse-pool-4lxy",
      "openebs.io/node-names": "127.0.0.1",
      "openebs.io/pool-names": "cstor-sparse-pool-4lxy",
      "openebs.io/application-pod-name": "percona-598c987dc8-mdsnw",
      "openebs.io/application-pod-namespace": "app-percona-ns"
    },
    "name": "pvc-4be46c41-15a1-11e9-a262-b4b686bd0cff"
  },
  "spec": {
    "accessMode": "",
    "capacity": "5G",
    "casType": "cstor",
    "fsType": "ext4",
    "iqn": "iqn.2016-09.com.openebs.cstor:pvc-4be46c41-15a1-11e9-a262-b4b686bd0cff",
    "lun": 0,
    "replicas": "1",
    "targetIP": "10.0.0.160",
    "targetPort": "3260",
    "targetPortal": "10.0.0.160:3260"
  },
  "status": {
    "Message": "",
    "Phase": "",
    "Reason": ""
  }
}

When application is not attached:

{
  "apiVersion": "v1alpha1",
  "kind": "CASVolume",
  "metadata": {
    "annotations": {
      "openebs.io/controller-status": "running,running,running",
      "openebs.io/cvr-names": "pvc-55154c45-15a1-11e9-a262-b4b686bd0cff-cstor-sparse-pool-4lxy",
      "openebs.io/node-names": "127.0.0.1",
      "openebs.io/pool-names": "cstor-sparse-pool-4lxy",
      "openebs.io/application-pod-name": "N/A",
      "openebs.io/application-pod-namespace": "N/A",
      "openebs.io/controller-ips": "172.17.0.10",
      "openebs.io/controller-node-name": "127.0.0.1"
    },
    "name": "pvc-55154c45-15a1-11e9-a262-b4b686bd0cff"
  },
  "spec": {
    "accessMode": "",
    "capacity": "5G",
    "casType": "cstor",
    "fsType": "ext4",
    "iqn": "iqn.2016-09.com.openebs.cstor:pvc-55154c45-15a1-11e9-a262-b4b686bd0cff",
    "lun": 0,
    "replicas": "1",
    "targetIP": "10.0.0.18",
    "targetPort": "3260",
    "targetPortal": "10.0.0.18:3260"
  },
  "status": {
    "Message": "",
    "Phase": "",
    "Reason": ""
  }
}
enhance(mayactl): add application information in mayactl
Signed-off-by: Ashish Ranjan <ashishranjan738@gmail.com>

This commit adds application details in mayactl volume describe command which will be very useful in finding which application is using the volume.

Note: The default is N/A if information is not present

Output of mayactl volume describe:

When application information is present in response:
Portal Details :
----------------
IQN               :   iqn.2016-09.com.openebs.cstor:pvc-4be46c41-15a1-11e9-a262-b4b686bd0cff
Volume            :   pvc-4be46c41-15a1-11e9-a262-b4b686bd0cff
Portal            :   10.0.0.160:3260
Size              :   5G
Controller Status :   running,running,running
Controller Node   :   127.0.0.1
Replica Count     :   1

Application Details:
--------------------
Application Pod Name: percona-598c987dc8-mdsnw
Application Pod Namespace: app-percona-ns

Replica Details :
-----------------
NAME                                                                STATUS      POOL NAME                  NODE
----                                                                ------      ---------                  -----
pvc-4be46c41-15a1-11e9-a262-b4b686bd0cff-cstor-sparse-pool-4lxy     Running     cstor-sparse-pool-4lxy     127.0.0.1

When application information is not present in response:
Portal Details :
----------------
IQN               :   iqn.2016-09.com.openebs.cstor:pvc-55154c45-15a1-11e9-a262-b4b686bd0cff
Volume            :   pvc-55154c45-15a1-11e9-a262-b4b686bd0cff
Portal            :   10.0.0.18:3260
Size              :   5G
Controller Status :   running,running,running
Controller Node   :   127.0.0.1
Replica Count     :   1

Application Details:
--------------------
Application Pod Name: N/A
Application Pod Namespace: N/A

Replica Details :
-----------------
NAME                                                                STATUS      POOL NAME                  NODE
----                                                                ------      ---------                  -----
pvc-55154c45-15a1-11e9-a262-b4b686bd0cff-cstor-sparse-pool-4lxy     Running     cstor-sparse-pool-4lxy     127.0.0.1
refactor(volume-read,mayactl): removes list pv operation in volume re…
…ad and fix mayactl template

Signed-off-by: Ashish Ranjan <ashishranjan738@gmail.com>

This PR removes PV list operation in volume read as PVC name can be taken from target service and improved mayactl volume describe template.

New template output:

Portal Details :
----------------
IQN               :   iqn.2016-09.com.openebs.cstor:pvc-520fdb78-172c-11e9-9a3c-b4b686bd0cff
Volume            :   pvc-520fdb78-172c-11e9-9a3c-b4b686bd0cff
Portal            :   10.0.0.78:3260
Size              :   4G
Controller Status :   running,running,running
Controller Node   :   127.0.0.1
Replica Count     :   1

Application Details:
--------------------
Application Pod Name      : N/A
Application Pod Namespace : N/A

Replica Details :
-----------------
NAME                                                                STATUS      POOL NAME                  NODE
----                                                                ------      ---------                  -----
pvc-520fdb78-172c-11e9-9a3c-b4b686bd0cff-cstor-sparse-pool-4uut     Running     cstor-sparse-pool-4uut     127.0.0.1

@ashishranjan738 ashishranjan738 requested review from AmitKumarDas and kmova Jan 16, 2019

@codecov

This comment has been minimized.

Copy link

codecov bot commented Jan 16, 2019

Codecov Report

Merging #891 into v0.8.x will decrease coverage by 0.04%.
The diff coverage is 58.33%.

Impacted file tree graph

@@            Coverage Diff             @@
##           v0.8.x     #891      +/-   ##
==========================================
- Coverage   42.27%   42.22%   -0.05%     
==========================================
  Files         141      141              
  Lines        9380     9402      +22     
==========================================
+ Hits         3965     3970       +5     
- Misses       5149     5164      +15     
- Partials      266      268       +2
Impacted Files Coverage Δ
pkg/install/v1alpha1/cstor_volume.go 0% <ø> (ø) ⬆️
pkg/install/v1alpha1/cstor_sparse_pool_claim.go 100% <ø> (ø) ⬆️
pkg/install/v1alpha1/jiva_volume.go 0% <ø> (ø) ⬆️
pkg/client/k8s/k8s.go 3.59% <0%> (-0.07%) ⬇️
pkg/task/task.go 0% <0%> (ø) ⬆️
pkg/task/meta.go 30.34% <0%> (-0.27%) ⬇️
cmd/mayactl/app/command/volumes_list.go 0% <0%> (ø) ⬆️
cmd/mayactl/app/command/volume_stats.go 91.04% <100%> (+2%) ⬆️
cmd/mayactl/app/command/volume_info.go 74.4% <64.7%> (-1.1%) ⬇️
pkg/task/v1alpha1/store_command.go 81.44% <0%> (-2.07%) ⬇️

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 9124db1...951b8ce. Read the comment docs.

@prateekpandey14
Copy link
Member

prateekpandey14 left a comment

lgtm

@AmitKumarDas AmitKumarDas merged commit cf3aca0 into openebs:v0.8.x Jan 18, 2019

4 of 5 checks passed

Better Code Hub ✋ This code needs to be refactored
Details
code-analysis/fixmie The Fixmie analysis has finished
codecov/patch 58.33% of diff hit (target 42.27%)
Details
codecov/project Absolute coverage decreased by -0.04% but relative coverage increased by +16.06% compared to 9124db1
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.