How to modify dbconfig.xml file for Jira on Kubernetes deployed via Helm charts

Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.

Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Summary

This article describes a workaround for non-normal scenarios. We recommend you modify the dbconfig.xml via environment variables, which is the correct way to manage the database when Jira runs in Kubernetes.

For instructions and more details, please see the Helm Chart User Guide

Jira running on Kubernetes via Helm chart uses default template files inside the container image and creates the dbconfig.xml file during the initial startup. In order to modify the contents of the dbconfig.xml file, it is possible to create configmap or secret objects and mount these to the containers via values.yml file.

It is also possible to create a custom container image and modify the /opt/atlassian/etc/dbconfig.xml.j2 file. In this article, secret and configmap solution will be explained because of the additional complexity of the container image build operation.

Environment

Jira running on Kubernetes deployed using Atlassian Helm charts.

Solution

Solution 1

Here are the steps to follow.

  1. Create a modified dbconfig.xml file. We are going to use secret object as this file includes database username and password

  2. Run the following command to create the secret from the file.

    1 kubectl create secret generic dbconfig --from-file=dbconfig.xml
  3. The new secret will have the file name dbconfig.xml as the key.

  4. Modify the values.yml file to include the new secret and mount it to the correct path.

    1 2 3 4 5 additionalFiles: - name: dbconfig type: secret key: dbconfig.xml mountPath: /var/atlassian/application-data/jira/
  5. Run a helm upgrade in order to the changes take effect. Existing pods will be terminated and replaced by the new pods.

    1 helm upgrade jira atlassian-data-center/jira --values values.yaml
  6. Run the following command to confirm the changes.

    1 kubectl exec -it jira-0 -- cat dbconfig.xml

Solution 2

All the most important parameters in the most frequently used configuration files can be configured by adding the environment variables to the 'additionalEnvironmentVariables' part of the 'values.yaml' file. The list of available environment variables can be found here.

Updated on February 28, 2025

Still need help?

The Atlassian Community is here for you.