Skip to content
This repository has been archived by the owner on Jul 7, 2020. It is now read-only.

Commit

Permalink
Merge pull request #173 from MohamedAshiqrh/heketi4
Browse files Browse the repository at this point in the history
Support for heketi 4 Release changes
  • Loading branch information
humblec committed Feb 24, 2017
2 parents faae510 + ccbe6f2 commit 4bcd75a
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 268 deletions.
82 changes: 16 additions & 66 deletions deploy/gk-deploy
Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,10 @@ debug() {
}

abort() {
${CLI} delete all,service,jobs,deployment,secret --selector="deploy-heketi"
${CLI} delete dc,svc,routes heketi
${CLI} delete svc/heketi-storage-endpoints
${CLI} delete sa heketi-service-account
if [[ "${CLI}" == *oc ]]; then
${CLI} delete template deploy-heketi
${CLI} delete secret heketi-db-backup
if [[ "${CLI}" == *oc\ * ]]; then
${CLI} delete template heketi
fi
if [[ ${GLUSTER} -eq 1 ]]; then
Expand All @@ -131,7 +129,7 @@ abort() {
${CLI} label nodes ${node} storagenode-
done <<< "$(echo -e "${NODES}")"
${CLI} delete all,service,jobs,ds,secret --selector="glusterfs"
if [[ "${CLI}" == *oc ]]; then
if [[ "${CLI}" == *oc\ * ]]; then
${CLI} delete template glusterfs
fi
fi
Expand Down Expand Up @@ -386,8 +384,7 @@ if [[ ${ABORT} -eq 1 ]]; then
fi

if [[ ${LOAD} -eq 0 ]]; then
if [[ "${CLI}" == *oc ]]; then
${CLI} create -f ${TEMPLATES}/deploy-heketi-template.yaml
if [[ "${CLI}" == *oc\ * ]]; then
${CLI} create -f ${TEMPLATES}/heketi-service-account.yaml
${CLI} create -f ${TEMPLATES}/heketi-template.yaml
if [[ $GLUSTER -eq 1 ]]; then
Expand All @@ -406,7 +403,7 @@ if [[ $GLUSTER -eq 1 ]] && [[ ${LOAD} -eq 0 ]]; then
${CLI} label nodes ${node} storagenode=glusterfs
done <<< "$(echo -e "${NODES}")"
debug "Deploying GlusterFS pods."
if [[ "${CLI}" == *oc ]]; then
if [[ "${CLI}" == *oc\ * ]]; then
${CLI} process glusterfs | ${CLI} create -f -
else
${CLI} create -f ${TEMPLATES}/glusterfs-daemonset.yaml
Expand All @@ -418,36 +415,38 @@ if [[ $GLUSTER -eq 1 ]] && [[ ${LOAD} -eq 0 ]]; then
fi

if [[ ${LOAD} -eq 0 ]]; then
if [[ "${CLI}" == *oc ]]; then
${CLI} process deploy-heketi | ${CLI} create -f -
if [[ "${CLI}" == *oc\ * ]]; then
${CLI} process heketi | ${CLI} create -f -
else
${CLI} create -f ${TEMPLATES}/deploy-heketi-deployment.yaml
${CLI} create -f ${TEMPLATES}/heketi-deployment.yaml
fi
fi

output -n "Waiting for deploy-heketi pod to start ... "
output -n "Waiting for heketi pod to start ... "
check_pods "glusterfs=heketi-pod"
output "OK"

heketi_service=""
debug -n "Determining heketi service URL ... "
while [[ "x${heketi_service}" == "x" ]]; do
if [[ "${CLI}" == *oc ]]; then
heketi_service=$(${CLI} describe routes/deploy-heketi | grep "Requested Host:" | awk '{print $3}')
if [[ "${CLI}" == *oc\ * ]]; then
heketi_service=$(${CLI} describe routes/heketi | grep "Requested Host:" | awk '{print $3}')
else
heketi_service=$(${CLI} describe svc/deploy-heketi | grep "Endpoints:" | awk '{print $2}')
heketi_service=$(${CLI} describe svc/heketi | grep "Endpoints:" | awk '{print $2}')
fi
sleep 1
done
debug "OK"

hello=$(curl http://${heketi_service}/hello 2>/dev/null)
if [[ "${hello}" != "Hello from Heketi" ]]; then
output "Failed to communicate with deploy-heketi service."
if [[ "${CLI}" == *oc ]]; then
output "Failed to communicate with heketi service."
if [[ "${CLI}" == *oc\ * ]]; then
output "Please verify that a router has been properly configured."
fi
abort
else
output "heketi is now running."
fi

tload=$(heketi-cli -s http://${heketi_service} topology load --json=${TOPOLOGY} 2>&1)
Expand All @@ -462,52 +461,3 @@ else
exit 1
fi
fi

heketi-cli -s http://${heketi_service} setup-openshift-heketi-storage
if [[ ${?} != 0 ]]; then
output "Failed on setup openshift heketi storage"
exit 1
fi

if [[ ! -f heketi-storage.json ]]; then
output "heketi-storage.json file not found"
exit 1
fi
${CLI} create -f heketi-storage.json

check_pods "job-name=heketi-storage-copy-job" "Completed"

${CLI} delete all,service,jobs,deployment,secret --selector="deploy-heketi"

if [[ "${CLI}" == *oc ]]; then
${CLI} process heketi | ${CLI} create -f -
else
${CLI} create -f ${TEMPLATES}/heketi-deployment.yaml
fi

output -n "Waiting for heketi pod to start ... "
check_pods "glusterfs=heketi-pod"
output "OK"

heketi_service=""
debug -n "Determining heketi service URL ... "
while [[ "x${heketi_service}" == "x" ]]; do
if [[ "${CLI}" == *oc ]]; then
heketi_service=$(${CLI} describe routes/heketi | grep "Requested Host:" | awk '{print $3}')
else
heketi_service=$(${CLI} describe svc/heketi | grep "Endpoints:" | awk '{print $2}')
fi
sleep 1
done
debug "OK"

hello=$(curl http://${heketi_service}/hello 2>/dev/null)
if [[ "${hello}" != "Hello from Heketi" ]]; then
output "Failed to communicate with heketi service."
if [[ "${CLI}" == *oc ]]; then
output "Please verify that a router has been properly configured."
fi
abort
else
output "heketi is now running."
fi
71 changes: 0 additions & 71 deletions deploy/kube-templates/deploy-heketi-deployment.yaml

This file was deleted.

20 changes: 15 additions & 5 deletions deploy/kube-templates/heketi-deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
---
kind: Secret
apiVersion: v1
metadata:
name: heketi-db-backup
labels:
glusterfs: heketi-db
data:
heketi.db: ''
type: Opaque
---
kind: Service
apiVersion: v1
metadata:
Expand Down Expand Up @@ -41,8 +51,6 @@ spec:
env:
- name: HEKETI_EXECUTOR
value: kubernetes
- name: HEKETI_KUBE_USE_SECRET
value: "y"
- name: HEKETI_FSTAB
value: "/var/lib/heketi/fstab"
- name: HEKETI_SNAPSHOT_LIMIT
Expand All @@ -54,6 +62,8 @@ spec:
volumeMounts:
- name: db
mountPath: "/var/lib/heketi"
- name: heketi-db-secret
mountPath: "/backupdb"
readinessProbe:
timeoutSeconds: 3
initialDelaySeconds: 3
Expand All @@ -68,6 +78,6 @@ spec:
port: 8080
volumes:
- name: db
glusterfs:
endpoints: heketi-storage-endpoints
path: heketidbstorage
- name: heketi-db-secret
secret:
secretName: heketi-db-backup
116 changes: 0 additions & 116 deletions deploy/ocp-templates/deploy-heketi-template.yaml

This file was deleted.

0 comments on commit 4bcd75a

Please sign in to comment.