Using OpenEBS as storage for Jira on Kubernetes

OpenEBS and Jira

Introduction

Jira is a product designed to provide issue tracking and assist in moving tasks through the software development lifecycle. For this example we are leveraging a container image created by Kelsey Hightower. We will be creating a deployment and a service in this example.

Requirements

  1. Install OpenEBS

    If OpenEBS is not installed in your K8s cluster, this can done from here. If OpenEBS is already installed, go to the next step.

  2. Configure cStor Pool

    If cStor Pool is not configured in your OpenEBS cluster, this can be done from here. Sample YAML named openebs-config.yaml for configuring cStor Pool is provided in the configuration details below. If cStor pool is already configured, go to the next step.

  3. Create Storage Class

    You must configure a StorageClass to provision cStor volume on cStor pool. In this solution, we are using a StorageClass to consume the cStor Pool which is created using external disks attached on the Nodes. The storage pool is created using the steps provided in the Step 3. Since Jira is a deployment application, it requires three replication at the storage level. So cStor volume replicaCount is 3. Sample YAML named openebs-sc-disk.yaml to consume cStor pool with cStor volume replica count as 3 is provided in the configuration details below.

Deployment of Jira with OpenEBS

Next apply both the Jira deployment and service to your Kubernetes cluster. There is an example at the bottom of this guide for both.

  1. kubectl apply -f jira.yaml

Verify Jira Pods

Run the following to get the status of PostgreSQL pods.

  1. kubectl get pods

Following is an example output.

  1. NAME READY STATUS RESTARTS AGE
  2. jira-5bd96c488d-2gj8p 1/1 Running 0 2d14h

Configuration Details

openebs-config.yaml

  1. #Use the following YAMLs to create a cStor Storage Pool.
  2. # and associated storage class.
  3. apiVersion: openebs.io/v1alpha1
  4. kind: StoragePoolClaim
  5. metadata:
  6. name: cstor-disk
  7. spec:
  8. name: cstor-disk
  9. type: disk
  10. poolSpec:
  11. poolType: striped
  12. # NOTE - Appropriate disks need to be fetched using `kubectl get blockdevices -n openebs`
  13. #
  14. # `Block devices` is a custom resource supported by OpenEBS with `node-disk-manager`
  15. # as the disk operator
  16. # Replace the following with actual disk CRs from your cluster `kubectl get blockdevices -n openebs`
  17. # Uncomment the below lines after updating the actual disk names.
  18. blockDevices:
  19. blockDeviceList:
  20. # Replace the following with actual disk CRs from your cluster from `kubectl get blockdevices -n openebs`
  21. # - blockdevice-69cdfd958dcce3025ed1ff02b936d9b4
  22. # - blockdevice-891ad1b581591ae6b54a36b5526550a2
  23. # - blockdevice-ceaab442d802ca6aae20c36d20859a0b
  24. ---

openebs-sc-disk.yaml

  1. apiVersion: storage.k8s.io/v1
  2. kind: StorageClass
  3. metadata:
  4. name: openebs-cstor-disk
  5. annotations:
  6. openebs.io/cas-type: cstor
  7. cas.openebs.io/config: |
  8. - name: StoragePoolClaim
  9. value: "cstor-disk"
  10. - name: ReplicaCount
  11. value: "3"
  12. provisioner: openebs.io/provisioner-iscsi
  13. reclaimPolicy: Delete
  14. ---

jira.yaml

  1. apiVersion: extensions/v1beta1
  2. kind: Deployment
  3. metadata:
  4. labels:
  5. app: jira
  6. name: jira
  7. spec:
  8. replicas: 1
  9. template:
  10. metadata:
  11. labels:
  12. app: jira
  13. name: jira
  14. spec:
  15. containers:
  16. - name: jira
  17. image: "doriftoshoes/jira:7.3.6"
  18. resources:
  19. requests:
  20. cpu: "2"
  21. memory: "2G"
  22. volumeMounts:
  23. - name: "jira-home"
  24. mountPath: /opt/jira-home
  25. volumes:
  26. - name: jira-home
  27. persistentVolumeClaim:
  28. claimName: demo-vol1-claim
  29. ---
  30. apiVersion: v1
  31. kind: Service
  32. metadata:
  33. labels:
  34. app: jira
  35. name: jira
  36. spec:
  37. ports:
  38. - port: 8080
  39. targetPort: 8080
  40. selector:
  41. app: jira
  42. type: LoadBalancer
  43. ---
  44. kind: PersistentVolumeClaim
  45. apiVersion: v1
  46. metadata:
  47. name: demo-vol1-claim
  48. spec:
  49. storageClassName: openebs-cstor-disk
  50. accessModes:
  51. - ReadWriteOnce
  52. resources:
  53. requests:
  54. storage: 10G

Feedback

Was this page helpful?

YesNo

Thanks for the feedback. Open an issue in the GitHub repo if you want to report a problem or suggest an improvement. Engage and get additional help on https://kubernetes.slack.com/messages/openebs/.