Deploy JIRA and Confluence on Kubernetes
Atlassian JIRA Software and Confluence are a nice agile management tool. We can start using JIRA and Confluence on Atlassian Cloud in a few minutes but we still need a private server in some cases.
I just published Kubernetes Helm charts for JIRA and Confluence. You can easily deploy JIRA and Confluence on your Kubernetes cluster.
Getting Started
Install tools
Make sure you can access to the cluster using helm
command.
brew install kubernetes-helm
helm init
In this article, we use Helmfile for configuration management.
curl -L -o ~/bin/helmfile https://github.com/roboll/helmfile/releases/download/v0.17.0/helmfile_darwin_amd64
chmod +x ~/bin/helmfile
Deploy JIRA
Get the repository of the chart.
git clone https://github.com/int128/devops-kompose
cd devops-kompose
Create helmfile.yaml
for your cluster. For example, if you deploy JIRA on https://jira.example.com
using an Ingress
, it would be the following:
releases:
- name: atlassian-jira-software
namespace: devops
chart: ./atlassian-jira-software
values:
- ingress:
enabled: true
hosts:
- jira.example.com
jira:
reverseProxyHost: jira.example.com
resources:
limits:
memory: 1536Mi
requests:
memory: 1536Mi
Now apply change.
helmfile syncexec: helm repo update
Hang tight while we grab the latest from your chart repositories...
...
Release "atlassian-jira-software" has been upgraded. Happy Helming!
LAST DEPLOYED: Wed May 16 09:32:11 2018
NAMESPACE: devops
STATUS: DEPLOYEDRESOURCES:
==> v1/Pod(related)
NAME READY STATUS RESTARTS AGE
atlassian-jira-software-7997fcf5c7-qk84j 1/1 Terminating 0 12h==> v1/PersistentVolumeClaim
NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE
atlassian-jira-software Bound pvc-f6a375fc-15e0-11e8-9a6e-06365716f47a 8Gi RWO gp2 5d==> v1/Service
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
atlassian-jira-software ClusterIP 100.68.177.22 <none> 8080/TCP 5d==> v1beta2/Deployment
NAME DESIRED CURRENT UP-TO-DATE AVAILABLE AGE
atlassian-jira-software 1 0 0 0 5d==> v1beta1/Ingress
NAME HOSTS ADDRESS PORTS AGE
atlassian-jira-software jira.example.com 1.2.3.4... 80 5dNOTES:
Atlassian JIRA Software is starting now.
Open https://jira.example.com and setup your JIRA server. You may need an external database such as AWS RDS.
Deploy Confluence
You can deploy Confluence in the same way. If you deploy Confluence on https://wiki.example.com
using an Ingress
, your helmfile.yaml
would be the following:
releases:
- name: atlassian-confluence
namespace: devops
chart: ./atlassian-confluence
values:
- ingress:
enabled: true
hosts:
- wiki.example.com
confluence:
reverseProxyHost: wiki.example.com
resources:
limits:
memory: 1800Mi
requests:
memory: 1800Mi
Then apply change:
helmfile sync
Advanced Topics
Helmfile template
Helmfile supports template such as variable substitution. You can create a template and distribute it for your various projects.
For example, you can put a placeholder in helmfile.yaml
as follows:
- name: atlassian-jira-software
namespace: devops
chart: ./atlassian-jira-software
values:
- ingress:
enabled: true
hosts:
- jira.{{ requiredEnv "DEVOPS_DOMAIN" }}
jira:
reverseProxyHost: jira.{{ requiredEnv "DEVOPS_DOMAIN" }}
Create .env
with the following variable:
export DEVOPS_DOMAIN=example.com
Apply change.
source .env
helmfile sync
Then JIRA will be deployed on jira.example.com
.
Persistence
JIRA/Confluence stores data into both a database and a persistent volume. If you are using an internal database (not recommended), both are in the same volume.
By default this chart create an 8GB volume. You can change the size in helmfile.yaml
as follows:
releases:
- name: atlassian-jira-software
namespace: devops
chart: ./atlassian-jira-software
values:
- ingress:
enabled: true
hosts:
- jira.example.com
jira:
reverseProxyHost: jira.example.com
persistence:
size: 100Gi
You should periodically take a snapshot of the database and the volume for backup.
Memory
JIRA/Confluence requires much memory for comfortable experience.
By default a pod requires 1536MB of memory. It may be enough in most cases but you can increase or decrease memory by changing helmfile.yaml
as follows:
releases:
- name: atlassian-jira-software
namespace: devops
chart: ./atlassian-jira-software
values:
- ingress:
enabled: true
hosts:
- jira.example.com
jira:
reverseProxyHost: jira.example.com
javaOptions: -Xmx2g -Xms2g
resources:
limits:
memory: 2560Mi
requires:
memory: 2560Mi
You must give both javaOptions
and resources
for preventing OOM killer. Currently JIRA does not support -XX:+UseCGroupMemoryLimitForHeap
option.
Conclusion
You can easily deploy JIRA and Confluence on your Kubernetes cluster using the Helm charts.