Skip to content

Commit

Permalink
feat(travis, blockdevice): add support to create cStor pools on block…
Browse files Browse the repository at this point in the history
… device (openebs#2610)

* feat(travis, blockdevice): add support to create cStor pools on block device

Signed-off-by: mittachaitu <sai.chaithanya@mayadata.io>
  • Loading branch information
sai chaithanya authored and Amit Kumar Das committed Jun 2, 2019
1 parent 116e6cc commit 4209222
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 2 deletions.
17 changes: 16 additions & 1 deletion k8s/ci/test-script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ function dumpMayaAPIServerLogs() {

waitForDeployment maya-apiserver openebs
waitForDeployment openebs-provisioner openebs
waitForDeployment openebs-ndm-operator openebs
dumpMayaAPIServerLogs 200

kubectl get pods --all-namespaces
Expand All @@ -68,7 +69,19 @@ sleep 10
#echo "------------------ Deploy Pre-release features ---------------------------"
#kubectl apply -f https://raw.githubusercontent.com/openebs/openebs/master/k8s/openebs-pre-release-features.yaml

echo "------------------------ Create sparse storagepoolclaim --------------- "
echo "------------------------ Create block device claim --------------- "
##TODO: Remove below snippet once manual BDC is supported to create cStor pools
#### Get name of blockdevice to claim the blockdevice ####
block_device_name=$(kubectl get blockdevice -n ${NS} -o jsonpath='{.items[*].metadata.name}')
wget https://raw.githubusercontent.com/openebs/openebs/master/k8s/blockdeviceclaim.yaml -O temp_bdc.yaml
sed "s|sparse-1234|$block_device_name|g" temp_bdc.yaml > bdc.yaml
kubectl apply -f bdc.yaml
sleep 15
block_device_status=$(kubectl get blockdevice -n ${NS} -o jsonpath='{.items[*].status.claimState}')
echo "BlockDevice: ${block_device_name} Claimstate: ${block_device_status}"
rm temp_bdc.yaml

echo "------------------------ Create block device storagepoolclaim --------------- "
# delete the storagepoolclaim created earlier and create new spc with min/max pool
# count 1
kubectl delete spc --all
Expand Down Expand Up @@ -115,6 +128,8 @@ kubectl get deploy -n openebs -l openebs.io/target=cstor-target
kubectl get cstorvolume
kubectl get service

## To fix intermittent travis failure
sleep 20
CSTORTARGET=$(kubectl get deploy -l openebs.io/persistent-volume-claim=openebs-pvc-in-custom-ns --no-headers | awk {'print $1'})
echo $CSTORTARGET
waitForDeployment ${CSTORTARGET} default
Expand Down
2 changes: 1 addition & 1 deletion k8s/openebs-operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ spec:
hostNetwork: true
containers:
- name: node-disk-manager
image: quay.io/openebs/node-disk-manager-amd64:v0.3.5
image: quay.io/openebs/node-disk-manager-amd64:ci
imagePullPolicy: Always
securityContext:
privileged: true
Expand Down
18 changes: 18 additions & 0 deletions k8s/sample-pv-yamls/blockdeviceclaim.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
apiVersion: openebs.io/v1alpha1
kind: BlockDeviceClaim
metadata:
name: sparse-blockdeviceclaim
namespace: openebs
spec:
## driveType is a type of the disk attached to the node
## example values: sparse, HDD, SSD
driveType: "sparse"
## blockDeviceName should be specified with block device name
## if driveType is sparse
blockDeviceName: "sparse-1234"
## hostName is the name of the node where block device is available
## value should be provided if driveType is other than sparse
hostName: ""
requirements:
requests:
capacity: 10Gi

0 comments on commit 4209222

Please sign in to comment.