How to manage Data
Harness Open Source writes data beneath /data
within the running container. It is important to understand where this data is written on the host, to avoid any potential data loss.
When running Harness Open Source locally, it is highly recommended to use a bind mount or named volume to avoid potential data loss during system upgrades or reboots.
When running a shared Harness Open Source instance for a development team, you should take extra steps to protect the Harness Open Source instance data.
Local instance
On MacOS or Linux, create a harness
directory in a safe location:
mkdir $HOME/harness
Then pass -v $HOME/harness:/data
in your docker run
command.
docker run -d \
-p 3000:3000 \
-v /var/run/docker.sock:/var/run/docker.sock \
-v $HOME/harness:/data \
--name harness \
--restart always \
harness/harness
Harness Open Source will now store its data beneath the harness
directory in your home directory.
AWS EC2
Create a separate volume just for your Harness Open Source instance data. Ensure the volume is an appropriate size for your team and number of repositories.
Create an EBS volume for your Harness Open Source instance data and mount it at /mnt/harness-data
, then pass -v /mnt/harness-data:/data
in your docker run
command.
docker run -d \
-p 3000:3000 -p 3022:3022 \
-v /var/run/docker.sock:/var/run/docker.sock \
-v /mnt/harness-data:/data \
--name harness \
--restart always \
harness/harness
Harness Open Source will now store its data beneath /mnt/harness-data
on your EC2 instance.
Kubernetes
The Harness Open Source Helm chart will create a Persistent Volume Claim for the Harness Open Source container's /data
directory.
To learn how to manage this volume, contact your Kubernetes administrator. If you are using a managed Kubernetes service, refer to your provider's documentation.